opendnssec-1.4.3/0000775000175000017500000000000012247571202010665 500000000000000opendnssec-1.4.3/config.guess0000755000175000017500000012743212247571136013142 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (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 . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a 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. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: opendnssec-1.4.3/tools/0000775000175000017500000000000012247571206012031 500000000000000opendnssec-1.4.3/tools/solaris/0000775000175000017500000000000012247571206013505 500000000000000opendnssec-1.4.3/tools/solaris/ods-signerd.init.in0000664000175000017500000000506711341330411017126 00000000000000#!/bin/sh # # $Id: ods-signerd.init.in 2892 2010-02-24 23:06:49Z jakob $ # # Copyright (c) 2009 Nominet UK. 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, 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 ``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 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. # # export SOFTHSM_CONF=/etc/softhsm.conf export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@OPENDNSSEC_LIB_DIR@ signer_bin_file="@OPENDNSSEC_SBIN_DIR@/ods-signerd" signer_cli_file="@OPENDNSSEC_SBIN_DIR@/ods-signer" signer_pid_file="@OPENDNSSEC_PID_DIR@/signerd.pid" case "$1" in 'start') # Check program is not running ps -ef | grep '\' | grep -v grep if [ $? -eq 0 ] then echo "signer_engine is already running" exit 0 fi # Start program up if [ -x $signer_bin_file ] then echo "Starting signer engine" $signer_bin_file & fi ;; 'stop') # Stop program if [ -x $signer_cli_file ] then echo "Stopping signer engine" $signer_cli_file stop else if [ -x $signer_pid_file ] then echo "Stopping signer engine via pid_file" kill -TERM `cat $signer_pid_file` else echo "Stopping signer engine via pid" PID=`ps -ef | grep '\' | grep -v grep | awk '{ print $2 }'` if [ ! -z "$PID" ] then kill $PID fi fi fi ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0 opendnssec-1.4.3/tools/solaris/Makefile.in0000664000175000017500000003363712247571140015503 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 2233 2009-10-15 12:19:44Z jakob $ VPATH = @srcdir@ 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@ subdir = tools/solaris DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ods-enforcerd.init.in $(srcdir)/ods-signerd.init.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = ods-enforcerd.init ods-signerd.init CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ \ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub EXTRA_DIST = \ README \ ods-enforcerd-smf.xml \ ods-signerd-smf.xml \ ods-enforcerd.init.in \ ods-signerd.init.in all: all-am .SUFFIXES: $(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 tools/solaris/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/solaris/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): ods-enforcerd.init: $(top_builddir)/config.status $(srcdir)/ods-enforcerd.init.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-signerd.init: $(top_builddir)/config.status $(srcdir)/ods-signerd.init.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 installdirs: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool 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-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # 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: opendnssec-1.4.3/tools/solaris/ods-signerd-smf.xml0000664000175000017500000000372411267542336017161 00000000000000 opendnssec-1.4.3/tools/solaris/ods-enforcerd.init.in0000664000175000017500000000453711341330411017443 00000000000000#!/bin/sh # # $Id: ods-enforcerd.init.in 2892 2010-02-24 23:06:49Z jakob $ # # Copyright (c) 2009 Nominet UK. 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, 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 ``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 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. # # export SOFTHSM_CONF=/etc/softhsm.conf export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@OPENDNSSEC_LIB_DIR@ enforcer_bin_file="@OPENDNSSEC_SBIN_DIR@/ods-enforcerd" enforcer_pid_file="@OPENDNSSEC_PID_DIR@/enforcerd.pid" case "$1" in 'start') # Check program is not running ps -ef | grep '$enforcer_bin_file' | grep -v grep if [ $? -eq 0 ] then echo "ods-enforcerd is already running" exit 0 fi # Start program up if [ -x $enforcer_bin_file ] then echo "Starting enforcer" $enforcer_bin_file & fi ;; 'stop') # Stop programs if [ -x $enforcer_pid_file ] then echo "Stopping ods-enforcerd via pid_file" kill -TERM `cat $enforcer_pid_file` else PID=`ps -ef | grep '$enforcer_bin_file' | grep -v grep | awk '{ print $2 }'` if [ ! -z "$PID" ] then echo "Stopping ods-enforcerd via pid" kill $PID fi fi ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0 opendnssec-1.4.3/tools/solaris/ods-enforcerd-smf.xml0000664000175000017500000000373411267542336017476 00000000000000 opendnssec-1.4.3/tools/solaris/README0000664000175000017500000000231311267542336014307 00000000000000# $Id: README 2288 2009-10-21 08:22:54Z sion $ Solaris scripts to control OpenDNSSEC processes: Any package for solaris should probably include something like the following: In the prototype: ... i preremove i postinstall d none /lib/svc/method/opendnssec 0755 root root d none /var/svc/manifest/site/opendnssec 0755 root root d none /lib/svc/method/opendnssec/ods-signerd.init=ods-signerd.init 0555 root root d none /lib/svc/method/opendnssec/ods-enforcerd.init=ods-enforcerd.init 0555 root root f none /var/svc/manifest/site/opendnssec/ods-signerd-smf.xml=ods-signerd-smf.xml 0555 root root f none /var/svc/manifest/site/opendnssec/ods-enforcerd-smf.xml=ods-enforcerd-smf.xml 0555 root root ... In the preremove ... /usr/sbin/svcadm disable enforcer /usr/sbin/svccfg -v delete svc:/site/opendnssec/enforcer:default /usr/sbin/svcadm disable signer /usr/sbin/svccfg -v delete svc:/site/opendnssec/signer:default ... In the postinstall ... /usr/sbin/svccfg -v import /var/svc/manifest/site/opendnssec/ods-signerd-smf.xml /usr/sbin/svccfg -v import /var/svc/manifest/site/opendnssec/ods-enforcerd-smf.xml ... Then you can use: svcadm [enable|disable] signer svcadm [enable|disable] enforcer to control the processes opendnssec-1.4.3/tools/solaris/Makefile.am0000664000175000017500000000075211265611540015460 00000000000000# $Id: Makefile.am 2233 2009-10-15 12:19:44Z jakob $ MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ \ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub EXTRA_DIST = \ README \ ods-enforcerd-smf.xml \ ods-signerd-smf.xml \ ods-enforcerd.init.in \ ods-signerd.init.in opendnssec-1.4.3/tools/ods-control.in0000664000175000017500000000730511750466637014562 00000000000000#!/bin/sh # # $Id: ods-control.in 6300 2012-05-03 11:35:59Z jerry $ # # Copyright (c) 2009 .SE (The Internet Infrastructure Foundation) # 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, 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 ``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 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. # progname="ods-control" bindir="@OPENDNSSEC_BIN_DIR@" sbindir="@OPENDNSSEC_SBIN_DIR@" enforcer_pid_file="@OPENDNSSEC_ENFORCER_PIDFILE@" signer_pid_file="@OPENDNSSEC_SIGNER_PIDFILE@" signer_socket_file="@OPENDNSSEC_SIGNER_SOCKET@" case "$1" in 'ksm') shift "$bindir/ods-ksmutil" $@ ;; 'hsm') shift "$bindir/ods-hsmutil" $@ ;; 'signer') case "$2" in 'start') echo "Starting signer engine..." "$sbindir/ods-signer" start RETVAL=$? if [ $RETVAL = 0 ]; then i=0 while [ ! -r "$signer_pid_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not start signer" exit $RETVAL fi done i=0 while [ ! -r "$signer_socket_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not start signer" exit $RETVAL fi done sleep 1 "$sbindir/ods-signer" running RETVAL=$? fi exit $RETVAL ;; *) shift "$sbindir/ods-signer" "$@" ;; esac ;; 'enforcer') case "$2" in 'start') echo "Starting enforcer..." "$sbindir/ods-enforcerd" RETVAL=$? if [ $RETVAL = 0 ]; then i=0 while [ ! -r "$enforcer_pid_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not start enforcer" break fi done fi exit $RETVAL ;; 'stop') echo "Stopping enforcer..." if [ -r "$enforcer_pid_file" ]; then kill -TERM `cat "$enforcer_pid_file"` RETVAL=$? if [ $RETVAL = 0 ]; then i=0 while [ -r "$enforcer_pid_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not stop enforcer" break fi done fi else echo "Cannot find PID file" RETVAL=1 fi exit $RETVAL ;; 'notify') echo "Notifying enforcer of new database..." if [ -r "$enforcer_pid_file" ]; then kill -HUP `cat "$enforcer_pid_file"` RETVAL=$? else echo "Cannot find PID file" RETVAL=1 fi exit $RETVAL ;; *) echo "usage: $progname enforcer start|stop|notify" ;; esac ;; 'start') "$0" enforcer start RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi "$0" signer start RETVAL=$? exit $RETVAL ;; 'stop') "$0" enforcer stop echo "Stopping signer engine..." "$sbindir/ods-signer" stop ;; *) echo "usage: $progname ksm|hsm|signer|enforcer|start|stop ..." ;; esac opendnssec-1.4.3/tools/Makefile.in0000664000175000017500000007473012247571140014026 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 1971 2009-10-01 06:37:51Z jakob $ VPATH = @srcdir@ 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@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ods-control.8.in $(srcdir)/ods-control.in \ $(srcdir)/ods-kasp2html.in $(srcdir)/ods-timing.5.in \ $(srcdir)/opendnssec.7.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = ods-control ods-timing.5 opendnssec.7 \ ods-control.8 ods-kasp2html CONFIG_CLEAN_VPATH_FILES = 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; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man5_MANS) $(man7_MANS) $(man8_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = solaris sbin_SCRIPTS = ods-control bin_SCRIPTS = ods-kasp2html man5_MANS = ods-timing.5 man7_MANS = opendnssec.7 man8_MANS = ods-control.8 all: all-recursive .SUFFIXES: $(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 tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/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): ods-control: $(top_builddir)/config.status $(srcdir)/ods-control.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-timing.5: $(top_builddir)/config.status $(srcdir)/ods-timing.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ opendnssec.7: $(top_builddir)/config.status $(srcdir)/opendnssec.7.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-control.8: $(top_builddir)/config.status $(srcdir)/ods-control.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-kasp2html: $(top_builddir)/config.status $(srcdir)/ods-kasp2html.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || 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"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || 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"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(man5_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | 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,^[^5][0-9a-z]*$$,5,;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)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$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)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man7: $(man7_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(MKDIR_P) "$(DESTDIR)$(man7dir)" @list='$(man7_MANS)'; test -n "$(man7dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | 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,^[^7][0-9a-z]*$$,7,;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)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$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)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list='$(man7_MANS)'; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(man8_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | 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='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-sbinSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man5 install-man7 install-man8 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-man uninstall-sbinSCRIPTS uninstall-man: uninstall-man5 uninstall-man7 uninstall-man8 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binSCRIPTS \ 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-man5 \ install-man7 install-man8 install-pdf install-pdf-am \ install-ps install-ps-am install-sbinSCRIPTS install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binSCRIPTS uninstall-man uninstall-man5 \ uninstall-man7 uninstall-man8 uninstall-sbinSCRIPTS # 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: opendnssec-1.4.3/tools/ods-control.8.in0000664000175000017500000000342311701067442014710 00000000000000.TH "ods-control" "8" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-control" .\" $Id: ods-control.8.in 6011 2012-01-04 15:24:18Z jakob $ .SH "NAME" .LP .B ods\-control \- OpenDNSSEC control utility .SH "SYNOPSIS" .LP .B ods\-control ksm ... .br .B ods\-control hsm ... .br .B ods\-control signer ... .br .B ods\-control start .br .B ods\-control stop .br .B ods\-control enforcer start .br .B ods\-control enforcer stop .br .B ods\-control enforcer notify .SH "DESCRIPTION" .LP ods\-control is a helper utility which gives a combined interface for different command utilities within OpenDNSSEC. It can also start and stop OpenDNSSEC by controlling the two daemons. .SH "OPTIONS" .LP .TP \fBksm\fR The remainder of the command line will be sent to the ods\-ksmutil utility .TP \fBhsm\fR The remainder of the command line will be sent to the ods\-hsmutil utility .TP \fBsigner\fR The remainder of the command line will be sent to the ods\-signer utility .TP \fBstart\fR Will start the two daemons of OpenDNSSEC, ods\-enforcerd and ods\-signerd .TP \fBstop\fR Will stop the two daemons of OpenDNSSEC, ods\-enforcerd and ods\-signerd .TP \fBenforcer start\fR Start the ods\-enforcerd daemon without touching the ods\-signerd and return non-zero on problems .TP \fBenforcer stop\fR Stop the ods\-enforcerd daemon without touching the ods\-signerd and return non-zero on problems .TP \fBenforcer notify\fR Notify the enforcer that its database has been updated and may need further processing by the KASP Enforcer. .SH "SEE ALSO" .LP ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-control was written by Jakob Schlyter as part of the OpenDNSSEC project. opendnssec-1.4.3/tools/ods-timing.5.in0000664000175000017500000000557311701067442014524 00000000000000.TH "ods-timing" "5" "February 2010" OpenDNSSEC "OpenDNSSEC timinig" .\" $Id: ods-timing.5.in 6011 2012-01-04 15:24:18Z jakob $ .SH "NAME" .LP .B ods-timing \- OpenDNSSEC timing specification .SH "SYNOPSIS" .LP .B @OPENDNSSEC_CONFIG_DIR@/conf.xml .br .B @OPENDNSSEC_CONFIG_DIR@/kasp.xml .br .B @OPENDNSSEC_CONFIG_DIR@/zonelist.xml .SH "DESCRIPTION" .LP The configuration files of OpenDNSSEC need to have timing descriptions, notably for periods. These descriptions follow ISO 8601 with exceptions for the duration of a month and a year, as these periods would be allowed to vary if ISO 8601 were strictly adhered to. .PP Durations are represented by the format \fBP[n]Y[n]M[n]DT[n]H[n]M[n]S\fR. In these representations, the \fB[n]\fR is replaced by the value for each of the date and time elements that follow the \fB[n]\fR. Leading zeros are not required. The capital letters \fBP\fR, \fBY\fR, \fBM\fR, \fBW\fR, \fBD\fR, \fBT\fR, \fBH\fR, \fBM\fR and \fBS\fR are designators for each of the date and time elements and are not replaced .TP .B P is the duration designator (historically called "period") placed at the start of the duration representation. .TP .B Y is the year designator that follows the value for the number of years. .TP .B M is the month designator that follows the value for the number of months. .TP .B W is the week designator that follows the value for the number of weeks. .TP .B D is the day designator that follows the value for the number of days. .TP .B T is the time designator that precedes the time components of the representation. .TP .B H is the hour designator that follows the value for the number of hours. .TP .B M is the minute designator that follows the value for the number of minutes. .TP .B S is the second designator that follows the value for the number of seconds. .PP For example, .B P3Y6M4DT12H30M5S represents a duration of "three years, six months, four days, twelve hours, thirty minutes, and five seconds". Date and time elements including their designator may be omitted if their value is zero, and lower order elements may also be omitted for reduced precision. For example, .B P23DT23H and .B P4Y are both acceptable duration representations. .SH "EXCEPTION" .LP A year or month vary in duration depending on the current date. For OpenDNSSEC, we assume fixed values .TP .B One month is assumed to be 31 days. .TP .B One year is assumed to be 365 days. .PP This exception may or may not change in future releases of OpenDNSSEC. The reason for making this exception is to avoid complicating this software in a way that may not meet any practical need. .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), opendnssec(7), ISO 8601, .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B OpenDNSSEC was made by the OpenDNSSEC project, to be found on .B http://www.opendnssec.org/ opendnssec-1.4.3/tools/opendnssec.7.in0000664000175000017500000000761411701067442014613 00000000000000.TH "opendnssec" "7" "February 2010" "OpenDNSSEC" "OpenDNSSEC overview" .\" $Id: opendnssec.7.in 6011 2012-01-04 15:24:18Z jakob $ .SH "NAME" .LP .B OpenDNSSEC \- making DNSSEC easy for DNS administrators .SH "SYNOPSIS" .LP .B ods-control start .LP .B ods-control stop .LP .B ods-ksmutil .RB \fIsubcommand...\fB .LP .B ods-signer .RB [\fIsubcommand...\fB] .SH "DESCRIPTION" .LP OpenDNSSEC is a complete DNSSEC zone signing system which maintains stability and security of signed domains. DNSSEC adds many cryptographic concerns to DNS; OpenDNSSEC automates those to allow current DNS administrators to adopt DNSSEC. .PP Domain signing is done by placing OpenDNSSEC between the place where the zone files are edited and where they are published. The current version of OpenDNSSEC supports files and AXFR to communicate the zone data; effectively, OpenDNSSEC acts as a "bump in the wire" between editing and publishing a zone. .PP OpenDNSSEC has two daemons, which are unitedly started and stopped through the .I ods\-control(8) command. The two daemons in turn invoke other programs to get their work done. .PP One of the daemons is the KASP Enforcer, which enforces policies that define security and timing requirements for each individual zone. Operators tend to interact with the KASP Enforcer a lot, through the .I ods\-ksmutil(1) command. .PP The other daemon is the Signer Engine, which in turn signs the zone content. It retrieves that content from a file or through AXFR, and publishes a signed version of the zone into a file or through AXFR. Direct interaction with the Signer Engine, although not normally necessary, is possible through the .I ods\-signer(8) command. .PP The keys that sign the zones are managed by an independent repository, which is accessed over a PKCS #11 interface. The principle idea of this interface being to unleash access to cryptographic hardware, there are implementations in software. Also, implementations range from open to commercial, and from very simple to highly secure. By default, OpenDNSSEC is configured to run on top of a SoftHSM, but a few other commands exist to test any Hardware Security Module that may sit under the PKCS #11 API. .SH "OPERATIONAL PRACTICES" The approach used by OpenDNSSEC follows the best current practice of two kinds of key per zone: .TP .B KSK\fR or \fBKey Signing Key This key belongs in the apex of a zone, and is referenced in the parent zone (quite possibly a registry) in the form of DS records alongside NS records. These parent references function as trust delegations. The KSK is usually a longer key, and it could harm the efficiency of secure resolvers if all individual resource records were signed with it. This is why it is advisable to use the KSK only to sign the ZSK. In DNS records, the KSK can usually be recognised by having its SEP (Secure Entry Point) flag set. .TP .B ZSK\fR or \fBZone Signing Key This key also belongs in the apex of a zone, and is actually used to sign the resource records in a zone. It is a shorter key for reasons of efficiency, that is rolled over on a fairly regular basis. To detach these rollovers from the parent, the ZSK is not directly trusted by the parent zone, but instead its trust is established by way of a signature by the KSK on the ZSK. .PP OpenDNSSEC is mindful about the period of validity of each key, and will rollover in time to keep the domain signed, with new keys, without any downtime for the secure domain. The only thing that is not standardised, and thus cannot be automated at the moment is the interface between a zone and its parent, so this has to be done manually, or scripted around OpenDNSSEC. .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B OpenDNSSEC was made by the OpenDNSSEC project, to be found on .B http://www.opendnssec.org/ opendnssec-1.4.3/tools/Makefile.am0000664000175000017500000000037311410413030013765 00000000000000# $Id: Makefile.am 1971 2009-10-01 06:37:51Z jakob $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = solaris sbin_SCRIPTS = ods-control bin_SCRIPTS = ods-kasp2html man5_MANS = ods-timing.5 man7_MANS = opendnssec.7 man8_MANS = ods-control.8 opendnssec-1.4.3/tools/ods-kasp2html.in0000664000175000017500000000352111346414504014766 00000000000000#!/bin/sh # # $Id: ods-kasp2html.in 3035 2010-03-12 10:36:52Z jakob $ # # Copyright (c) 2010 Kirei AB. 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, 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 ``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 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. # XMLLINT=@XMLLINT@ XSLTPROC=@XSLTPROC@ KASP_SCHEMA=@OPENDNSSEC_DATA_DIR@/kasp.rng KASP_XSL=@OPENDNSSEC_DATA_DIR@/kasp2html.xsl KASP_XML=$1 if [ ! -x "$XMLLINT" ]; then echo "error: xmllint required, but not found" exit 1 fi if [ ! -x "$XSLTPROC" ]; then echo "error: xsltproc required, but not found" exit 1 fi if [ -f "$KASP_XML" ]; then $XMLLINT --noout --relaxng $KASP_SCHEMA $KASP_XML && \ $XSLTPROC $KASP_XSL $KASP_XML else echo "usage: $0 [kasp.xml]" fi opendnssec-1.4.3/configure.ac0000664000175000017500000002005512167227357013107 00000000000000# $Id: configure.ac 7187 2013-07-10 09:52:47Z matthijs $ m4_sinclude([version.m4]) AC_PREREQ(2.61) AC_INIT([opendnssec], OPENDNSSEC_VERSION, [http://bugs.opendnssec.org/]) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE(foreign) ACX_PREFIXHACK OPENDNSSEC_COMMON # extensions AC_USE_SYSTEM_EXTENSIONS # standard programs AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_MAKE_SET AC_PROG_RANLIB # additional programs AC_PATH_PROG(XMLLINT, xmllint) AC_PATH_PROG(XSLTPROC, xsltproc) AC_PATH_PROG(JAVA, java) AC_PATH_PROG(CP, cp) AC_DEFINE_UNQUOTED(CP_COMMAND, "$CP", [System cp(3) command]) # building ACX_ARG_RPATH ACX_RUNTIME_PATH_ADD ACX_PEDANTIC ACX_STRICT # compiler flags CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"]) CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"]) CHECK_COMPILER_FLAG_NEEDED($C99FLAG, [#include ], [CFLAGS="$CFLAGS $C99FLAG"]) CHECK_COMPILER_FLAG_NEEDED(-D__EXTENSIONS__, [ #include "confdefs.h" #include #include int test() { int a; char **opts = NULL; a = getopt(2, opts, "a"); return a; } ], [CFLAGS="-D__EXTENSIONS__ $CFLAGS"]) # checks for header files AC_HEADER_STDC AC_HEADER_STDBOOL AC_HEADER_TIME AC_CHECK_HEADERS([fcntl.h inttypes.h stdio.h stdlib.h string.h syslog.h unistd.h]) AC_CHECK_HEADERS(getopt.h,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([errno.h getopt.h pthread.h signal.h stdarg.h stdint.h strings.h]) AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h]) AC_CHECK_HEADERS([libxml/parser.h libxml/relaxng.h libxml/xmlreader.h libxml/xpath.h]) # checks for typedefs, structures, and compiler characteristics AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_TYPE_UINT16_T AC_MSG_CHECKING(for union semun) AC_TRY_COMPILE([#include #include #include ], [union semun arg;], [have_union_semun=1], [have_union_semun=0] ) if test $have_union_semun = 1; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_UNION_SEMUN, 1, [union semun is defined]) else AC_MSG_RESULT(no) fi # pthread ACX_PTHREAD LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" # checks for library functions AC_CHECK_FUNCS([arc4random arc4random_uniform]) AC_CHECK_FUNCS([dup2 endpwent select strerror strtol]) AC_CHECK_FUNCS([getpass getpassphrase memset]) AC_CHECK_FUNCS([localtime_r memset strdup strerror strstr strtol strtoul]) AC_CHECK_FUNCS([setregid setreuid]) AC_CHECK_FUNCS([chown stat exit time atoi getpid waitpid sigfillset]) AC_CHECK_FUNCS([malloc calloc realloc free]) AC_CHECK_FUNCS([strlen strncmp strncat strncpy strerror strncasecmp strdup]) AC_CHECK_FUNCS([fgetc fopen fclose ferror fprintf vsnprintf snprintf fflush]) AC_CHECK_FUNCS([openlog closelog syslog]) AC_CHECK_FUNCS([openlog_r closelog_r syslog_r vsyslog_r]) AC_CHECK_FUNCS([chroot getgroups setgroups initgroups]) AC_CHECK_FUNCS([close unlink fcntl socket listen bzero]) AC_CHECK_FUNCS([va_start va_end]) AC_CHECK_FUNCS([xmlInitParser xmlCleanupParser xmlCleanupThreads]) AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock]) AC_CHECK_FUNCS([pthread_cond_init pthread_cond_signal pthread_cond_destroy pthread_cond_wait pthread_cond_timedwait]) AC_CHECK_FUNCS([pthread_create pthread_detach pthread_self pthread_join pthread_sigmask]) AC_FUNC_CHOWN AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_MKTIME AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_VPRINTF AC_REPLACE_FUNCS(strlcat) AC_REPLACE_FUNCS(strlcpy) AC_REPLACE_FUNCS(b64_pton) AC_REPLACE_FUNCS(b64_ntop) ACX_BROKEN_SETRES AC_CHECK_STRPTIME # check for some target-specific stuff case "$host" in *-*-darwin*) AC_DEFINE(SETEUID_BREAKS_SETUID, 1, [Define if your platform breaks doing a seteuid before a setuid]) AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken]) AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken]) ;; esac # check for the sockaddr_un.sun_len member AC_CHECK_MEMBER([struct sockaddr_un.sun_len], [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])], [], [ #include #include ]) # timeshift AC_ARG_ENABLE(timeshift, AC_HELP_STRING([--enable-timeshift], [Enable timeshift debug]), [enable_timeshift="${enableval}"], [enable_timeshift="no"]) AC_MSG_CHECKING(if we should enable timeshift debugging) if test "x${enable_timeshift}" = "xyes"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(ENFORCER_TIMESHIFT, 1, [timeshift debug]) else AC_MSG_RESULT(no) fi # common dependencies ACX_LIBXML2 ACX_LDNS(1,6,12) ACX_LDNS_NOT(1,6,14, [binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html]) ACX_LDNS_NOT(1,6,15, [fail to create NSEC3 bitmap for empty non-terminals, see http://www.nlnetlabs.nl/pipermail/ldns-users/2012-November/000565.html]) ACX_PKCS11_MODULES ACX_RT ACX_LIBC ACX_SSL # libhsm ACX_DLOPEN AC_DEFINE_UNQUOTED([HSM_DEFAULT_CONFIG],["$OPENDNSSEC_CONFIG_FILE"],[Default configuration file.]) # enforcer AC_PATH_PROG(PERL, perl) if test -z "$PERL"; then AC_MSG_ERROR([perl not found]) fi ACX_DBPARAMS ACX_DATABASE_BACKEND ACX_CUNIT AC_DEFINE_UNQUOTED(SIGNER_CLI_UPDATE, "$OPENDNSSEC_SIGNER_CLI update", [Path to the OpenDNSSEC signer engine cli]) AM_CONDITIONAL([ENABLE_ENFORCER], [test "${enable_signer}" = "yes"]) # cunit AM_CONDITIONAL([WITH_CUNIT], [test "${with_cunit}" != "no" -a -n "$CUNIT_LIBS"]) # signer AC_ARG_ENABLE(signer, AC_HELP_STRING([--disable-signer], [Disable signer build (default enabled)]), [enable_signer="${enableval}"], [enable_signer="yes"]) AH_BOTTOM([ /* define before includes as it specifies what standard to use. */ #if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \ || !defined (HAVE_CTIME_R_PROTO) \ || defined (STRPTIME_NEEDS_DEFINES) # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 600 # endif # ifndef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200112 # endif # ifndef _BSD_SOURCE # define _BSD_SOURCE 1 # endif # ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 # endif # ifndef _STDC_C99 # define _STDC_C99 1 # endif # ifndef _ALL_SOURCE # define _ALL_SOURCE 1 # endif #endif ]) AM_CONDITIONAL([ENABLE_SIGNER], [test "${enable_signer}" = "yes"]) # check for a green cucumber (but only if we can shift time) if test "x${enable_timeshift}" = "xyes"; then AC_PATH_PROG(CUCUMBER, cucumber) fi AM_CONDITIONAL([WITH_CUCUMBER], [test -x "${CUCUMBER}"]) # doxygen DX_PDF_FEATURE(OFF) DX_PS_FEATURE(OFF) DX_INIT_DOXYGEN(${PACKAGE_NAME}, [Doxyfile], [doxygen-doc]) AC_CONFIG_HEADER([common/config.h]) AC_CONFIG_FILES([ Makefile Doxyfile common/Makefile conf/Makefile conf/addns.xml conf/conf.xml conf/enforcerstate.xml conf/kasp.xml conf/signconf.xml conf/zonelist.xml enforcer/Makefile enforcer/common/Makefile enforcer/enforcerd/Makefile enforcer/enforcerd/ods-enforcerd.8 enforcer/ksm/Makefile enforcer/ksm/include/Makefile enforcer/ksm/include/ksm/Makefile enforcer/test/Makefile enforcer/test/cucumber/Makefile enforcer/test/cucumber/c_conf.xml enforcer/test/cucumber/c_kasp.xml enforcer/test/cucumber/c_zonelist.base.xml enforcer/test/cunit/Makefile enforcer/test/cunit/database_setup_mysql.sh enforcer/test/cunit/database_setup_sqlite3.sh enforcer/utils/Makefile enforcer/utils/ods-kaspcheck.1 enforcer/utils/ods-ksmutil.1 libhsm/Makefile libhsm/src/Makefile libhsm/src/bin/Makefile libhsm/src/bin/ods-hsmspeed.1 libhsm/src/bin/ods-hsmutil.1 libhsm/src/lib/Makefile libhsm/checks/Makefile libhsm/checks/conf-softhsm.xml libhsm/checks/conf-sca6000.xml libhsm/checks/conf-etoken.xml libhsm/checks/conf-multi.xml libhsm/checks/conf-opensc.xml libhsm/checks/conf-ncipher.xml libhsm/checks/conf-aepkeyper.xml signer/Makefile signer/man/Makefile signer/man/ods-signer.8 signer/man/ods-signerd.8 signer/src/Makefile tools/Makefile tools/ods-control tools/solaris/Makefile tools/solaris/ods-enforcerd.init tools/solaris/ods-signerd.init tools/ods-timing.5 tools/opendnssec.7 tools/ods-control.8 tools/ods-kasp2html ]) AC_OUTPUT opendnssec-1.4.3/m4/0000775000175000017500000000000012247571201011204 500000000000000opendnssec-1.4.3/m4/acx_rt.m40000664000175000017500000000076411423547701012660 00000000000000# $Id: acx_rt.m4 3626 2010-07-27 12:23:29Z rb $ AC_DEFUN([ACX_RT],[ RT_LIBS="-lrt" tmp_LIBS=$LIBS LIBS="$LIBS $RT_LIBS" AC_CHECK_LIB( [rt], [clock_gettime], [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime])], [RT_LIBS=""] ) LIBS=$tmp_LIBS AC_SUBST(RT_LIBS) AC_CHECK_HEADERS(sys/time.h time.h) if test "x$RT_LIBS" = "x" ; then AC_CHECK_FUNC( [gettimeofday], [], [AC_MSG_ERROR(Could not find the function clock_gettime or gettimeofday)] ) fi ]) opendnssec-1.4.3/m4/acx_ssl.m40000664000175000017500000000343211665367032013034 00000000000000# Check for SSL, original taken from # http://www.gnu.org/software/ac-archive/htmldoc/check_ssl.html and # modified for OpenDNSSEC. AC_DEFUN([ACX_SSL], [ AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], [enable SSL (will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr)]),[ ],[ withval="yes" ]) if test x_$withval != x_no; then AC_MSG_CHECKING(for SSL) if test x_$withval = x_ -o x_$withval = x_yes; then withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr" fi for dir in $withval; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl="yes"; AC_DEFINE_UNQUOTED([HAVE_SSL], [], [Define if you have the SSL libraries installed.]) if test x_$ssldir != x_/usr; then SSL_INCLUDES="$SSL_INCLUDES -I$ssldir/include"; fi break; fi done if test x_$found_ssl != x_yes; then AC_MSG_ERROR(Cannot find the SSL libraries in $withval) else AC_MSG_RESULT(found in $ssldir) HAVE_SSL=yes if test x_$ssldir != x_/usr; then SSL_LIBS="$SSL_LIBS -L$ssldir/lib"; fi if test x_$ssldir = x_/usr/sfw; then SSL_LIBS="$SSL_LIBS -R$ssldir/lib"; fi AC_CHECK_LIB(crypto, HMAC_CTX_init,, [ AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required]) ]) AC_CHECK_FUNCS([EVP_sha1 EVP_sha256]) fi AC_SUBST(HAVE_SSL) AC_SUBST(SSL_INCLUDES) AC_SUBST(SSL_LIBS) fi ])dnl opendnssec-1.4.3/m4/acx_pkcs11_modules.m40000664000175000017500000000361011663453334015062 00000000000000# $Id: acx_pkcs11_modules.m4 5910 2011-11-24 14:38:20Z rb $ AC_DEFUN([ACX_PKCS11_MODULES],[ AC_ARG_WITH(pkcs11-softhsm, AS_HELP_STRING([--with-pkcs11-softhsm=PATH],[specify path of SoftHSM PKCS#11 library (default PREFIX/lib/softhsm/libsofthsm.so)]), [ pkcs11_softhsm_module="$withval" ], [ pkcs11_softhsm_module="$full_libdir/softhsm/libsofthsm.so" ] ) AC_ARG_WITH(pkcs11-sca6000, AS_HELP_STRING([--with-pkcs11-sca6000=PATH],[specify path of SCA/6000 PKCS#11 library (default /usr/lib/libpkcs11.so)]), [ pkcs11_sca6000_module="$withval" ], [ pkcs11_sca6000_module="/usr/lib/libpkcs11.so" ] ) AC_ARG_WITH(pkcs11-etoken, AS_HELP_STRING([--with-pkcs11-etoken=PATH],[specify path of Aladdin eToken PKCS#11 library (default /usr/local/lib/libeTPkcs11.so)]), [ pkcs11_etoken_module="$withval" ], [ pkcs11_etoken_module="/usr/local/lib/libeTPkcs11.so" ] ) AC_ARG_WITH(pkcs11-opensc, AS_HELP_STRING([--with-pkcs11-opensc=PATH],[specify path of OpenSC PKCS#11 library (default /usr/lib/pkcs11/opensc-pkcs11.so)]), [ pkcs11_opensc_module="$withval" ], [ pkcs11_opensc_module="/usr/lib/pkcs11/opensc-pkcs11.so" ] ) AC_ARG_WITH(pkcs11-ncipher, AS_HELP_STRING([--with-pkcs11-ncipher=PATH],[specify path of nCipher PKCS#11 library (default /opt/nfast/toolkits/pkcs11/libcknfast.so)]), [ pkcs11_ncipher_module="$withval" ], [ pkcs11_ncipher_module="/opt/nfast/toolkits/pkcs11/libcknfast.so" ] ) AC_ARG_WITH(pkcs11-aepkeyper, AS_HELP_STRING([--with-pkcs11-aepkeyper=PATH],[specify path of AEP Keyper PKCS#11 library (default /opt/Keyper/PKCS11Provider/pkcs11.so)]), [ pkcs11_aepkeyper_module="$withval" ], [ pkcs11_aepkeyper_module="/opt/Keyper/PKCS11Provider/pkcs11.so" ] ) AC_SUBST(pkcs11_softhsm_module) AC_SUBST(pkcs11_sca6000_module) AC_SUBST(pkcs11_etoken_module) AC_SUBST(pkcs11_opensc_module) AC_SUBST(pkcs11_ncipher_module) AC_SUBST(pkcs11_aepkeyper_module) ]) opendnssec-1.4.3/m4/acx_ldns.m40000664000175000017500000000573612052653653013202 00000000000000# $Id: acx_ldns.m4 6847 2012-11-20 10:12:59Z sara $ AC_DEFUN([ACX_LDNS],[ AC_ARG_WITH(ldns, [AC_HELP_STRING([--with-ldns=PATH],[specify prefix of path of ldns library to use])], [ LDNS_PATH="$withval" AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $LDNS_PATH/bin) ],[ LDNS_PATH="/usr/local" AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $PATH) ]) if test -x "$LDNS_CONFIG" then AC_MSG_CHECKING(what are the ldns includes) LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" AC_MSG_RESULT($LDNS_INCLUDES) AC_MSG_CHECKING(what are the ldns libs) LDNS_LIBS="`$LDNS_CONFIG --libs`" AC_MSG_RESULT($LDNS_LIBS) else AC_MSG_CHECKING(what are the ldns includes) LDNS_INCLUDES="-I$LDNS_PATH/include" AC_MSG_RESULT($LDNS_INCLUDES) AC_MSG_CHECKING(what are the ldns libs) LDNS_LIBS="-L$LDNS_PATH/lib -lldns" AC_MSG_RESULT($LDNS_LIBS) fi tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" LIBS="$LIBS $LDNS_LIBS" AC_CHECK_LIB(ldns, ldns_rr_new,,[AC_MSG_ERROR([Can't find ldns library])]) LIBS=$tmp_LIBS AC_MSG_CHECKING([for ldns version]) CHECK_LDNS_VERSION=m4_format(0x%02x%02x%02x, $1, $2, $3) AC_LANG_PUSH([C]) AC_RUN_IFELSE([ AC_LANG_SOURCE([[ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION >= $CHECK_LDNS_VERSION) return 0; #endif return 1; } ]]) ],[ AC_MSG_RESULT([>= $1.$2.$3]) ],[ AC_MSG_RESULT([< $1.$2.$3]) AC_MSG_ERROR([ldns library too old ($1.$2.$3 or later required)]) ],[]) AC_LANG_POP([C]) CPPFLAGS=$tmp_CPPFLAGS AC_SUBST(LDNS_INCLUDES) AC_SUBST(LDNS_LIBS) ]) AC_DEFUN([ACX_LDNS_NOT],[ AC_ARG_WITH(ldns, [AC_HELP_STRING([--with-ldns=PATH],[specify prefix of path of ldns library to use])], [ LDNS_PATH="$withval" AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $LDNS_PATH/bin) ],[ LDNS_PATH="/usr/local" AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $PATH) ]) if test -x "$LDNS_CONFIG" then AC_MSG_CHECKING(what are the ldns includes) LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" AC_MSG_RESULT($LDNS_INCLUDES) AC_MSG_CHECKING(what are the ldns libs) LDNS_LIBS="`$LDNS_CONFIG --libs`" AC_MSG_RESULT($LDNS_LIBS) else AC_MSG_CHECKING(what are the ldns includes) LDNS_INCLUDES="-I$LDNS_PATH/include" AC_MSG_RESULT($LDNS_INCLUDES) AC_MSG_CHECKING(what are the ldns libs) LDNS_LIBS="-L$LDNS_PATH/lib -lldns" AC_MSG_RESULT($LDNS_LIBS) fi tmp_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" AC_MSG_CHECKING([for ldns version not $1.$2.$3]) CHECK_LDNS_VERSION=m4_format(0x%02x%02x%02x, $1, $2, $3) AC_LANG_PUSH([C]) AC_RUN_IFELSE([ AC_LANG_SOURCE([[ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION != $CHECK_LDNS_VERSION) return 0; #endif return 1; } ]]) ],[ AC_MSG_RESULT([ok]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([ldns version $1.$2.$3 is not compatible due to $4]) ],[]) AC_LANG_POP([C]) CPPFLAGS=$tmp_CPPFLAGS ]) opendnssec-1.4.3/m4/check_compiler_flag_needed.m40000664000175000017500000000167411410424713016636 00000000000000# $Id: check_compiler_flag_needed.m4 3541 2010-06-23 15:35:39Z jakob $ # if the given code compiles without the flag, execute argument 4 # if the given code only compiles with the flag, execute argument 3 # otherwise fail AC_DEFUN([CHECK_COMPILER_FLAG_NEEDED],[ AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING(whether we need $1 as a flag for $CC) cache=`echo $1 | sed 'y% .=/+-%____p_%'` AC_CACHE_VAL(cv_prog_cc_flag_needed_$cache, [ echo '$2' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else [ if test -z "`$CC $CFLAGS $1 -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else echo 'Test with flag fails too' fi ] fi rm -f conftest* ]) if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then AC_MSG_RESULT(yes) : $3 else AC_MSG_RESULT(no) : $4 fi ]) opendnssec-1.4.3/m4/check_compiler_flag.m40000664000175000017500000000115411410424713015323 00000000000000# $Id: check_compiler_flag.m4 3541 2010-06-23 15:35:39Z jakob $ # routine to help check for compiler flags. AC_DEFUN([CHECK_COMPILER_FLAG],[ AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING(whether $CC supports -$1) cache=`echo $1 | sed 'y% .=/+-%____p_%'` AC_CACHE_VAL(cv_prog_cc_flag_$cache, [ echo 'void f(){}' >conftest.c if test -z "`$CC -$1 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest* ]) if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then AC_MSG_RESULT(yes) : $2 else AC_MSG_RESULT(no) : $3 fi ]) opendnssec-1.4.3/m4/acx_libxml2.m40000664000175000017500000000174611327553071013605 00000000000000# $Id: acx_libxml2.m4 2718 2010-01-26 11:47:05Z jakob $ AC_DEFUN([ACX_LIBXML2],[ AC_ARG_WITH(libxml2, [AS_HELP_STRING([--with-libxml2=DIR],[look for libxml2 in this dir])], [ XML2_PATH="$withval" AC_PATH_PROGS(XML2_CONFIG, xml2-config, xml2-config, $XML2_PATH/bin) ],[ XML2_PATH="/usr/local" AC_PATH_PROGS(XML2_CONFIG, xml2-config, xml2-config, $PATH) ]) if test -x "$XML2_CONFIG" then AC_MSG_CHECKING(what are the xml2 includes) XML2_INCLUDES="`$XML2_CONFIG --cflags`" AC_MSG_RESULT($XML2_INCLUDES) AC_MSG_CHECKING(what are the xml2 libs) XML2_LIBS="`$XML2_CONFIG --libs`" AC_MSG_RESULT($XML2_LIBS) tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $XML2_INCLUDES" LIBS="$LIBS $XML2_LIBS" AC_CHECK_LIB(xml2, xmlDocGetRootElement,,[AC_MSG_ERROR([Can't find libxml2 library])]) CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS else AC_MSG_ERROR([libxml2 required, but not found.]) fi AC_SUBST(XML2_INCLUDES) AC_SUBST(XML2_LIBS) ]) opendnssec-1.4.3/m4/ax_pthread.m40000664000175000017500000003036611750712623013520 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. # # 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 3 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 18 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) AC_MSG_RESULT($ax_pthread_ok) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case ${host_os} in solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($ax_pthread_ok) if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $attr; return attr /* ; */])], [attr_name=$attr; break], []) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case ${host_os} in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; osf* | hpux*) flag="-D_REENTRANT";; solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], ax_cv_PTHREAD_PRIO_INHERIT, [ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD opendnssec-1.4.3/m4/acx_database_backend.m40000664000175000017500000000236411410424713015435 00000000000000# $Id: acx_database_backend.m4 3541 2010-06-23 15:35:39Z jakob $ AC_DEFUN([ACX_DATABASE_BACKEND],[ AC_ARG_WITH(database-backend, AC_HELP_STRING([--with-database-backend], [Select database backend (sqlite3|mysql)]), [database_backend="${withval}"], [database_backend="sqlite3"]) AC_MSG_CHECKING(for database backend) if test "x${database_backend}" = "xsqlite3"; then AC_MSG_RESULT(SQLite3) ACX_SQLITE3 DB_TYPE=sqlite3 DB_INCLUDES=$SQLITE3_INCLUDES DB_LIBS=$SQLITE3_LIBS AC_DEFINE_UNQUOTED(SQL_BIN, "$SQLITE3", [database binary]) AC_DEFINE_UNQUOTED(SQL_SETUP, "$OPENDNSSEC_DATA_DIR/database_create.sqlite3", [database setup script]) elif test "x${database_backend}" = "xmysql"; then AC_MSG_RESULT(MySQL) ACX_MYSQL DB_TYPE=mysql DB_INCLUDES=$MYSQL_INCLUDES DB_LIBS=$MYSQL_LIBS AC_DEFINE_UNQUOTED(SQL_BIN, "$MYSQL", [database binary]) AC_DEFINE_UNQUOTED(SQL_SETUP, "$OPENDNSSEC_DATA_DIR/database_create.mysql", [database setup script]) else AC_MSG_RESULT(Unknown) AC_MSG_ERROR([Database backend ${database_backend} not supported.]) fi AC_SUBST(DB_TYPE) AC_SUBST(DB_INCLUDES) AC_SUBST(DB_LIBS) AM_CONDITIONAL([USE_MYSQL], [test "x${database_backend}" = "xmysql"]) ]) opendnssec-1.4.3/m4/ltversion.m40000644000175000017500000000126212247571127013421 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) opendnssec-1.4.3/m4/acx_broken_setres.m40000664000175000017500000000175511410424713015072 00000000000000# $Id: acx_broken_setres.m4 3541 2010-06-23 15:35:39Z jakob $ AC_DEFUN([ACX_BROKEN_SETRES],[ AC_CHECK_FUNCS(setresuid, [ AC_MSG_CHECKING(if setresuid seems to work) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} ]])], [AC_MSG_RESULT(yes)], [AC_DEFINE(BROKEN_SETRESUID, 1, [Define if your setresuid() is broken]) AC_MSG_RESULT(not implemented)], [AC_MSG_WARN([cross compiling: not checking setresuid])] ) ]) AC_CHECK_FUNCS(setresgid, [ AC_MSG_CHECKING(if setresgid seems to work) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} ]])], [AC_MSG_RESULT(yes)], [AC_DEFINE(BROKEN_SETRESGID, 1, [Define if your setresgid() is broken]) AC_MSG_RESULT(not implemented)], [AC_MSG_WARN([cross compiling: not checking setresuid])] ) ]) ]) opendnssec-1.4.3/m4/acx_dbparams.m40000664000175000017500000000144311542650315014015 00000000000000# $Id: acx_dbparams.m4 4642 2011-03-24 14:10:21Z rb $ AC_DEFUN([ACX_DBPARAMS],[ AC_ARG_WITH(dbname, [AS_HELP_STRING([--with-dbname=DB_NAME],[Database name/schema for unit tests])], DB_NAME="$withval" ) AC_SUBST(DB_NAME) AC_ARG_WITH(dbhost, [AS_HELP_STRING([--with-dbhost=DB_HOST],[Database host for unit tests])], DB_HOST="$withval" ) AC_SUBST(DB_HOST) AC_ARG_WITH(dbport, [AS_HELP_STRING([--with-dbport=DB_PORT],[Database port for unit tests])], DB_PORT="$withval" ) AC_SUBST(DB_PORT) AC_ARG_WITH(dbuser, [AS_HELP_STRING([--with-dbuser=DB_USER],[Database user for unit tests])], DB_USER="$withval" ) AC_SUBST(DB_USER) AC_ARG_WITH(dbpass, [AS_HELP_STRING([--with-dbpass=DB_PASS],[Database password for unit tests])], DB_PASS="$withval" ) AC_SUBST(DB_PASS) ]) opendnssec-1.4.3/m4/acx_pedantic.m40000664000175000017500000000052411410415234014003 00000000000000# $Id: acx_pedantic.m4 3535 2010-06-23 14:30:52Z jakob $ AC_DEFUN([ACX_PEDANTIC],[ AC_ARG_ENABLE( [pedantic], [AS_HELP_STRING([--enable-pedantic],[enable pedantic compile mode @<:@enabled@:>@])], , [enable_pedantic="yes"] ) if test "${enable_pedantic}" = "yes"; then enable_strict="yes"; CFLAGS="${CFLAGS} -pedantic" fi ]) opendnssec-1.4.3/m4/acx_sqlite3.m40000664000175000017500000000210311466404264013607 00000000000000# $Id: acx_sqlite3.m4 4176 2010-11-10 02:51:32Z rb $ AC_DEFUN([ACX_SQLITE3],[ AC_ARG_WITH(sqlite3, AC_HELP_STRING([--with-sqlite3=PATH],[Specify prefix of path of SQLite3]), [ SQLITE3_PATH="$withval" AC_PATH_PROGS(SQLITE3, sqlite3, sqlite3, $withval/bin) ],[ SQLITE3_PATH="/usr/local" AC_PATH_PROGS(SQLITE3, sqlite3, sqlite3, $PATH) ]) if ! test -x "$SQLITE3"; then AC_MSG_ERROR([sqlite3 command not found]) fi AC_MSG_CHECKING(what are the SQLite3 includes) SQLITE3_INCLUDES="-I$SQLITE3_PATH/include" AC_MSG_RESULT($SQLITE3_INCLUDES) AC_MSG_CHECKING(what are the SQLite3 libs) SQLITE3_LIBS="-L$SQLITE3_PATH/lib -lsqlite3" AC_MSG_RESULT($SQLITE3_LIBS) tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $SQLITE3_INCLUDES" LIBS="$LIBS $SQLITE3_LIBS" AC_CHECK_HEADERS(sqlite3.h,,[AC_MSG_ERROR([Can't find SQLite3 headers])]) AC_CHECK_LIB(sqlite3, sqlite3_prepare_v2, [], [AC_MSG_ERROR([Missing SQLite3 library v3.3.9 or greater])]) CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS AC_SUBST(SQLITE3_INCLUDES) AC_SUBST(SQLITE3_LIBS) ]) opendnssec-1.4.3/m4/acx_dlopen.m40000664000175000017500000000142311605030455013500 00000000000000# $Id: acx_dlopen.m4 5294 2011-07-06 09:55:57Z rb $ AC_DEFUN([ACX_DLOPEN],[ tmp_SUCCESS="no" # Unix AC_CHECK_FUNC( [dlopen], [ AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have dlopen]) tmp_SUCCESS="yes" ], [ AC_CHECK_LIB( [dl], [dlopen], [ AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have dlopen]) LIBS="$LIBS -ldl" tmp_SUCCESS="yes" ] ) ] ) # Windows if test "$tmp_SUCCESS" = "no" then AC_MSG_CHECKING([for LoadLibrary]) AC_TRY_LINK( [#include ], [LoadLibrary(NULL);], [ AC_DEFINE(HAVE_LOADLIBRARY, 1, [Define if you have LoadLibrary]) tmp_SUCCESS="yes" ] ) AC_MSG_RESULT([$tmp_SUCCESS]) fi if test "$tmp_SUCCESS" = "no" then AC_MSG_ERROR([No dynamic library loading support]) fi ]) opendnssec-1.4.3/m4/acx_rpath.m40000664000175000017500000000171111410415234013331 00000000000000# $Id: acx_rpath.m4 3535 2010-06-23 14:30:52Z jakob $ dnl Add option to disable the evil rpath. Check whether to use rpath or not. dnl Adds the --disable-rpath option. Uses trick to edit the ./libtool. AC_DEFUN([ACX_ARG_RPATH], [ AC_ARG_ENABLE(rpath, [AS_HELP_STRING([--disable-rpath], [disable hardcoded rpath (default=enabled)])], [enable_rpath=$enableval], [enable_rpath=yes]) if test "x$enable_rpath" = xno; then AC_MSG_RESULT([Fixing libtool for -rpath problems.]) sed < libtool > libtool-2 \ 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/' mv libtool-2 libtool chmod 755 libtool libtool="./libtool" fi ]) dnl Add a -R to the RUNTIME_PATH. Only if rpath is enabled and it is dnl an absolute path. dnl $1: the pathname to add. AC_DEFUN([ACX_RUNTIME_PATH_ADD], [ if test "x$enable_rpath" = xyes; then if echo "$1" | grep "^/" >/dev/null; then RUNTIME_PATH="$RUNTIME_PATH -R$1" fi fi ]) opendnssec-1.4.3/m4/ax_prog_doxygen.m40000664000175000017500000004266311427746256014612 00000000000000# $Id$ # # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html # =========================================================================== # # SYNOPSIS # # DX_INIT_DOXYGEN(PROJECT-NAME, DOXYFILE-PATH, [OUTPUT-DIR]) # DX_DOXYGEN_FEATURE(ON|OFF) # DX_DOT_FEATURE(ON|OFF) # DX_HTML_FEATURE(ON|OFF) # DX_CHM_FEATURE(ON|OFF) # DX_CHI_FEATURE(ON|OFF) # DX_MAN_FEATURE(ON|OFF) # DX_RTF_FEATURE(ON|OFF) # DX_XML_FEATURE(ON|OFF) # DX_PDF_FEATURE(ON|OFF) # DX_PS_FEATURE(ON|OFF) # # DESCRIPTION # # The DX_*_FEATURE macros control the default setting for the given # Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for # generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML # help (for MS users), 'CHI' for generating a seperate .chi file by the # .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate # output formats. The environment variable DOXYGEN_PAPER_SIZE may be # specified to override the default 'a4wide' paper size. # # By default, HTML, PDF and PS documentation is generated as this seems to # be the most popular and portable combination. MAN pages created by # Doxygen are usually problematic, though by picking an appropriate subset # and doing some massaging they might be better than nothing. CHM and RTF # are specific for MS (note that you can't generate both HTML and CHM at # the same time). The XML is rather useless unless you apply specialized # post-processing to it. # # The macros mainly control the default state of the feature. The use can # override the default by specifying --enable or --disable. The macros # ensure that contradictory flags are not given (e.g., # --enable-doxygen-html and --enable-doxygen-chm, # --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each # feature will be automatically disabled (with a warning) if the required # programs are missing. # # Once all the feature defaults have been specified, call DX_INIT_DOXYGEN # with the following parameters: a one-word name for the project for use # as a filename base etc., an optional configuration file name (the # default is 'Doxyfile', the same as Doxygen's default), and an optional # output directory name (the default is 'doxygen-doc'). # # Automake Support # # The following is a template aminclude.am file for use with Automake. # Make targets and variables values are controlled by the various # DX_COND_* conditionals set by autoconf. # # The provided targets are: # # doxygen-doc: Generate all doxygen documentation. # # doxygen-run: Run doxygen, which will generate some of the # documentation (HTML, CHM, CHI, MAN, RTF, XML) # but will not do the post processing required # for the rest of it (PS, PDF, and some MAN). # # doxygen-man: Rename some doxygen generated man pages. # # doxygen-ps: Generate doxygen PostScript documentation. # # doxygen-pdf: Generate doxygen PDF documentation. # # Note that by default these are not integrated into the automake targets. # If doxygen is used to generate man pages, you can achieve this # integration by setting man3_MANS to the list of man pages generated and # then adding the dependency: # # $(man3_MANS): doxygen-doc # # This will cause make to run doxygen and generate all the documentation. # # The following variable is intended for use in Makefile.am: # # DX_CLEANFILES = everything to clean. # # Then add this variable to MOSTLYCLEANFILES. # # ----- begin aminclude.am ------------------------------------- # # ## --------------------------------- ## # ## Format-independent Doxygen rules. ## # ## --------------------------------- ## # # if DX_COND_doc # # ## ------------------------------- ## # ## Rules specific for HTML output. ## # ## ------------------------------- ## # # if DX_COND_html # # DX_CLEAN_HTML = @DX_DOCDIR@/html # # endif DX_COND_html # # ## ------------------------------ ## # ## Rules specific for CHM output. ## # ## ------------------------------ ## # # if DX_COND_chm # # DX_CLEAN_CHM = @DX_DOCDIR@/chm # # if DX_COND_chi # # DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi # # endif DX_COND_chi # # endif DX_COND_chm # # ## ------------------------------ ## # ## Rules specific for MAN output. ## # ## ------------------------------ ## # # if DX_COND_man # # DX_CLEAN_MAN = @DX_DOCDIR@/man # # endif DX_COND_man # # ## ------------------------------ ## # ## Rules specific for RTF output. ## # ## ------------------------------ ## # # if DX_COND_rtf # # DX_CLEAN_RTF = @DX_DOCDIR@/rtf # # endif DX_COND_rtf # # ## ------------------------------ ## # ## Rules specific for XML output. ## # ## ------------------------------ ## # # if DX_COND_xml # # DX_CLEAN_XML = @DX_DOCDIR@/xml # # endif DX_COND_xml # # ## ----------------------------- ## # ## Rules specific for PS output. ## # ## ----------------------------- ## # # if DX_COND_ps # # DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps # # DX_PS_GOAL = doxygen-ps # # doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps # # @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag # cd @DX_DOCDIR@/latex; \ # rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ # $(DX_LATEX) refman.tex; \ # $(MAKEINDEX_PATH) refman.idx; \ # $(DX_LATEX) refman.tex; \ # countdown=5; \ # while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ # refman.log > /dev/null 2>&1 \ # && test $$countdown -gt 0; do \ # $(DX_LATEX) refman.tex; \ # countdown=`expr $$countdown - 1`; \ # done; \ # $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi # # endif DX_COND_ps # # ## ------------------------------ ## # ## Rules specific for PDF output. ## # ## ------------------------------ ## # # if DX_COND_pdf # # DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf # # DX_PDF_GOAL = doxygen-pdf # # doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf # # @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag # cd @DX_DOCDIR@/latex; \ # rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ # $(DX_PDFLATEX) refman.tex; \ # $(DX_MAKEINDEX) refman.idx; \ # $(DX_PDFLATEX) refman.tex; \ # countdown=5; \ # while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ # refman.log > /dev/null 2>&1 \ # && test $$countdown -gt 0; do \ # $(DX_PDFLATEX) refman.tex; \ # countdown=`expr $$countdown - 1`; \ # done; \ # mv refman.pdf ../@PACKAGE@.pdf # # endif DX_COND_pdf # # ## ------------------------------------------------- ## # ## Rules specific for LaTeX (shared for PS and PDF). ## # ## ------------------------------------------------- ## # # if DX_COND_latex # # DX_CLEAN_LATEX = @DX_DOCDIR@/latex # # endif DX_COND_latex # # .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) # # .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) # # doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag # # doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) # # @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) # rm -rf @DX_DOCDIR@ # $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) # # DX_CLEANFILES = \ # @DX_DOCDIR@/@PACKAGE@.tag \ # -r \ # $(DX_CLEAN_HTML) \ # $(DX_CLEAN_CHM) \ # $(DX_CLEAN_CHI) \ # $(DX_CLEAN_MAN) \ # $(DX_CLEAN_RTF) \ # $(DX_CLEAN_XML) \ # $(DX_CLEAN_PS) \ # $(DX_CLEAN_PDF) \ # $(DX_CLEAN_LATEX) # # endif DX_COND_doc # # ----- end aminclude.am --------------------------------------- # # LICENSE # # Copyright (c) 2009 Oren Ben-Kiki # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 10 ## ----------## ## Defaults. ## ## ----------## DX_ENV="" AC_DEFUN([DX_FEATURE_doc], ON) AC_DEFUN([DX_FEATURE_dot], ON) AC_DEFUN([DX_FEATURE_man], OFF) AC_DEFUN([DX_FEATURE_html], ON) AC_DEFUN([DX_FEATURE_chm], OFF) AC_DEFUN([DX_FEATURE_chi], OFF) AC_DEFUN([DX_FEATURE_rtf], OFF) AC_DEFUN([DX_FEATURE_xml], OFF) AC_DEFUN([DX_FEATURE_pdf], ON) AC_DEFUN([DX_FEATURE_ps], ON) ## --------------- ## ## Private macros. ## ## --------------- ## # DX_ENV_APPEND(VARIABLE, VALUE) # ------------------------------ # Append VARIABLE="VALUE" to DX_ENV for invoking doxygen. AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])]) # DX_DIRNAME_EXPR # --------------- # Expand into a shell expression prints the directory part of a path. AC_DEFUN([DX_DIRNAME_EXPR], [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) # DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) # ------------------------------------- # Expands according to the M4 (static) status of the feature. AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) # DX_REQUIRE_PROG(VARIABLE, PROGRAM) # ---------------------------------- # Require the specified program to be found for the DX_CURRENT_FEATURE to work. AC_DEFUN([DX_REQUIRE_PROG], [ AC_PATH_TOOL([$1], [$2]) if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) fi ]) # DX_TEST_FEATURE(FEATURE) # ------------------------ # Expand to a shell expression testing whether the feature is active. AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) # DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) # ------------------------------------------------- # Verify that a required features has the right state before trying to turn on # the DX_CURRENT_FEATURE. AC_DEFUN([DX_CHECK_DEPEND], [ test "$DX_FLAG_$1" = "$2" \ || AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, requires, contradicts) doxygen-DX_CURRENT_FEATURE]) ]) # DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) # ---------------------------------------------------------- # Turn off the DX_CURRENT_FEATURE if the required feature is off. AC_DEFUN([DX_CLEAR_DEPEND], [ test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) ]) # DX_FEATURE_ARG(FEATURE, DESCRIPTION, # CHECK_DEPEND, CLEAR_DEPEND, # REQUIRE, DO-IF-ON, DO-IF-OFF) # -------------------------------------------- # Parse the command-line option controlling a feature. CHECK_DEPEND is called # if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), # otherwise CLEAR_DEPEND is called to turn off the default state if a required # feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional # requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and # DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. AC_DEFUN([DX_ARG_ABLE], [ AC_DEFUN([DX_CURRENT_FEATURE], [$1]) AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) AC_ARG_ENABLE(doxygen-$1, [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], [--enable-doxygen-$1]), DX_IF_FEATURE([$1], [don't $2], [$2]))], [ case "$enableval" in #( y|Y|yes|Yes|YES) AC_SUBST([DX_FLAG_$1], 1) $3 ;; #( n|N|no|No|NO) AC_SUBST([DX_FLAG_$1], 0) ;; #( *) AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) ;; esac ], [ AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) $4 ]) if DX_TEST_FEATURE([$1]); then $5 : fi if DX_TEST_FEATURE([$1]); then AM_CONDITIONAL(DX_COND_$1, :) $6 : else AM_CONDITIONAL(DX_COND_$1, false) $7 : fi ]) ## -------------- ## ## Public macros. ## ## -------------- ## # DX_XXX_FEATURE(DEFAULT_STATE) # ----------------------------- AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) # DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR]) # --------------------------------------------------------- # PROJECT also serves as the base name for the documentation files. # The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc". AC_DEFUN([DX_INIT_DOXYGEN], [ # Files: AC_SUBST([DX_PROJECT], [$1]) AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])]) AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])]) # Environment variables used inside doxygen.cfg: DX_ENV_APPEND(SRCDIR, $srcdir) DX_ENV_APPEND(PROJECT, $DX_PROJECT) DX_ENV_APPEND(DOCDIR, $DX_DOCDIR) DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) # Doxygen itself: DX_ARG_ABLE(doc, [generate any doxygen documentation], [], [], [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) DX_REQUIRE_PROG([DX_PERL], perl)], [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) # Dot for graphics: DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [DX_REQUIRE_PROG([DX_DOT], dot)], [DX_ENV_APPEND(HAVE_DOT, YES) DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], [DX_ENV_APPEND(HAVE_DOT, NO)]) # Man pages generation: DX_ARG_ABLE(man, [generate doxygen manual pages], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [], [DX_ENV_APPEND(GENERATE_MAN, YES)], [DX_ENV_APPEND(GENERATE_MAN, NO)]) # RTF file generation: DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [], [DX_ENV_APPEND(GENERATE_RTF, YES)], [DX_ENV_APPEND(GENERATE_RTF, NO)]) # XML file generation: DX_ARG_ABLE(xml, [generate doxygen XML documentation], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [], [DX_ENV_APPEND(GENERATE_XML, YES)], [DX_ENV_APPEND(GENERATE_XML, NO)]) # (Compressed) HTML help generation: DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [DX_REQUIRE_PROG([DX_HHC], hhc)], [DX_ENV_APPEND(HHC_PATH, $DX_HHC) DX_ENV_APPEND(GENERATE_HTML, YES) DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) # Seperate CHI file generation. DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], [DX_CHECK_DEPEND(chm, 1)], [DX_CLEAR_DEPEND(chm, 1)], [], [DX_ENV_APPEND(GENERATE_CHI, YES)], [DX_ENV_APPEND(GENERATE_CHI, NO)]) # Plain HTML pages generation: DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], [], [DX_ENV_APPEND(GENERATE_HTML, YES)], [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) # PostScript file generation: DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [DX_REQUIRE_PROG([DX_LATEX], latex) DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) DX_REQUIRE_PROG([DX_DVIPS], dvips) DX_REQUIRE_PROG([DX_EGREP], egrep)]) # PDF file generation: DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], [DX_CHECK_DEPEND(doc, 1)], [DX_CLEAR_DEPEND(doc, 1)], [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) DX_REQUIRE_PROG([DX_EGREP], egrep)]) # LaTeX generation for PS and/or PDF: if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then AM_CONDITIONAL(DX_COND_latex, :) DX_ENV_APPEND(GENERATE_LATEX, YES) else AM_CONDITIONAL(DX_COND_latex, false) DX_ENV_APPEND(GENERATE_LATEX, NO) fi # Paper size for PS and/or PDF: AC_ARG_VAR(DOXYGEN_PAPER_SIZE, [a4wide (default), a4, letter, legal or executive]) case "$DOXYGEN_PAPER_SIZE" in #( "") AC_SUBST(DOXYGEN_PAPER_SIZE, "") ;; #( a4wide|a4|letter|legal|executive) DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) ;; #( *) AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) ;; esac #For debugging: #echo DX_FLAG_doc=$DX_FLAG_doc #echo DX_FLAG_dot=$DX_FLAG_dot #echo DX_FLAG_man=$DX_FLAG_man #echo DX_FLAG_html=$DX_FLAG_html #echo DX_FLAG_chm=$DX_FLAG_chm #echo DX_FLAG_chi=$DX_FLAG_chi #echo DX_FLAG_rtf=$DX_FLAG_rtf #echo DX_FLAG_xml=$DX_FLAG_xml #echo DX_FLAG_pdf=$DX_FLAG_pdf #echo DX_FLAG_ps=$DX_FLAG_ps #echo DX_ENV=$DX_ENV ]) opendnssec-1.4.3/m4/acx_check_strptime.m40000664000175000017500000000133311423100516015215 00000000000000# $Id: acx_check_strptime.m4 3596 2010-07-25 18:24:14Z jakob $ AC_DEFUN([AC_CHECK_STRPTIME],[ AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING(whether strptime needs defines) AC_CACHE_VAL(ac_cv_c_strptime_needs_defs,[ cat >conftest.c < void testing (void) { struct tm t; char *timestr; strptime(timestr, "%Y%m", &t); } EOF if test -z "`$CC -Wall -Werror -c conftest.c 2>&1`"; then eval "ac_cv_c_strptime_needs_defs=no" else eval "ac_cv_c_strptime_needs_defs=yes" fi rm -f conftest* ]) AC_MSG_RESULT($ac_cv_c_strptime_needs_defs) if test $ac_cv_c_strptime_needs_defs = yes; then AC_DEFINE_UNQUOTED([STRPTIME_NEEDS_DEFINES], 1, [strptime is available from time.h with some defines.]) fi ]) opendnssec-1.4.3/m4/opendnssec_common.m40000664000175000017500000001447312104210117015074 00000000000000# $Id: opendnssec_common.m4 7018 2013-02-05 13:59:43Z sion $ AC_DEFUN([OPENDNSSEC_COMMON],[ AC_MSG_NOTICE(Detecting common OpenDNSSEC settings) full_bindir=`eval eval eval eval eval echo "${bindir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_sbindir=`eval eval eval eval eval echo "${sbindir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_libdir=`eval eval eval eval eval echo "${libdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_libexecdir=`eval eval eval eval eval echo "${libexecdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_datadir=`eval eval eval eval eval echo "${datadir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_sysconfdir=`eval eval eval eval eval echo "${sysconfdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_localstatedir=`eval eval eval eval eval echo "${localstatedir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` OPENDNSSEC_BIN_DIR=$full_bindir OPENDNSSEC_SBIN_DIR=$full_sbindir OPENDNSSEC_LIB_DIR=$full_libdir/opendnssec OPENDNSSEC_LIBEXEC_DIR=$full_libexecdir/opendnssec OPENDNSSEC_DATA_DIR=$full_datadir/opendnssec OPENDNSSEC_SYSCONF_DIR=$full_sysconfdir/opendnssec OPENDNSSEC_LOCALSTATE_DIR="$full_localstatedir/opendnssec" OPENDNSSEC_PID_DIR="$full_localstatedir/run/opendnssec" AC_SUBST([OPENDNSSEC_BIN_DIR]) AC_SUBST([OPENDNSSEC_SBIN_DIR]) AC_SUBST([OPENDNSSEC_LIB_DIR]) AC_SUBST([OPENDNSSEC_LIBEXEC_DIR]) AC_SUBST([OPENDNSSEC_DATA_DIR]) AC_SUBST([OPENDNSSEC_SYSCONF_DIR]) AC_SUBST([OPENDNSSEC_LOCALSTATE_DIR]) AC_SUBST([OPENDNSSEC_PID_DIR]) OPENDNSSEC_CONFIG_DIR=$OPENDNSSEC_SYSCONF_DIR OPENDNSSEC_CONFIG_FILE=$OPENDNSSEC_SYSCONF_DIR/conf.xml OPENDNSSEC_SCHEMA_DIR=$OPENDNSSEC_DATA_DIR OPENDNSSEC_STATE_DIR=$OPENDNSSEC_LOCALSTATE_DIR AC_SUBST([OPENDNSSEC_CONFIG_DIR]) AC_SUBST([OPENDNSSEC_CONFIG_FILE]) AC_SUBST([OPENDNSSEC_SCHEMA_DIR]) AC_SUBST([OPENDNSSEC_STATE_DIR]) AC_DEFINE_UNQUOTED(OPENDNSSEC_CONFIG_DIR, "$OPENDNSSEC_CONFIG_DIR", [Path to the OpenDNSSEC configuration files]) AC_DEFINE_UNQUOTED(OPENDNSSEC_CONFIG_FILE, "$OPENDNSSEC_CONFIG_FILE", [Path to the main OpenDNSSEC configuration file]) AC_DEFINE_UNQUOTED(OPENDNSSEC_SCHEMA_DIR, "$OPENDNSSEC_SCHEMA_DIR", [Path to the OpenDNSSEC data files]) AC_DEFINE_UNQUOTED(OPENDNSSEC_STATE_DIR, "$OPENDNSSEC_STATE_DIR", [Path to the OpenDNSSEC var directory]) OPENDNSSEC_SIGNER_PIDFILE=$OPENDNSSEC_PID_DIR/signerd.pid OPENDNSSEC_ENFORCER_PIDFILE=$OPENDNSSEC_PID_DIR/enforcerd.pid OPENDNSSEC_FETCH_PIDFILE=$OPENDNSSEC_PID_DIR/zone_fetcher.pid AC_SUBST([OPENDNSSEC_SIGNER_PIDFILE]) AC_SUBST([OPENDNSSEC_ENFORCER_PIDFILE]) AC_SUBST([OPENDNSSEC_FETCH_PIDFILE]) AC_DEFINE_UNQUOTED(OPENDNSSEC_SIGNER_PIDFILE, "$OPENDNSSEC_SIGNER_PIDFILE", [Path to the OpenDNSSEC signer pid file]) AC_DEFINE_UNQUOTED(OPENDNSSEC_ENFORCER_PIDFILE, "$OPENDNSSEC_ENFORCER_PIDFILE", [Path to the OpenDNSSEC enforcer pid file]) AC_DEFINE_UNQUOTED(OPENDNSSEC_FETCH_PIDFILE, "$OPENDNSSEC_FETCH_PIDFILE", [Path to the OpenDNSSEC zone fetcher pid file]) # signer specific OPENDNSSEC_SIGNER_SOCKET=$OPENDNSSEC_PID_DIR/engine.sock OPENDNSSEC_SIGNER_ENGINE=$OPENDNSSEC_SBIN_DIR/ods-signerd OPENDNSSEC_SIGNER_CLI=$OPENDNSSEC_SBIN_DIR/ods-signer OPENDNSSEC_SIGNER_WORKINGDIR=$OPENDNSSEC_STATE_DIR/tmp AC_SUBST([OPENDNSSEC_SIGNER_SOCKET]) AC_SUBST([OPENDNSSEC_SIGNER_ENGINE]) AC_SUBST([OPENDNSSEC_SIGNER_CLI]) AC_DEFINE_UNQUOTED(OPENDNSSEC_SIGNER_SOCKET, "$OPENDNSSEC_SIGNER_SOCKET", [Path to the OpenDNSSEC signer socket]) AC_DEFINE_UNQUOTED(OPENDNSSEC_SIGNER_ENGINE, "$OPENDNSSEC_SIGNER_ENGINE", [Path to the OpenDNSSEC signer engine]) AC_DEFINE_UNQUOTED(OPENDNSSEC_SIGNER_CLI, "$OPENDNSSEC_SIGNER_CLI", [Path to the OpenDNSSEC signer cli]) AC_DEFINE_UNQUOTED(ODS_SE_PIDFILE, ["$OPENDNSSEC_SIGNER_PIDFILE"], [Path to the OpenDNSSEC signer engine pid file]) AC_DEFINE_UNQUOTED(ODS_ZF_PIDFILE, ["$OPENDNSSEC_FETCH_PIDFILE"], [Path to the OpenDNSSEC signer engine pid file]) AC_DEFINE_UNQUOTED(ODS_SE_SOCKFILE, ["$OPENDNSSEC_SIGNER_SOCKET"], [Path to the OpenDNSSEC signer engine socket file]) AC_DEFINE_UNQUOTED(ODS_SE_WORKDIR, ["$OPENDNSSEC_SIGNER_WORKINGDIR"], [Path to the OpenDNSSEC signer engine working directory]) AC_DEFINE_UNQUOTED(ODS_SE_CFGFILE, ["$OPENDNSSEC_CONFIG_FILE"], [Path to the OpenDNSSEC config file]) AC_DEFINE_UNQUOTED(ODS_SE_RNGDIR, ["$OPENDNSSEC_SCHEMA_DIR"], [Path to the OpenDNSSEC data files]) AC_DEFINE_UNQUOTED(ODS_SE_ENGINE, ["$OPENDNSSEC_SIGNER_ENGINE"], [Path to the OpenDNSSEC signer engine binary]) AC_DEFINE_UNQUOTED(ODS_SE_CLI, ["$OPENDNSSEC_SIGNER_CLI"], [Path to the OpenDNSSEC signer client binary]) AC_DEFINE_UNQUOTED(ODS_SE_MAXLINE, [1024], [Maximum line length that the OpenDNSSEC signer client can handle]) AC_DEFINE_UNQUOTED(ODS_SE_MAX_BACKOFF, [3600], [Number of seconds the OpenDNSSEC signer engine should backoff when a task failed]) AC_DEFINE_UNQUOTED(ODS_SE_WORKERTHREADS, [4], [Default number of worker threads for the OpenDNSSEC signer engine]) AC_DEFINE_UNQUOTED(ODS_SE_STOP_RESPONSE, ["Engine shut down."], [Shutdown message for the OpenDNSSEC signer client]) AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC_V3, [";OpenDNSSEC-backup-v3"], [File magic for storing backups from the OpenDNSSEC signer engine]) AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC_V2, [";ODSSE2"], [File magic for storing backups from the OpenDNSSEC signer engine]) AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC_V1, [";ODSSE1"], [File magic for storing backups from the OpenDNSSEC signer engine]) AC_DEFINE_UNQUOTED(ODS_SE_VERBOSITY, [3], [Default verbosity]) # enforcer specific OPENDNSSEC_ENFORCER_CONTROL=$OPENDNSSEC_SBIN_DIR/ods-control OPENDNSSEC_ENFORCER_KASPCHECK=$OPENDNSSEC_BIN_DIR/ods-kaspcheck AC_DEFINE_UNQUOTED(ODS_EN_CONTROL, ["$OPENDNSSEC_ENFORCER_CONTROL enforcer "], [Path to the OpenDNSSEC ods-control binary]) AC_DEFINE_UNQUOTED(ODS_EN_NOTIFY, ["$OPENDNSSEC_ENFORCER_CONTROL enforcer notify"], [Command to send a SIGHUP to the ods-enforcerd process]) AC_DEFINE_UNQUOTED(ODS_EN_KASPCHECK, ["$OPENDNSSEC_ENFORCER_KASPCHECK"], [Path to the OpenDNSSEC kaspcheck binary]) ]) opendnssec-1.4.3/m4/ltsugar.m40000644000175000017500000001042412247571127013055 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) opendnssec-1.4.3/m4/acx_mysql.m40000664000175000017500000000261611560775060013401 00000000000000# $Id: acx_mysql.m4 5071 2011-05-06 13:40:00Z rb $ AC_DEFUN([ACX_MYSQL],[ AC_ARG_WITH(mysql, AC_HELP_STRING([--with-mysql=DIR],[Specify prefix of path of MySQL]), [ MYSQL_PATH="$withval" AC_PATH_PROGS(MYSQL_CONFIG, mysql_config, mysql_config, $MYSQL_PATH/bin) AC_PATH_PROGS(MYSQL, mysql, mysql, $MYSQL_PATH/bin) ],[ MYSQL_PATH="/usr/local" AC_PATH_PROGS(MYSQL_CONFIG, mysql_config, mysql_config, $PATH) AC_PATH_PROGS(MYSQL, mysql, mysql) ]) if test -x "$MYSQL_CONFIG"; then AC_MSG_CHECKING(mysql version) MYSQL_VERSION="`$MYSQL_CONFIG --version`" MYSQL_VERSION_MAJOR=`echo "$MYSQL_VERSION" | sed -e 's/\..*//'` AC_MSG_RESULT($MYSQL_VERSION) if test ${MYSQL_VERSION_MAJOR} -le 4 ; then AC_MSG_ERROR([mysql must be newer than 5.0.0]) fi AC_MSG_CHECKING(what are the MySQL includes) MYSQL_INCLUDES="`$MYSQL_CONFIG --include` -DBIG_JOINS=1 -DUSE_MYSQL -Wno-long-long" AC_MSG_RESULT($MYSQL_INCLUDES) AC_MSG_CHECKING(what are the MySQL libs) MYSQL_LIBS="`$MYSQL_CONFIG --libs_r`" AC_MSG_RESULT($MYSQL_LIBS) fi if ! test -x "$MYSQL"; then AC_MSG_ERROR([mysql command not found]) fi tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDES" LIBS="$LIBS $MYSQL_LIBS" AC_CHECK_HEADERS(mysql.h,,[AC_MSG_ERROR([Can't find MySQL headers])]) CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS AC_SUBST(MYSQL_INCLUDES) AC_SUBST(MYSQL_LIBS) ]) opendnssec-1.4.3/m4/acx_cunit.m40000664000175000017500000000160611564423744013357 00000000000000# $Id: acx_cunit.m4 5122 2011-05-17 07:46:44Z rb $ AC_DEFUN([ACX_CUNIT],[ AC_ARG_WITH(cunit, [AC_HELP_STRING([--with-cunit=DIR],[Look for cunit in this dir])], [ CUNIT_PATH="$withval" ],[ CUNIT_PATH="/usr/local" ]) AS_IF([test "x$with_cunit" != xno],[ AC_MSG_CHECKING(what are the cunit includes) CUNIT_INCLUDES="-I$CUNIT_PATH/include" AC_MSG_RESULT($CUNIT_INCLUDES) AC_MSG_CHECKING(what are the cunit libs) CUNIT_LIBS="-L$CUNIT_PATH/lib -lcunit" AC_MSG_RESULT($CUNIT_LIBS) tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $CUNIT_INCLUDES" LIBS="$LIBS $CUNIT_LIBS" AC_CHECK_LIB(cunit, CU_run_test, [],[ AC_MSG_NOTICE([Can't find cunit library]) CUNIT_INCLUDES= CUNIT_LIBS= ]) CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS ],[ AC_MSG_NOTICE([cunit disabled]) CUNIT_INCLUDES= CUNIT_LIBS= ]) AC_SUBST(CUNIT_INCLUDES) AC_SUBST(CUNIT_LIBS) ]) opendnssec-1.4.3/m4/libtool.m40000644000175000017500000106043412247571126013046 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # 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 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. m4_define([_LT_COPYING], [dnl # 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. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; 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-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # 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 ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl 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 _LT_CC_BASENAME([$compiler]) # 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 _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# 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' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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' _LT_CONFIG_STATUS_DECLARATIONS 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 lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); 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 lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); 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 _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [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. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### 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 _LT_PROG_LTMAIN # 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) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # 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 ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl 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* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl 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* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [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" >&AS_MESSAGE_LOG_FD $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 >&AS_MESSAGE_LOG_FD # 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 >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [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" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $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 >&AS_MESSAGE_LOG_FD 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 >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) 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 ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_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 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="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}" _LT_TAGVAR(module_expsym_cmds, $1)="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}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # 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*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ 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" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. 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|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) 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 AC_TRY_EVAL(ac_compile); 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" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # 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 _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # 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\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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 ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] 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 #endif #include #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 AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; 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" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $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* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) 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 AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [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]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) 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" AC_MSG_RESULT([yes]) 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" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ 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.so # instead of lib.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}' m4_if([$1], [],[ 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`' m4_if([$1], [],[ 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 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) 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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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 AC_MSG_RESULT([$dynamic_linker]) 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 _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[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]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [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 dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" 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]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) 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 AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [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 &1 /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* | netbsdelf*-gnu) 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 ]) 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 _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [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]) 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 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [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 ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # 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 AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && 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@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_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@&t@_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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && 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" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD 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 ]) 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 AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) 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 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | 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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; 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*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # 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 _LT_TAGVAR(export_symbols_cmds, $1)='$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 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # 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'. _LT_TAGVAR(exclude_expsyms, $1)=['_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. dnl Note also adjust exclude_expsyms for C++ above. 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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$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)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+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 _LT_TAGVAR(archive_cmds, $1)='$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... _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(export_symbols_cmds, $1)='$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 _LT_TAGVAR(export_symbols_cmds, $1)='$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. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${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 _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no 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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(always_export_symbols, $1)=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. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$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)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='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, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=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. _LT_TAGVAR(archive_cmds, $1)='$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. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$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*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # 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) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$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. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=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. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) 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. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [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]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$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);}' _LT_TAG_COMPILER # 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 _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # 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(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; 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 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 case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac 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. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = 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 _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= 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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(always_export_symbols, $1)=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. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='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, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='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~ func_to_tool_file "$lt_outputfile"~ 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' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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... _LT_TAGVAR(archive_expsym_cmds, $1)='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # 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 AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # 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 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 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=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # 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}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # 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 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [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 ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#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 ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS opendnssec-1.4.3/m4/lt~obsolete.m40000644000175000017500000001375612247571127013761 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) opendnssec-1.4.3/m4/acx_strict.m40000664000175000017500000000046311410415234013526 00000000000000# $Id: acx_strict.m4 3535 2010-06-23 14:30:52Z jakob $ AC_DEFUN([ACX_STRICT],[ AC_ARG_ENABLE( [strict], [AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@enabled@:>@])], , [enable_strict="yes"] ) if test "${enable_strict}" = "yes"; then CFLAGS="${CFLAGS} -Wall -Wextra" fi ]) opendnssec-1.4.3/m4/acx_prefixhack.m40000664000175000017500000000124011251406661014343 00000000000000# $Id: acx_prefixhack.m4 1777 2009-09-08 07:54:25Z jakob $ # # Special processing of paths depending on whether --prefix, # --sysconfdir or --localstatedir arguments were given. AC_DEFUN([ACX_PREFIXHACK],[ case "$prefix" in NONE) case "$sysconfdir" in '${prefix}/etc') sysconfdir=/etc ac_configure_args="$ac_configure_args --sysconfdir=$sysconfdir" AC_MSG_NOTICE([sysconfdir set to $sysconfdir]) ;; esac case "$localstatedir" in '${prefix}/var') localstatedir=/var ac_configure_args="$ac_configure_args --localstatedir=$localstatedir" AC_MSG_NOTICE([localstate set to $localstatedir]) ;; esac ;; esac ]) opendnssec-1.4.3/m4/acx_libc.m40000664000175000017500000000021411763104736013136 00000000000000# $Id: acx_rt.m4 3626 2010-07-27 12:23:29Z rb $ AC_DEFUN([ACX_LIBC],[ C_LIBS="-lc" # some checks could go in here AC_SUBST(C_LIBS) ]) opendnssec-1.4.3/m4/ltoptions.m40000644000175000017500000003007312247571127013431 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [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], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [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], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) opendnssec-1.4.3/libhsm/0000775000175000017500000000000012247571202012143 500000000000000opendnssec-1.4.3/libhsm/checks/0000775000175000017500000000000012247571202013403 500000000000000opendnssec-1.4.3/libhsm/checks/conf-multi.xml0000664000175000017500000000075712247571176016145 00000000000000 /usr/local/lib/softhsm/libsofthsm.so softHSM 123456 /usr/local/lib/softhsm/libsofthsm.so xyzzy 123456 opendnssec-1.4.3/libhsm/checks/softhsm.conf0000664000175000017500000000012211216120322015634 00000000000000# $Id: softhsm.conf 1030 2009-06-17 07:52:50Z jakob $ 0:token.db 1:othertoken.db opendnssec-1.4.3/libhsm/checks/conf-sca6000.xml0000664000175000017500000000051212247571176016054 00000000000000 /usr/lib/libpkcs11.so OpenDNSSEC test:1234 opendnssec-1.4.3/libhsm/checks/Makefile.in0000664000175000017500000005052112247571137015402 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6603 2012-09-04 10:16:09Z matthijs $ VPATH = @srcdir@ 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@ noinst_PROGRAMS = hsmcheck$(EXEEXT) subdir = libhsm/checks DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/conf-aepkeyper.xml.in $(srcdir)/conf-etoken.xml.in \ $(srcdir)/conf-multi.xml.in $(srcdir)/conf-ncipher.xml.in \ $(srcdir)/conf-opensc.xml.in $(srcdir)/conf-sca6000.xml.in \ $(srcdir)/conf-softhsm.xml.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = conf-softhsm.xml conf-sca6000.xml conf-etoken.xml \ conf-multi.xml conf-opensc.xml conf-ncipher.xml \ conf-aepkeyper.xml CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) hsmcheck_SOURCES = hsmcheck.c hsmcheck_OBJECTS = hsmcheck.$(OBJEXT) hsmcheck_DEPENDENCIES = ../src/lib/libhsm.a $(LIBCOMPAT) hsmcheck_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(hsmcheck_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common 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 = hsmcheck.c DIST_SOURCES = hsmcheck.c 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in CLEANFILES = token.db othertoken.db LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_builddir)/common \ -I$(srcdir)/../src/lib \ @LDNS_INCLUDES@ AM_CFLAGS = -std=c99 EXTRA_DIST = *.xml $(srcdir)/softhsm.conf hsmcheck_LDADD = ../src/lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) hsmcheck_LDFLAGS = -no-install SOFTHSM_ENV = SOFTHSM_CONF=$(srcdir)/softhsm.conf 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 libhsm/checks/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/checks/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): conf-softhsm.xml: $(top_builddir)/config.status $(srcdir)/conf-softhsm.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-sca6000.xml: $(top_builddir)/config.status $(srcdir)/conf-sca6000.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-etoken.xml: $(top_builddir)/config.status $(srcdir)/conf-etoken.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-multi.xml: $(top_builddir)/config.status $(srcdir)/conf-multi.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-opensc.xml: $(top_builddir)/config.status $(srcdir)/conf-opensc.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-ncipher.xml: $(top_builddir)/config.status $(srcdir)/conf-ncipher.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-aepkeyper.xml: $(top_builddir)/config.status $(srcdir)/conf-aepkeyper.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstPROGRAMS: @list='$(noinst_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 hsmcheck$(EXEEXT): $(hsmcheck_OBJECTS) $(hsmcheck_DEPENDENCIES) $(EXTRA_hsmcheck_DEPENDENCIES) @rm -f hsmcheck$(EXEEXT) $(hsmcheck_LINK) $(hsmcheck_OBJECTS) $(hsmcheck_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmcheck.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 $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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) installdirs: 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS 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-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am token.db othertoken.db: env $(SOFTHSM_ENV) \ softhsm --slot 0 --init-token --label softHSM \ --so-pin 12345678 --pin 123456 env $(SOFTHSM_ENV) \ softhsm --slot 1 --init-token --label xyzzy \ --so-pin 12345678 --pin 123456 check: regress-softhsm regress: @echo use target 'regress-{aepkeyper,sca6000,softhsm,etoken,opensc,ncipher,multi}' regress-aepkeyper: hsmcheck ./hsmcheck -c conf-aepkeyper.xml -gsdr regress-sca6000: hsmcheck ./hsmcheck -c conf-sca6000.xml -gsdr regress-softhsm: hsmcheck token.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-softhsm.xml -gsdr regress-etoken: hsmcheck ./hsmcheck -c conf-etoken.xml -gsdr regress-opensc: hsmcheck ./hsmcheck -c conf-opensc.xml -gsdr regress-ncipher: hsmcheck ./hsmcheck -c conf-ncipher.xml -gsdr regress-multi: hsmcheck token.db othertoken.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-multi.xml -gsdr # 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: opendnssec-1.4.3/libhsm/checks/conf-etoken.xml.in0000664000175000017500000000054511260406147016665 00000000000000 @pkcs11_etoken_module@ OpenDNSSEC test.1234 10 opendnssec-1.4.3/libhsm/checks/conf-softhsm.xml.in0000664000175000017500000000050611260406147017060 00000000000000 @pkcs11_softhsm_module@ softHSM 123456 opendnssec-1.4.3/libhsm/checks/conf-aepkeyper.xml0000664000175000017500000000053012247571176016765 00000000000000 /opt/Keyper/PKCS11Provider/pkcs11.so OpenDNSSEC 123456 opendnssec-1.4.3/libhsm/checks/conf-opensc.xml0000664000175000017500000000051712247571176016274 00000000000000 /usr/lib/pkcs11/opensc-pkcs11.so OpenDNSSEC 1234 opendnssec-1.4.3/libhsm/checks/conf-etoken.xml0000664000175000017500000000055412247571176016273 00000000000000 /usr/local/lib/libeTPkcs11.so OpenDNSSEC test.1234 10 opendnssec-1.4.3/libhsm/checks/conf-softhsm.xml0000664000175000017500000000052312247571176016465 00000000000000 /usr/local/lib/softhsm/libsofthsm.so softHSM 123456 opendnssec-1.4.3/libhsm/checks/conf-ncipher.xml0000664000175000017500000000053612247571176016436 00000000000000 /opt/nfast/toolkits/pkcs11/libcknfast.so OpenDNSSEC 1234567890 opendnssec-1.4.3/libhsm/checks/hsmcheck.c0000664000175000017500000001501512017062714015254 00000000000000/* * $Id: hsmcheck.c 6560 2012-08-28 06:31:40Z rb $ * * Copyright (c) 2009 Nominet UK. * 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, 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 ``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 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. */ #include "config.h" #include #include #include #include #include #include extern char *optarg; char *progname = NULL; void usage () { fprintf(stderr, "usage: %s [-c config] [-gsdr]\n", progname); } int main (int argc, char *argv[]) { int result; hsm_ctx_t *ctx; hsm_key_t **keys; hsm_key_t *key = NULL; char *id; size_t key_count = 0; size_t i; ldns_rr_list *rrset; ldns_rr *rr, *sig, *dnskey_rr; ldns_status status; hsm_sign_params_t *sign_params; int do_generate = 0; int do_sign = 0; int do_delete = 0; int do_random = 0; int res; uint32_t r32; uint64_t r64; char *config = NULL; const char *repository = "default"; int ch; progname = argv[0]; while ((ch = getopt(argc, argv, "hgsdrc:")) != -1) { switch (ch) { case 'c': config = strdup(optarg); break; case 'g': do_generate = 1; break; case 'h': usage(); exit(0); break; case 's': do_sign = 1; break; case 'd': do_delete = 1; break; case 'r': do_random = 1; break; default: usage(); exit(1); } } if (!config) { usage(); exit(1); } /* * Open HSM library */ fprintf(stdout, "Starting HSM lib test\n"); result = hsm_open(config, hsm_prompt_pin); fprintf(stdout, "hsm_open result: %d\n", result); /* * Create HSM context */ ctx = hsm_create_context(); printf("global: "); hsm_print_ctx(NULL); printf("my: "); hsm_print_ctx(ctx); /* * Generate a new key OR find any key with an ID */ if (do_generate) { key = hsm_generate_rsa_key(ctx, repository, 1024); if (key) { printf("\nCreated key!\n"); hsm_print_key(key); printf("\n"); } else { printf("Error creating key, bad token name?\n"); hsm_print_error(ctx); exit(1); } } else if (do_sign || do_delete) { keys = hsm_list_keys(ctx, &key_count); printf("I have found %u keys\n", (unsigned int) key_count); /* let's just use the very first key we find and throw away the rest */ for (i = 0; i < key_count && !key; i++) { printf("\nFound key!\n"); hsm_print_key(keys[i]); id = hsm_get_key_id(ctx, keys[i]); if (id) { printf("Using key ID: %s\n", id); if (key) hsm_key_free(key); key = hsm_find_key_by_id(ctx, id); printf("ptr: 0x%p\n", (void *) key); free(id); } else { printf("Got no key ID (broken key?), skipped...\n"); } hsm_key_free(keys[i]); } free(keys); if (!key) { printf("Failed to find useful key\n"); exit(1); } } /* * Do some signing */ if (do_sign) { printf("\nSigning with:\n"); hsm_print_key(key); printf("\n"); rrset = ldns_rr_list_new(); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 123.123.123.123", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 124.124.124.124", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); sign_params = hsm_sign_params_new(); sign_params->algorithm = LDNS_RSASHA1; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "opendnssec.se."); dnskey_rr = hsm_get_dnskey(ctx, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); sig = hsm_sign_rrset(ctx, rrset, key, sign_params); if (sig) { ldns_rr_list_print(stdout, rrset); ldns_rr_print(stdout, sig); ldns_rr_print(stdout, dnskey_rr); ldns_rr_free(sig); } else { hsm_print_error(ctx); exit(-1); } /* cleanup */ ldns_rr_list_deep_free(rrset); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); } /* * Delete key */ if (do_delete) { printf("\nDelete key:\n"); hsm_print_key(key); /* res = hsm_remove_key(ctx, key); */ res = hsm_remove_key(ctx, key); printf("Deleted key. Result: %d\n", res); printf("\n"); } if (key) hsm_key_free(key); /* * Test random{32,64} functions */ if (do_random) { r32 = hsm_random32(ctx); printf("random 32: %u\n", r32); r64 = hsm_random64(ctx); printf("random 64: %llu\n", (long long unsigned int)r64); } /* * Destroy HSM context */ if (ctx) { hsm_destroy_context(ctx); } /* * Close HSM library */ result = hsm_close(); fprintf(stdout, "all done! hsm_close result: %d\n", result); if (config) free(config); return 0; } opendnssec-1.4.3/libhsm/checks/conf-sca6000.xml.in0000664000175000017500000000051411260406147016450 00000000000000 @pkcs11_sca6000_module@ OpenDNSSEC test:1234 opendnssec-1.4.3/libhsm/checks/conf-aepkeyper.xml.in0000664000175000017500000000051511260406147017362 00000000000000 @pkcs11_aepkeyper_module@ OpenDNSSEC 123456 opendnssec-1.4.3/libhsm/checks/conf-ncipher.xml.in0000664000175000017500000000051511260406147017025 00000000000000 @pkcs11_ncipher_module@ OpenDNSSEC 1234567890 opendnssec-1.4.3/libhsm/checks/Makefile.am0000664000175000017500000000257612021352351015361 00000000000000# $Id: Makefile.am 6603 2012-09-04 10:16:09Z matthijs $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in CLEANFILES = token.db othertoken.db LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_builddir)/common \ -I$(srcdir)/../src/lib \ @LDNS_INCLUDES@ AM_CFLAGS = -std=c99 EXTRA_DIST = *.xml $(srcdir)/softhsm.conf noinst_PROGRAMS = hsmcheck hsmcheck_LDADD = ../src/lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) hsmcheck_LDFLAGS = -no-install SOFTHSM_ENV = SOFTHSM_CONF=$(srcdir)/softhsm.conf token.db othertoken.db: env $(SOFTHSM_ENV) \ softhsm --slot 0 --init-token --label softHSM \ --so-pin 12345678 --pin 123456 env $(SOFTHSM_ENV) \ softhsm --slot 1 --init-token --label xyzzy \ --so-pin 12345678 --pin 123456 check: regress-softhsm regress: @echo use target 'regress-{aepkeyper,sca6000,softhsm,etoken,opensc,ncipher,multi}' regress-aepkeyper: hsmcheck ./hsmcheck -c conf-aepkeyper.xml -gsdr regress-sca6000: hsmcheck ./hsmcheck -c conf-sca6000.xml -gsdr regress-softhsm: hsmcheck token.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-softhsm.xml -gsdr regress-etoken: hsmcheck ./hsmcheck -c conf-etoken.xml -gsdr regress-opensc: hsmcheck ./hsmcheck -c conf-opensc.xml -gsdr regress-ncipher: hsmcheck ./hsmcheck -c conf-ncipher.xml -gsdr regress-multi: hsmcheck token.db othertoken.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-multi.xml -gsdr opendnssec-1.4.3/libhsm/checks/conf-opensc.xml.in0000664000175000017500000000050511260406147016663 00000000000000 @pkcs11_opensc_module@ OpenDNSSEC 1234 opendnssec-1.4.3/libhsm/checks/conf-multi.xml.in0000664000175000017500000000072511260406147016532 00000000000000 @pkcs11_softhsm_module@ softHSM 123456 @pkcs11_softhsm_module@ xyzzy 123456 opendnssec-1.4.3/libhsm/Makefile.in0000664000175000017500000005071012247571137014142 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 3682 2010-08-09 11:55:02Z jakob $ VPATH = @srcdir@ 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@ subdir = libhsm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src checks all: all-recursive .SUFFIXES: $(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 libhsm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am doxygen: rm -fr $(top_builddir)/libhsm/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-libhsm" \ SRCDIR=$(top_srcdir)/libhsm \ OUTPUTDIR=$(top_builddir)/libhsm/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) # 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: opendnssec-1.4.3/libhsm/src/0000775000175000017500000000000012247571202012732 500000000000000opendnssec-1.4.3/libhsm/src/Makefile.in0000664000175000017500000005034512247571137014735 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 5348 2011-08-03 13:01:40Z rb $ VPATH = @srcdir@ 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@ subdir = libhsm/src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = lib bin all: all-recursive .SUFFIXES: $(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 libhsm/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: opendnssec-1.4.3/libhsm/src/bin/0000775000175000017500000000000012247571202013502 500000000000000opendnssec-1.4.3/libhsm/src/bin/hsmspeed.c0000664000175000017500000001731512017062714015403 00000000000000/* * $Id: hsmspeed.c 6560 2012-08-28 06:31:40Z rb $ * * Copyright (c) 2009 Nominet UK. * 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, 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 ``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 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. */ #include "config.h" #include #include #include #include #include #include #include #define PTHREAD_THREADS_MAX 2048 /* Algorithm identifier and name */ ldns_algorithm algorithm = LDNS_RSASHA1; const char *algoname = "RSA/SHA1"; extern char *optarg; char *progname = NULL; typedef struct { unsigned int id; hsm_ctx_t *ctx; hsm_key_t *key; unsigned int iterations; } sign_arg_t; void usage () { fprintf(stderr, "usage: %s " "[-c config] -r repository [-i iterations] [-s keysize] [-t threads]\n", progname); } void * sign (void *arg) { hsm_ctx_t *ctx = NULL; hsm_key_t *key = NULL; size_t i; unsigned int iterations = 0; ldns_rr_list *rrset; ldns_rr *rr, *sig, *dnskey_rr; ldns_status status; hsm_sign_params_t *sign_params; sign_arg_t *sign_arg = arg; ctx = sign_arg->ctx; key = sign_arg->key; iterations = sign_arg->iterations; fprintf(stderr, "Signer thread #%d started...\n", sign_arg->id); /* Prepare dummy RRset for signing */ rrset = ldns_rr_list_new(); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 123.123.123.123", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 124.124.124.124", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); sign_params = hsm_sign_params_new(); sign_params->algorithm = algorithm; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "opendnssec.se."); dnskey_rr = hsm_get_dnskey(ctx, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); /* Do some signing */ for (i=0; ierror_message, ctx->error_action ); break; } ldns_rr_free(sig); } /* Clean up */ ldns_rr_list_deep_free(rrset); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); hsm_destroy_context(ctx); fprintf(stderr, "Signer thread #%d done.\n", sign_arg->id); pthread_exit(NULL); } int main (int argc, char *argv[]) { int result; hsm_ctx_t *ctx = NULL; hsm_key_t *key = NULL; unsigned int keysize = 1024; unsigned int iterations = 1; unsigned int threads = 1; static struct timeval start,end; char *config = NULL; const char *repository = NULL; sign_arg_t sign_arg_array[PTHREAD_THREADS_MAX]; pthread_t thread_array[PTHREAD_THREADS_MAX]; pthread_attr_t thread_attr; void *thread_status; int ch; unsigned int n; double elapsed, speed; progname = argv[0]; while ((ch = getopt(argc, argv, "c:i:r:s:t:")) != -1) { switch (ch) { case 'c': config = strdup(optarg); break; case 'i': iterations = atoi(optarg); break; case 'r': repository = strdup(optarg); break; case 's': keysize = atoi(optarg); break; case 't': threads = atoi(optarg); break; default: usage(); exit(1); } } if (!repository) { usage(); exit(1); } #if 0 if (!config) { usage(); exit(1); } #endif /* Open HSM library */ fprintf(stderr, "Opening HSM Library...\n"); result = hsm_open(config, hsm_prompt_pin); if (result) { fprintf(stderr, "hsm_open() returned %d\n", result); exit(-1); } /* Create HSM context */ ctx = hsm_create_context(); if (! ctx) { fprintf(stderr, "hsm_create_context() returned error\n"); exit(-1); } /* Generate a temporary key */ fprintf(stderr, "Generating temporary key...\n"); key = hsm_generate_rsa_key(ctx, repository, keysize); if (key) { char *id = hsm_get_key_id(ctx, key); fprintf(stderr, "Temporary key created: %s\n", id); free(id); } else { fprintf(stderr, "Could not generate a key pair in repository \"%s\"\n", repository); exit(-1); } /* Prepare threads */ pthread_attr_init(&thread_attr); pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); for (n=0; n 1 ? "threads" : "thread")); gettimeofday(&start, NULL); /* Create threads for signing */ for (n=0; n 1 ? "threads" : "thread"), iterations, speed, keysize); /* Delete temporary key */ fprintf(stderr, "Deleting temporary key...\n"); result = hsm_remove_key(ctx, key); if (result) { fprintf(stderr, "hsm_remove_key() returned %d\n", result); exit(-1); } /* Clean up */ hsm_destroy_context(ctx); (void) hsm_close(); if (config) free(config); return 0; } opendnssec-1.4.3/libhsm/src/bin/Makefile.in0000664000175000017500000006027512247571137015510 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6620 2012-09-05 07:56:36Z matthijs $ VPATH = @srcdir@ 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@ bin_PROGRAMS = ods-hsmutil$(EXEEXT) ods-hsmspeed$(EXEEXT) subdir = libhsm/src/bin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ods-hsmspeed.1.in $(srcdir)/ods-hsmutil.1.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = ods-hsmspeed.1 ods-hsmutil.1 CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_ods_hsmspeed_OBJECTS = hsmspeed.$(OBJEXT) ods_hsmspeed_OBJECTS = $(am_ods_hsmspeed_OBJECTS) ods_hsmspeed_DEPENDENCIES = ../lib/libhsm.a $(LIBCOMPAT) am_ods_hsmutil_OBJECTS = hsmutil.$(OBJEXT) hsmtest.$(OBJEXT) ods_hsmutil_OBJECTS = $(am_ods_hsmutil_OBJECTS) ods_hsmutil_DEPENDENCIES = ../lib/libhsm.a $(LIBCOMPAT) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common 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 = $(ods_hsmspeed_SOURCES) $(ods_hsmutil_SOURCES) DIST_SOURCES = $(ods_hsmspeed_SOURCES) $(ods_hsmutil_SOURCES) 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; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man1_MANS) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/../lib \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 man1_MANS = ods-hsmutil.1 ods-hsmspeed.1 ods_hsmutil_SOURCES = hsmutil.c hsmtest.c hsmtest.h ods_hsmutil_LDADD = ../lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) ods_hsmspeed_SOURCES = hsmspeed.c ods_hsmspeed_LDADD = ../lib/libhsm.a -lpthread @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) 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 libhsm/src/bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/src/bin/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): ods-hsmspeed.1: $(top_builddir)/config.status $(srcdir)/ods-hsmspeed.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-hsmutil.1: $(top_builddir)/config.status $(srcdir)/ods-hsmutil.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 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)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || 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)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_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 ods-hsmspeed$(EXEEXT): $(ods_hsmspeed_OBJECTS) $(ods_hsmspeed_DEPENDENCIES) $(EXTRA_ods_hsmspeed_DEPENDENCIES) @rm -f ods-hsmspeed$(EXEEXT) $(LINK) $(ods_hsmspeed_OBJECTS) $(ods_hsmspeed_LDADD) $(LIBS) ods-hsmutil$(EXEEXT): $(ods_hsmutil_OBJECTS) $(ods_hsmutil_DEPENDENCIES) $(EXTRA_ods_hsmutil_DEPENDENCIES) @rm -f ods-hsmutil$(EXEEXT) $(LINK) $(ods_hsmutil_OBJECTS) $(ods_hsmutil_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmspeed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmutil.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 $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man1_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | 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,^[^1][0-9a-z]*$$,1,;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)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$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)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(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" 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) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool 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-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 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-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 # 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: opendnssec-1.4.3/libhsm/src/bin/hsmutil.c0000664000175000017500000002756012164523516015270 00000000000000/* * $Id: hsmutil.c 7176 2013-07-02 10:11:26Z sara $ * * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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, 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 ``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 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. */ #include "config.h" #include "hsmtest.h" #include #include #include #include #include #include #include extern char *optarg; char *progname = NULL; unsigned int verbose = 0; void version () { fprintf(stderr, "%s (%s) version %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); } void usage () { fprintf(stderr, "usage: %s [-c config] [-vV] command [options]\n", progname); fprintf(stderr," login\n"); fprintf(stderr," logout\n"); fprintf(stderr," list [repository]\n"); fprintf(stderr," generate rsa \n"); fprintf(stderr," remove \n"); fprintf(stderr," purge \n"); fprintf(stderr," dnskey \n"); fprintf(stderr," test \n"); fprintf(stderr," info\n"); #if 0 fprintf(stderr," debug\n"); #endif } int cmd_login () { printf("The tokens are now logged in.\n"); return 0; } int cmd_logout () { if (hsm_logout_pin() != HSM_OK) { printf("Failed to erase the credentials.\n"); hsm_print_error(NULL); return 1; } printf("The credentials has been erased.\n"); return 0; } int cmd_list (int argc, char *argv[]) { size_t i; char *repository = NULL; size_t key_count = 0; size_t key_count_valid = 0; hsm_key_t **keys; hsm_ctx_t *ctx = NULL; const char *key_info_format = "%-20s %-32s %-10s\n"; if (argc) { repository = strdup(argv[0]); argc--; argv++; /* Check for repository before starting using it */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } fprintf(stdout, "\nListing keys in repository: %s\n", repository); keys = hsm_list_keys_repository(NULL, &key_count, repository); } else { fprintf(stdout, "\nListing keys in all repositories.\n"); keys = hsm_list_keys(NULL, &key_count); } fprintf(stdout, "%u %s found.\n\n", (unsigned int) key_count, (key_count > 1 || key_count == 0 ? "keys" : "key")); if (!keys) { return -1; } /* print fancy header */ fprintf(stdout, key_info_format, "Repository", "ID", "Type"); fprintf(stdout, key_info_format, "----------", "--", "----"); for (i = 0; i < key_count; i++) { hsm_key_info_t *key_info; hsm_key_t *key = NULL; char key_type[HSM_MAX_ALGONAME + 8]; char *key_id = NULL; key = keys[i]; if (key == NULL) { /* Skip NULL key for now */ continue; } key_count_valid++; key_info = hsm_get_key_info(NULL, key); if (key_info) { snprintf(key_type, sizeof(key_type), "%s/%lu", key_info->algorithm_name, key_info->keysize); key_id = key_info->id; } else { snprintf(key_type, sizeof(key_type), "UNKNOWN"); key_id = "UNKNOWN"; } printf(key_info_format, key->module->name, key_id, key_type); hsm_key_info_free(key_info); } hsm_key_list_free(keys, key_count); if (key_count != key_count_valid) { size_t invalid_keys; invalid_keys = key_count - key_count_valid; printf("\n"); fprintf(stderr, "Warning: %u %s not usable by OpenDNSSEC was found.\n", (unsigned int) invalid_keys, invalid_keys > 1 ? "keys" : "key"); } return 0; } int cmd_generate (int argc, char *argv[]) { char *repository = NULL; char *algorithm = NULL; unsigned int keysize = 1024; hsm_key_t *key = NULL; hsm_ctx_t *ctx = NULL; if (argc != 3) { usage(); return -1; } repository = strdup(argv[0]); /* Check for repository before starting using it */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } algorithm = strdup(argv[1]); keysize = atoi(argv[2]); if (!strcasecmp(algorithm, "rsa")) { printf("Generating %d bit RSA key in repository: %s\n", keysize, repository); key = hsm_generate_rsa_key(NULL, repository, keysize); if (key) { hsm_key_info_t *key_info; key_info = hsm_get_key_info(NULL, key); printf("Key generation successful: %s\n", key_info ? key_info->id : "NULL"); hsm_key_info_free(key_info); if (verbose) hsm_print_key(key); hsm_key_free(key); } else { printf("Key generation failed.\n"); return -1; } } else { printf("Unknown algorithm: %s\n", algorithm); return -1; } return 0; } int cmd_remove (int argc, char *argv[]) { char *id; int result; hsm_key_t *key = NULL; if (argc != 1) { usage(); return -1; } id = strdup(argv[0]); key = hsm_find_key_by_id(NULL, id); if (!key) { printf("Key not found: %s\n", id); return -1; } result = hsm_remove_key(NULL, key); if (!result) { printf("Key remove successful.\n"); } else { printf("Key remove failed.\n"); } hsm_key_free(key); return result; } int cmd_purge (int argc, char *argv[]) { int result; int final_result = 0; char *fresult; size_t i; char *repository = NULL; char confirm[16]; size_t key_count = 0; hsm_key_t **keys; hsm_ctx_t *ctx = NULL; if (argc != 1) { usage(); return -1; } repository = strdup(argv[0]); argc--; argv++; /* Check for repository before starting using it */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } printf("Purging all keys from repository: %s\n", repository); keys = hsm_list_keys_repository(NULL, &key_count, repository); printf("%u %s found.\n\n", (unsigned int) key_count, (key_count > 1 || key_count == 0 ? "keys" : "key")); if (!keys) { return -1; } if (key_count == 0) { return -1; } printf("Are you sure you want to remove ALL keys from repository %s ? (YES/NO) ", repository); fresult = fgets(confirm, sizeof(confirm) - 1, stdin); if (fresult == NULL || strncasecmp(confirm, "yes", 3) != 0) { printf("\nPurge cancelled.\n"); hsm_key_list_free(keys, key_count); return -1; } else { printf("\nStarting purge...\n"); } for (i = 0; i < key_count; i++) { hsm_key_info_t *key_info; hsm_key_t *key = keys[i]; key_info = hsm_get_key_info(NULL, key); result = hsm_remove_key(NULL, key); if (!result) { printf("Key remove successful: %s\n", key_info ? key_info->id : "NULL"); } else { printf("Key remove failed: %s\n", key_info ? key_info->id : "NULL"); final_result++; } hsm_key_info_free(key_info); } hsm_key_list_free(keys, key_count); printf("Purge done.\n"); return final_result; } int cmd_dnskey (int argc, char *argv[]) { char *id; char *name; hsm_key_t *key = NULL; ldns_rr *dnskey_rr; hsm_sign_params_t *sign_params; if (argc != 2) { usage(); return -1; } id = strdup(argv[0]); name = strdup(argv[1]); key = hsm_find_key_by_id(NULL, id); if (!key) { printf("Key not found: %s\n", id); free(name); free(id); return -1; } sign_params = hsm_sign_params_new(); sign_params->algorithm = LDNS_RSASHA1; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, name); dnskey_rr = hsm_get_dnskey(NULL, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); ldns_rr_print(stdout, dnskey_rr); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); hsm_key_free(key); free(name); free(id); return 0; } int cmd_test (int argc, char *argv[]) { char *repository = NULL; if (argc) { repository = strdup(argv[0]); argc--; argv++; printf("Testing repository: %s\n\n", repository); return hsm_test(repository); } else { usage(); } return 0; } int cmd_info () { hsm_print_tokeninfo(NULL); return 0; } int cmd_debug () { hsm_print_ctx(NULL); return 0; } int main (int argc, char *argv[]) { int result; char *config = NULL; int ch; progname = argv[0]; while ((ch = getopt(argc, argv, "c:vVh")) != -1) { switch (ch) { case 'c': config = strdup(optarg); break; case 'v': verbose++; break; case 'V': version(); exit(0); break; case 'h': usage(); exit(0); break; default: usage(); exit(1); } } argc -= optind; argv += optind; if (!argc) { usage(); exit(1); } if (!strcasecmp(argv[0], "logout")) { if (config) free(config); exit(cmd_logout()); } result = hsm_open(config, hsm_prompt_pin); if (result) { hsm_print_error(NULL); exit(-1); } openlog("hsmutil", LOG_PID, LOG_USER); if (!strcasecmp(argv[0], "login")) { argc --; argv ++; result = cmd_login(); } else if (!strcasecmp(argv[0], "list")) { argc --; argv ++; result = cmd_list(argc, argv); } else if (!strcasecmp(argv[0], "generate")) { argc --; argv ++; result = cmd_generate(argc, argv); } else if (!strcasecmp(argv[0], "remove")) { argc --; argv ++; result = cmd_remove(argc, argv); } else if (!strcasecmp(argv[0], "purge")) { argc --; argv ++; result = cmd_purge(argc, argv); } else if (!strcasecmp(argv[0], "dnskey")) { argc --; argv ++; result = cmd_dnskey(argc, argv); } else if (!strcasecmp(argv[0], "test")) { argc --; argv ++; result = cmd_test(argc, argv); } else if (!strcasecmp(argv[0], "info")) { argc --; argv ++; result = cmd_info(); } else if (!strcasecmp(argv[0], "debug")) { argc --; argv ++; result = cmd_debug(); } else { usage(); result = -1; } (void) hsm_close(); if (config) free(config); closelog(); exit(result); } opendnssec-1.4.3/libhsm/src/bin/ods-hsmutil.1.in0000664000175000017500000000456312026571507016374 00000000000000.TH "ods-hsmutil" "1" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-hsmutil" .\" $Id: ods-hsmutil.1.in 6704 2012-09-20 10:43:19Z rb $ .SH "NAME" .LP .B ods\-hsmutil \- OpenDNSSEC HSM utility .SH "SYNOPSIS" .LP .B ods\-hsmutil .RB [ \-c .IR config ] .RB [ \-v ] .B command .RB [ options ] .SH "DESCRIPTION" .LP The ods\-hsmutil utility is mainly used for debugging or testing. It is designed to interact directly with your HSM and can be used to manually list, create or delete keys. It can also be used to perform a set of basics HSM tests. Be careful before creating or deleting keys using ods\-hsmutil, as the changes are not synchronized with the KASP Enforcer. The repositories are configured by the user in the OpenDNSSEC configuration file. The configuration contains the name of the repository, the token label, the user PIN, and the path to its shared library. .SH "COMMANDS" .LP .TP \fBlogin\fR If there is no PIN in conf.xml, then this command will ask for it and login. The PINs are stored in a shared memory and are accessible to the other daemons. .TP \fBlogout\fR Will erase the semaphore and the shared memory containing any credentials. Authenticated processes will still be able to interact with the HSM. .TP \fBlist\fR [\fIrepository\fR] List the keys that are available in all or one \fIrepository\fR .TP \fBgenerate\fR \fIrepository\fR \fBrsa\fR \fIkeysize\fR Generate a new RSA key with the given \fIkeysize\fR in the \fIrepository\fR .TP \fBremove\fR \fIid\fR Delete the key with the given \fIid\fR .TP \fBpurge\fR \fIrepository\fR Delete all keys in one \fIrepository\fR .TP \fBdnskey\fR \fIid\fR \fIname\fR Create a DNSKEY RR for the given owner \fIname\fR based on the key with this \fIid\fR .TP \fBtest\fR \fIrepository\fR Perform a number of tests on a \fIrepository\fR .TP \fBinfo\fR Show detailed information about all repositories .SH "OPTIONS" .LP .TP \fB\-c\fR \fIconfig\fR Path to an OpenDNSSEC configuration file (defaults to @OPENDNSSEC_CONFIG_FILE@) .TP \fB\-h\fR Show the help screen .TP \fB\-v\fR Output more information by increasing the verbosity level .SH "SEE ALSO" .LP ods\-auditor(1), ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-hsmutil was written by Jakob Schlyter as part of the OpenDNSSEC project. opendnssec-1.4.3/libhsm/src/bin/hsmtest.c0000664000175000017500000002114612017062714015257 00000000000000/* * $Id: hsmtest.c 6560 2012-08-28 06:31:40Z rb $ * * Copyright (c) 2009 Nominet UK. * 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, 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 ``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 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. */ #include "config.h" #include "hsmtest.h" #include #include #include #include #include #include static int hsm_test_sign (hsm_ctx_t *ctx, hsm_key_t *key, ldns_algorithm alg) { int result; ldns_rr_list *rrset; ldns_rr *rr, *sig, *dnskey_rr; ldns_status status; hsm_sign_params_t *sign_params; rrset = ldns_rr_list_new(); status = ldns_rr_new_frm_str(&rr, "example.com. IN A 192.168.0.1", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); status = ldns_rr_new_frm_str(&rr, "example.com. IN A 192.168.0.2", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); sign_params = hsm_sign_params_new(); sign_params->algorithm = alg; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "example.com."); dnskey_rr = hsm_get_dnskey(ctx, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); sig = hsm_sign_rrset(ctx, rrset, key, sign_params); if (sig) { result = 0; ldns_rr_free(sig); } else { result = 1; } ldns_rr_list_deep_free(rrset); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); return result; } static int hsm_test_random() { hsm_ctx_t *ctx = NULL; int result; unsigned char rnd_buf[1024]; uint32_t r32; uint64_t r64; printf("Generating %lu bytes of random data... ", (unsigned long) sizeof(rnd_buf)); result = hsm_random_buffer(ctx, rnd_buf, sizeof(rnd_buf)); if (result) { printf("Failed, error: %d\n", result); hsm_print_error(ctx); return 1; } else { printf("OK\n"); } printf("Generating 32-bit random data... "); r32 = hsm_random32(ctx); printf("%u\n", r32); printf("Generating 64-bit random data... "); r64 = hsm_random64(ctx); printf("%llu\n", (long long unsigned int)r64); return 0; } int hsm_test (const char *repository) { int result; const unsigned int rsa_keysizes[] = { 512, 768, 1024, 1536, 2048, 4096 }; const unsigned int dsa_keysizes[] = { 512, 768, 1024 }; unsigned int keysize; hsm_ctx_t *ctx = NULL; hsm_key_t *key = NULL; char *id; int errors = 0; unsigned int i = 0; /* Check for repository before starting any tests */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } /* * Test key generation, signing and deletion for a number of key size */ for (i=0; i<(sizeof(rsa_keysizes)/sizeof(unsigned int)); i++) { keysize = rsa_keysizes[i]; printf("Generating %d-bit RSA key... ", keysize); key = hsm_generate_rsa_key(ctx, repository, keysize); if (!key) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); continue; } else { printf("OK\n"); } printf("Extracting key identifier... "); id = hsm_get_key_id(ctx, key); if (!id) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); } else { printf("OK, %s\n", id); } free(id); printf("Signing (RSA/SHA1) with key... "); result = hsm_test_sign(ctx, key, LDNS_RSASHA1); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } printf("Signing (RSA/SHA256) with key... "); result = hsm_test_sign(ctx, key, LDNS_RSASHA256); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } if ( keysize >= 1024) { printf("Signing (RSA/SHA512) with key... "); result = hsm_test_sign(ctx, key, LDNS_RSASHA512); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } } printf("Deleting key... "); result = hsm_remove_key(ctx, key); if (result) { errors++; printf("Failed: error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } free(key); printf("\n"); } /* * Test key generation, signing and deletion for a number of key size */ for (i=0; i<(sizeof(dsa_keysizes)/sizeof(unsigned int)); i++) { keysize = dsa_keysizes[i]; printf("Generating %d-bit DSA key... ", keysize); key = hsm_generate_dsa_key(ctx, repository, keysize); if (!key) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); continue; } else { printf("OK\n"); } printf("Extracting key identifier... "); id = hsm_get_key_id(ctx, key); if (!id) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); } else { printf("OK, %s\n", id); } free(id); printf("Signing (DSA/SHA1) with key... "); result = hsm_test_sign(ctx, key, LDNS_DSA); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } printf("Deleting key... "); result = hsm_remove_key(ctx, key); if (result) { errors++; printf("Failed: error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } free(key); printf("\n"); } /* * Test key generation, signing and deletion for a number of key size */ for (i=0; i<1; i++) { printf("Generating 512-bit GOST key... "); key = hsm_generate_gost_key(ctx, repository); if (!key) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); continue; } else { printf("OK\n"); } printf("Extracting key identifier... "); id = hsm_get_key_id(ctx, key); if (!id) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); } else { printf("OK, %s\n", id); } free(id); printf("Signing (GOST) with key... "); result = hsm_test_sign(ctx, key, LDNS_ECC_GOST); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } printf("Deleting key... "); result = hsm_remove_key(ctx, key); if (result) { errors++; printf("Failed: error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } free(key); printf("\n"); } if (hsm_test_random()) { errors++; } return errors; } opendnssec-1.4.3/libhsm/src/bin/hsmtest.h0000664000175000017500000000270112017062714015260 00000000000000/* * $Id: hsmtest.h 6560 2012-08-28 06:31:40Z rb $ * * Copyright (c) 2009 Nominet UK. * 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, 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 ``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 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. */ #ifndef HSMTEST_H #define HSMTEST_H 1 int hsm_test (const char *repository); #endif /* HSMTEST_H */ opendnssec-1.4.3/libhsm/src/bin/Makefile.am0000664000175000017500000000116612021602664015457 00000000000000# $Id: Makefile.am 6620 2012-09-05 07:56:36Z matthijs $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/../lib \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 bin_PROGRAMS = ods-hsmutil ods-hsmspeed man1_MANS = ods-hsmutil.1 ods-hsmspeed.1 ods_hsmutil_SOURCES = hsmutil.c hsmtest.c hsmtest.h ods_hsmutil_LDADD = ../lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) ods_hsmspeed_SOURCES = hsmspeed.c ods_hsmspeed_LDADD = ../lib/libhsm.a -lpthread @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) opendnssec-1.4.3/libhsm/src/bin/ods-hsmspeed.1.in0000664000175000017500000000364612017062714016513 00000000000000.TH "ods-hsmspeed" "1" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-hsmspeed" .\" $Id: ods-hsmspeed.1.in 6560 2012-08-28 06:31:40Z rb $ .SH "NAME" .LP .B ods\-hsmspeed \- OpenDNSSEC HSM speed tester .SH "SYNOPSIS" .LP .B ods\-hsmspeed .RB [ \-c .IR config ] .B \-r .I repository .RB [ \-i .IR iterations ] .RB [ \-s .IR keysize ] .RB [ \-t .IR threads ] .SH "DESCRIPTION" .LP The ods\-hsmspeed utility is part of OpenDNSSEC and can be used to test the performance of the configured HSMs. The components of OpenDNSSEC do not talk directly to the HSMs, but uses an internal library called libhsm. It then talks to the HSMs using PKCS#11. The libhsm simplifies the process of creating keys and signatures for the other components of OpenDNSSEC. ods\-hsmspeed will measure the speed by using the libhsm. The result that you get is somewhat lower than what the manufactures promises, because the libhsm creates some overhead to the pure PKCS#11 environment. .SH "OPTIONS" .LP .TP \fB\-c\fR \fIconfig\fR Path to an OpenDNSSEC configuration file. (defaults to @OPENDNSSEC_CONFIG_FILE@) .TP \fB\-i\fR \fIiterations\fR Specify the number of \fIiterations\fR for signing an RRset. A higher number of iterations will increase the performance. (defaults to 1 iteration) .TP \fB\-r\fR \fIrepository\fR The speed test will be performed on this \fIrepository\fR. .TP \fB\-s\fR \fIkeysize\fR A temporary RSA key with the given \fIkeysize\fR will be used for signing. (defaults to 1024 bit) .TP \fB\-t\fR \fIthreads\fR The number of \fIthreads\fR to use. Most HSMs will be utilized better with multiple threads. (defaults to 1 thread) .SH "SEE ALSO" .LP ods\-auditor(1), ods\-control(8), ods\-enforcerd(8), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-hsmspeed was written by Jakob Schlyter and Nominet as part of the OpenDNSSEC project. opendnssec-1.4.3/libhsm/src/lib/0000775000175000017500000000000012247571202013500 500000000000000opendnssec-1.4.3/libhsm/src/lib/cryptoki_compat/0000775000175000017500000000000012247571202016707 500000000000000opendnssec-1.4.3/libhsm/src/lib/cryptoki_compat/pkcs11.h0000664000175000017500000012357411616532031020112 00000000000000/* pkcs11.h Copyright 2006, 2007 g10 Code GmbH Copyright 2006 Andreas Jellinghaus This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file 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. */ /* Please submit changes back to the Scute project at http://www.scute.org/ (or send them to marcus@g10code.com), so that they can be picked up by other projects from there as well. */ /* This file is a modified implementation of the PKCS #11 standard by RSA Security Inc. It is mostly a drop-in replacement, with the following change: This header file does not require any macro definitions by the user (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros for you (if useful, some are missing, let me know if you need more). There is an additional API available that does comply better to the GNU coding standard. It can be switched on by defining CRYPTOKI_GNU before including this header file. For this, the following changes are made to the specification: All structure types are changed to a "struct ck_foo" where CK_FOO is the type name in PKCS #11. All non-structure types are changed to ck_foo_t where CK_FOO is the lowercase version of the type name in PKCS #11. The basic types (CK_ULONG et al.) are removed without substitute. All members of structures are modified in the following way: Type indication prefixes are removed, and underscore characters are inserted before words. Then the result is lowercased. Note that function names are still in the original case, as they need for ABI compatibility. CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use . If CRYPTOKI_COMPAT is defined before including this header file, then none of the API changes above take place, and the API is the one defined by the PKCS #11 standard. */ #ifndef PKCS11_H #define PKCS11_H 1 #if defined(__cplusplus) extern "C" { #endif /* The version of cryptoki we implement. The revision is changed with each modification of this file. If you do not use the "official" version of this file, please consider deleting the revision macro (you may use a macro with a different name to keep track of your versions). */ #define CRYPTOKI_VERSION_MAJOR 2 #define CRYPTOKI_VERSION_MINOR 20 #define CRYPTOKI_VERSION_REVISION 6 /* Compatibility interface is default, unless CRYPTOKI_GNU is given. */ #ifndef CRYPTOKI_GNU #ifndef CRYPTOKI_COMPAT #define CRYPTOKI_COMPAT 1 #endif #endif /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) /* There is a matching pop below. */ #pragma pack(push, cryptoki, 1) #ifdef CRYPTOKI_EXPORTS #define CK_SPEC __declspec(dllexport) #else #define CK_SPEC __declspec(dllimport) #endif #else #define CK_SPEC #endif #ifdef CRYPTOKI_COMPAT /* If we are in compatibility mode, switch all exposed names to the PKCS #11 variant. There are corresponding #undefs below. */ #define ck_flags_t CK_FLAGS #define ck_version _CK_VERSION #define ck_info _CK_INFO #define cryptoki_version cryptokiVersion #define manufacturer_id manufacturerID #define library_description libraryDescription #define library_version libraryVersion #define ck_notification_t CK_NOTIFICATION #define ck_slot_id_t CK_SLOT_ID #define ck_slot_info _CK_SLOT_INFO #define slot_description slotDescription #define hardware_version hardwareVersion #define firmware_version firmwareVersion #define ck_token_info _CK_TOKEN_INFO #define serial_number serialNumber #define max_session_count ulMaxSessionCount #define session_count ulSessionCount #define max_rw_session_count ulMaxRwSessionCount #define rw_session_count ulRwSessionCount #define max_pin_len ulMaxPinLen #define min_pin_len ulMinPinLen #define total_public_memory ulTotalPublicMemory #define free_public_memory ulFreePublicMemory #define total_private_memory ulTotalPrivateMemory #define free_private_memory ulFreePrivateMemory #define utc_time utcTime #define ck_session_handle_t CK_SESSION_HANDLE #define ck_user_type_t CK_USER_TYPE #define ck_state_t CK_STATE #define ck_session_info _CK_SESSION_INFO #define slot_id slotID #define device_error ulDeviceError #define ck_object_handle_t CK_OBJECT_HANDLE #define ck_object_class_t CK_OBJECT_CLASS #define ck_hw_feature_type_t CK_HW_FEATURE_TYPE #define ck_key_type_t CK_KEY_TYPE #define ck_certificate_type_t CK_CERTIFICATE_TYPE #define ck_attribute_type_t CK_ATTRIBUTE_TYPE #define ck_attribute _CK_ATTRIBUTE #define value pValue #define value_len ulValueLen #define ck_date _CK_DATE #define ck_mechanism_type_t CK_MECHANISM_TYPE #define ck_mechanism _CK_MECHANISM #define parameter pParameter #define parameter_len ulParameterLen #define ck_mechanism_info _CK_MECHANISM_INFO #define min_key_size ulMinKeySize #define max_key_size ulMaxKeySize #define ck_rv_t CK_RV #define ck_notify_t CK_NOTIFY #define ck_function_list _CK_FUNCTION_LIST #define ck_createmutex_t CK_CREATEMUTEX #define ck_destroymutex_t CK_DESTROYMUTEX #define ck_lockmutex_t CK_LOCKMUTEX #define ck_unlockmutex_t CK_UNLOCKMUTEX #define ck_c_initialize_args _CK_C_INITIALIZE_ARGS #define create_mutex CreateMutex #define destroy_mutex DestroyMutex #define lock_mutex LockMutex #define unlock_mutex UnlockMutex #define reserved pReserved #endif /* CRYPTOKI_COMPAT */ typedef unsigned long ck_flags_t; struct ck_version { unsigned char major; unsigned char minor; }; struct ck_info { struct ck_version cryptoki_version; unsigned char manufacturer_id[32]; ck_flags_t flags; unsigned char library_description[32]; struct ck_version library_version; }; typedef unsigned long ck_notification_t; #define CKN_SURRENDER (0) typedef unsigned long ck_slot_id_t; struct ck_slot_info { unsigned char slot_description[64]; unsigned char manufacturer_id[32]; ck_flags_t flags; struct ck_version hardware_version; struct ck_version firmware_version; }; #define CKF_TOKEN_PRESENT (1 << 0) #define CKF_REMOVABLE_DEVICE (1 << 1) #define CKF_HW_SLOT (1 << 2) #define CKF_ARRAY_ATTRIBUTE (1 << 30) struct ck_token_info { unsigned char label[32]; unsigned char manufacturer_id[32]; unsigned char model[16]; unsigned char serial_number[16]; ck_flags_t flags; unsigned long max_session_count; unsigned long session_count; unsigned long max_rw_session_count; unsigned long rw_session_count; unsigned long max_pin_len; unsigned long min_pin_len; unsigned long total_public_memory; unsigned long free_public_memory; unsigned long total_private_memory; unsigned long free_private_memory; struct ck_version hardware_version; struct ck_version firmware_version; unsigned char utc_time[16]; }; #define CKF_RNG (1 << 0) #define CKF_WRITE_PROTECTED (1 << 1) #define CKF_LOGIN_REQUIRED (1 << 2) #define CKF_USER_PIN_INITIALIZED (1 << 3) #define CKF_RESTORE_KEY_NOT_NEEDED (1 << 5) #define CKF_CLOCK_ON_TOKEN (1 << 6) #define CKF_PROTECTED_AUTHENTICATION_PATH (1 << 8) #define CKF_DUAL_CRYPTO_OPERATIONS (1 << 9) #define CKF_TOKEN_INITIALIZED (1 << 10) #define CKF_SECONDARY_AUTHENTICATION (1 << 11) #define CKF_USER_PIN_COUNT_LOW (1 << 16) #define CKF_USER_PIN_FINAL_TRY (1 << 17) #define CKF_USER_PIN_LOCKED (1 << 18) #define CKF_USER_PIN_TO_BE_CHANGED (1 << 19) #define CKF_SO_PIN_COUNT_LOW (1 << 20) #define CKF_SO_PIN_FINAL_TRY (1 << 21) #define CKF_SO_PIN_LOCKED (1 << 22) #define CKF_SO_PIN_TO_BE_CHANGED (1 << 23) #define CK_UNAVAILABLE_INFORMATION ((unsigned long) -1) #define CK_EFFECTIVELY_INFINITE (0) typedef unsigned long ck_session_handle_t; #define CK_INVALID_HANDLE (0) typedef unsigned long ck_user_type_t; #define CKU_SO (0) #define CKU_USER (1) #define CKU_CONTEXT_SPECIFIC (2) typedef unsigned long ck_state_t; #define CKS_RO_PUBLIC_SESSION (0) #define CKS_RO_USER_FUNCTIONS (1) #define CKS_RW_PUBLIC_SESSION (2) #define CKS_RW_USER_FUNCTIONS (3) #define CKS_RW_SO_FUNCTIONS (4) struct ck_session_info { ck_slot_id_t slot_id; ck_state_t state; ck_flags_t flags; unsigned long device_error; }; #define CKF_RW_SESSION (1 << 1) #define CKF_SERIAL_SESSION (1 << 2) typedef unsigned long ck_object_handle_t; typedef unsigned long ck_object_class_t; #define CKO_DATA (0) #define CKO_CERTIFICATE (1) #define CKO_PUBLIC_KEY (2) #define CKO_PRIVATE_KEY (3) #define CKO_SECRET_KEY (4) #define CKO_HW_FEATURE (5) #define CKO_DOMAIN_PARAMETERS (6) #define CKO_MECHANISM (7) #define CKO_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_hw_feature_type_t; #define CKH_MONOTONIC_COUNTER (1) #define CKH_CLOCK (2) #define CKH_USER_INTERFACE (3) #define CKH_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_key_type_t; #define CKK_RSA (0) #define CKK_DSA (1) #define CKK_DH (2) #define CKK_ECDSA (3) #define CKK_EC (3) #define CKK_X9_42_DH (4) #define CKK_KEA (5) #define CKK_GENERIC_SECRET (0x10) #define CKK_RC2 (0x11) #define CKK_RC4 (0x12) #define CKK_DES (0x13) #define CKK_DES2 (0x14) #define CKK_DES3 (0x15) #define CKK_CAST (0x16) #define CKK_CAST3 (0x17) #define CKK_CAST128 (0x18) #define CKK_RC5 (0x19) #define CKK_IDEA (0x1a) #define CKK_SKIPJACK (0x1b) #define CKK_BATON (0x1c) #define CKK_JUNIPER (0x1d) #define CKK_CDMF (0x1e) #define CKK_AES (0x1f) #define CKK_BLOWFISH (0x20) #define CKK_TWOFISH (0x21) #define CKK_GOSTR3410 (0x30) /* From PKCS#11 v2.30 - draft 7 */ #define CKK_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_certificate_type_t; #define CKC_X_509 (0) #define CKC_X_509_ATTR_CERT (1) #define CKC_WTLS (2) #define CKC_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_attribute_type_t; #define CKA_CLASS (0) #define CKA_TOKEN (1) #define CKA_PRIVATE (2) #define CKA_LABEL (3) #define CKA_APPLICATION (0x10) #define CKA_VALUE (0x11) #define CKA_OBJECT_ID (0x12) #define CKA_CERTIFICATE_TYPE (0x80) #define CKA_ISSUER (0x81) #define CKA_SERIAL_NUMBER (0x82) #define CKA_AC_ISSUER (0x83) #define CKA_OWNER (0x84) #define CKA_ATTR_TYPES (0x85) #define CKA_TRUSTED (0x86) #define CKA_CERTIFICATE_CATEGORY (0x87) #define CKA_JAVA_MIDP_SECURITY_DOMAIN (0x88) #define CKA_URL (0x89) #define CKA_HASH_OF_SUBJECT_PUBLIC_KEY (0x8a) #define CKA_HASH_OF_ISSUER_PUBLIC_KEY (0x8b) #define CKA_CHECK_VALUE (0x90) #define CKA_KEY_TYPE (0x100) #define CKA_SUBJECT (0x101) #define CKA_ID (0x102) #define CKA_SENSITIVE (0x103) #define CKA_ENCRYPT (0x104) #define CKA_DECRYPT (0x105) #define CKA_WRAP (0x106) #define CKA_UNWRAP (0x107) #define CKA_SIGN (0x108) #define CKA_SIGN_RECOVER (0x109) #define CKA_VERIFY (0x10a) #define CKA_VERIFY_RECOVER (0x10b) #define CKA_DERIVE (0x10c) #define CKA_START_DATE (0x110) #define CKA_END_DATE (0x111) #define CKA_MODULUS (0x120) #define CKA_MODULUS_BITS (0x121) #define CKA_PUBLIC_EXPONENT (0x122) #define CKA_PRIVATE_EXPONENT (0x123) #define CKA_PRIME_1 (0x124) #define CKA_PRIME_2 (0x125) #define CKA_EXPONENT_1 (0x126) #define CKA_EXPONENT_2 (0x127) #define CKA_COEFFICIENT (0x128) #define CKA_PRIME (0x130) #define CKA_SUBPRIME (0x131) #define CKA_BASE (0x132) #define CKA_PRIME_BITS (0x133) #define CKA_SUB_PRIME_BITS (0x134) #define CKA_VALUE_BITS (0x160) #define CKA_VALUE_LEN (0x161) #define CKA_EXTRACTABLE (0x162) #define CKA_LOCAL (0x163) #define CKA_NEVER_EXTRACTABLE (0x164) #define CKA_ALWAYS_SENSITIVE (0x165) #define CKA_KEY_GEN_MECHANISM (0x166) #define CKA_MODIFIABLE (0x170) #define CKA_ECDSA_PARAMS (0x180) #define CKA_EC_PARAMS (0x180) #define CKA_EC_POINT (0x181) #define CKA_SECONDARY_AUTH (0x200) #define CKA_AUTH_PIN_FLAGS (0x201) #define CKA_ALWAYS_AUTHENTICATE (0x202) #define CKA_WRAP_WITH_TRUSTED (0x210) #define CKA_GOSTR3410PARAMS (0x250) /* From PKCS#11 v2.30 - draft 7 */ #define CKA_HW_FEATURE_TYPE (0x300) #define CKA_RESET_ON_INIT (0x301) #define CKA_HAS_RESET (0x302) #define CKA_PIXEL_X (0x400) #define CKA_PIXEL_Y (0x401) #define CKA_RESOLUTION (0x402) #define CKA_CHAR_ROWS (0x403) #define CKA_CHAR_COLUMNS (0x404) #define CKA_COLOR (0x405) #define CKA_BITS_PER_PIXEL (0x406) #define CKA_CHAR_SETS (0x480) #define CKA_ENCODING_METHODS (0x481) #define CKA_MIME_TYPES (0x482) #define CKA_MECHANISM_TYPE (0x500) #define CKA_REQUIRED_CMS_ATTRIBUTES (0x501) #define CKA_DEFAULT_CMS_ATTRIBUTES (0x502) #define CKA_SUPPORTED_CMS_ATTRIBUTES (0x503) #define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x211) #define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x212) #define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x600) #define CKA_VENDOR_DEFINED ((unsigned long) (1 << 31)) struct ck_attribute { ck_attribute_type_t type; void *value; unsigned long value_len; }; struct ck_date { unsigned char year[4]; unsigned char month[2]; unsigned char day[2]; }; typedef unsigned long ck_mechanism_type_t; #define CKM_RSA_PKCS_KEY_PAIR_GEN (0) #define CKM_RSA_PKCS (1) #define CKM_RSA_9796 (2) #define CKM_RSA_X_509 (3) #define CKM_MD2_RSA_PKCS (4) #define CKM_MD5_RSA_PKCS (5) #define CKM_SHA1_RSA_PKCS (6) #define CKM_RIPEMD128_RSA_PKCS (7) #define CKM_RIPEMD160_RSA_PKCS (8) #define CKM_RSA_PKCS_OAEP (9) #define CKM_RSA_X9_31_KEY_PAIR_GEN (0xa) #define CKM_RSA_X9_31 (0xb) #define CKM_SHA1_RSA_X9_31 (0xc) #define CKM_RSA_PKCS_PSS (0xd) #define CKM_SHA1_RSA_PKCS_PSS (0xe) #define CKM_DSA_KEY_PAIR_GEN (0x10) #define CKM_DSA (0x11) #define CKM_DSA_SHA1 (0x12) #define CKM_DH_PKCS_KEY_PAIR_GEN (0x20) #define CKM_DH_PKCS_DERIVE (0x21) #define CKM_X9_42_DH_KEY_PAIR_GEN (0x30) #define CKM_X9_42_DH_DERIVE (0x31) #define CKM_X9_42_DH_HYBRID_DERIVE (0x32) #define CKM_X9_42_MQV_DERIVE (0x33) #define CKM_SHA256_RSA_PKCS (0x40) #define CKM_SHA384_RSA_PKCS (0x41) #define CKM_SHA512_RSA_PKCS (0x42) #define CKM_SHA256_RSA_PKCS_PSS (0x43) #define CKM_SHA384_RSA_PKCS_PSS (0x44) #define CKM_SHA512_RSA_PKCS_PSS (0x45) #define CKM_RC2_KEY_GEN (0x100) #define CKM_RC2_ECB (0x101) #define CKM_RC2_CBC (0x102) #define CKM_RC2_MAC (0x103) #define CKM_RC2_MAC_GENERAL (0x104) #define CKM_RC2_CBC_PAD (0x105) #define CKM_RC4_KEY_GEN (0x110) #define CKM_RC4 (0x111) #define CKM_DES_KEY_GEN (0x120) #define CKM_DES_ECB (0x121) #define CKM_DES_CBC (0x122) #define CKM_DES_MAC (0x123) #define CKM_DES_MAC_GENERAL (0x124) #define CKM_DES_CBC_PAD (0x125) #define CKM_DES2_KEY_GEN (0x130) #define CKM_DES3_KEY_GEN (0x131) #define CKM_DES3_ECB (0x132) #define CKM_DES3_CBC (0x133) #define CKM_DES3_MAC (0x134) #define CKM_DES3_MAC_GENERAL (0x135) #define CKM_DES3_CBC_PAD (0x136) #define CKM_CDMF_KEY_GEN (0x140) #define CKM_CDMF_ECB (0x141) #define CKM_CDMF_CBC (0x142) #define CKM_CDMF_MAC (0x143) #define CKM_CDMF_MAC_GENERAL (0x144) #define CKM_CDMF_CBC_PAD (0x145) #define CKM_MD2 (0x200) #define CKM_MD2_HMAC (0x201) #define CKM_MD2_HMAC_GENERAL (0x202) #define CKM_MD5 (0x210) #define CKM_MD5_HMAC (0x211) #define CKM_MD5_HMAC_GENERAL (0x212) #define CKM_SHA_1 (0x220) #define CKM_SHA_1_HMAC (0x221) #define CKM_SHA_1_HMAC_GENERAL (0x222) #define CKM_RIPEMD128 (0x230) #define CKM_RIPEMD128_HMAC (0x231) #define CKM_RIPEMD128_HMAC_GENERAL (0x232) #define CKM_RIPEMD160 (0x240) #define CKM_RIPEMD160_HMAC (0x241) #define CKM_RIPEMD160_HMAC_GENERAL (0x242) #define CKM_SHA256 (0x250) #define CKM_SHA256_HMAC (0x251) #define CKM_SHA256_HMAC_GENERAL (0x252) #define CKM_SHA384 (0x260) #define CKM_SHA384_HMAC (0x261) #define CKM_SHA384_HMAC_GENERAL (0x262) #define CKM_SHA512 (0x270) #define CKM_SHA512_HMAC (0x271) #define CKM_SHA512_HMAC_GENERAL (0x272) #define CKM_CAST_KEY_GEN (0x300) #define CKM_CAST_ECB (0x301) #define CKM_CAST_CBC (0x302) #define CKM_CAST_MAC (0x303) #define CKM_CAST_MAC_GENERAL (0x304) #define CKM_CAST_CBC_PAD (0x305) #define CKM_CAST3_KEY_GEN (0x310) #define CKM_CAST3_ECB (0x311) #define CKM_CAST3_CBC (0x312) #define CKM_CAST3_MAC (0x313) #define CKM_CAST3_MAC_GENERAL (0x314) #define CKM_CAST3_CBC_PAD (0x315) #define CKM_CAST5_KEY_GEN (0x320) #define CKM_CAST128_KEY_GEN (0x320) #define CKM_CAST5_ECB (0x321) #define CKM_CAST128_ECB (0x321) #define CKM_CAST5_CBC (0x322) #define CKM_CAST128_CBC (0x322) #define CKM_CAST5_MAC (0x323) #define CKM_CAST128_MAC (0x323) #define CKM_CAST5_MAC_GENERAL (0x324) #define CKM_CAST128_MAC_GENERAL (0x324) #define CKM_CAST5_CBC_PAD (0x325) #define CKM_CAST128_CBC_PAD (0x325) #define CKM_RC5_KEY_GEN (0x330) #define CKM_RC5_ECB (0x331) #define CKM_RC5_CBC (0x332) #define CKM_RC5_MAC (0x333) #define CKM_RC5_MAC_GENERAL (0x334) #define CKM_RC5_CBC_PAD (0x335) #define CKM_IDEA_KEY_GEN (0x340) #define CKM_IDEA_ECB (0x341) #define CKM_IDEA_CBC (0x342) #define CKM_IDEA_MAC (0x343) #define CKM_IDEA_MAC_GENERAL (0x344) #define CKM_IDEA_CBC_PAD (0x345) #define CKM_GENERIC_SECRET_KEY_GEN (0x350) #define CKM_CONCATENATE_BASE_AND_KEY (0x360) #define CKM_CONCATENATE_BASE_AND_DATA (0x362) #define CKM_CONCATENATE_DATA_AND_BASE (0x363) #define CKM_XOR_BASE_AND_DATA (0x364) #define CKM_EXTRACT_KEY_FROM_KEY (0x365) #define CKM_SSL3_PRE_MASTER_KEY_GEN (0x370) #define CKM_SSL3_MASTER_KEY_DERIVE (0x371) #define CKM_SSL3_KEY_AND_MAC_DERIVE (0x372) #define CKM_SSL3_MASTER_KEY_DERIVE_DH (0x373) #define CKM_TLS_PRE_MASTER_KEY_GEN (0x374) #define CKM_TLS_MASTER_KEY_DERIVE (0x375) #define CKM_TLS_KEY_AND_MAC_DERIVE (0x376) #define CKM_TLS_MASTER_KEY_DERIVE_DH (0x377) #define CKM_SSL3_MD5_MAC (0x380) #define CKM_SSL3_SHA1_MAC (0x381) #define CKM_MD5_KEY_DERIVATION (0x390) #define CKM_MD2_KEY_DERIVATION (0x391) #define CKM_SHA1_KEY_DERIVATION (0x392) #define CKM_PBE_MD2_DES_CBC (0x3a0) #define CKM_PBE_MD5_DES_CBC (0x3a1) #define CKM_PBE_MD5_CAST_CBC (0x3a2) #define CKM_PBE_MD5_CAST3_CBC (0x3a3) #define CKM_PBE_MD5_CAST5_CBC (0x3a4) #define CKM_PBE_MD5_CAST128_CBC (0x3a4) #define CKM_PBE_SHA1_CAST5_CBC (0x3a5) #define CKM_PBE_SHA1_CAST128_CBC (0x3a5) #define CKM_PBE_SHA1_RC4_128 (0x3a6) #define CKM_PBE_SHA1_RC4_40 (0x3a7) #define CKM_PBE_SHA1_DES3_EDE_CBC (0x3a8) #define CKM_PBE_SHA1_DES2_EDE_CBC (0x3a9) #define CKM_PBE_SHA1_RC2_128_CBC (0x3aa) #define CKM_PBE_SHA1_RC2_40_CBC (0x3ab) #define CKM_PKCS5_PBKD2 (0x3b0) #define CKM_PBA_SHA1_WITH_SHA1_HMAC (0x3c0) #define CKM_KEY_WRAP_LYNKS (0x400) #define CKM_KEY_WRAP_SET_OAEP (0x401) #define CKM_SKIPJACK_KEY_GEN (0x1000) #define CKM_SKIPJACK_ECB64 (0x1001) #define CKM_SKIPJACK_CBC64 (0x1002) #define CKM_SKIPJACK_OFB64 (0x1003) #define CKM_SKIPJACK_CFB64 (0x1004) #define CKM_SKIPJACK_CFB32 (0x1005) #define CKM_SKIPJACK_CFB16 (0x1006) #define CKM_SKIPJACK_CFB8 (0x1007) #define CKM_SKIPJACK_WRAP (0x1008) #define CKM_SKIPJACK_PRIVATE_WRAP (0x1009) #define CKM_SKIPJACK_RELAYX (0x100a) #define CKM_KEA_KEY_PAIR_GEN (0x1010) #define CKM_KEA_KEY_DERIVE (0x1011) #define CKM_FORTEZZA_TIMESTAMP (0x1020) #define CKM_BATON_KEY_GEN (0x1030) #define CKM_BATON_ECB128 (0x1031) #define CKM_BATON_ECB96 (0x1032) #define CKM_BATON_CBC128 (0x1033) #define CKM_BATON_COUNTER (0x1034) #define CKM_BATON_SHUFFLE (0x1035) #define CKM_BATON_WRAP (0x1036) #define CKM_ECDSA_KEY_PAIR_GEN (0x1040) #define CKM_EC_KEY_PAIR_GEN (0x1040) #define CKM_ECDSA (0x1041) #define CKM_ECDSA_SHA1 (0x1042) #define CKM_ECDH1_DERIVE (0x1050) #define CKM_ECDH1_COFACTOR_DERIVE (0x1051) #define CKM_ECMQV_DERIVE (0x1052) #define CKM_JUNIPER_KEY_GEN (0x1060) #define CKM_JUNIPER_ECB128 (0x1061) #define CKM_JUNIPER_CBC128 (0x1062) #define CKM_JUNIPER_COUNTER (0x1063) #define CKM_JUNIPER_SHUFFLE (0x1064) #define CKM_JUNIPER_WRAP (0x1065) #define CKM_FASTHASH (0x1070) #define CKM_AES_KEY_GEN (0x1080) #define CKM_AES_ECB (0x1081) #define CKM_AES_CBC (0x1082) #define CKM_AES_MAC (0x1083) #define CKM_AES_MAC_GENERAL (0x1084) #define CKM_AES_CBC_PAD (0x1085) #define CKM_GOSTR3410_KEY_PAIR_GEN (0x1200) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_GOSTR3410 (0x1201) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_GOSTR3410_WITH_GOSTR3411 (0x1202) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_GOSTR3411 (0x1210) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_DSA_PARAMETER_GEN (0x2000) #define CKM_DH_PKCS_PARAMETER_GEN (0x2001) #define CKM_X9_42_DH_PARAMETER_GEN (0x2002) #define CKM_VENDOR_DEFINED ((unsigned long) (1 << 31)) struct ck_mechanism { ck_mechanism_type_t mechanism; void *parameter; unsigned long parameter_len; }; struct ck_mechanism_info { unsigned long min_key_size; unsigned long max_key_size; ck_flags_t flags; }; #define CKF_HW (1 << 0) #define CKF_ENCRYPT (1 << 8) #define CKF_DECRYPT (1 << 9) #define CKF_DIGEST (1 << 10) #define CKF_SIGN (1 << 11) #define CKF_SIGN_RECOVER (1 << 12) #define CKF_VERIFY (1 << 13) #define CKF_VERIFY_RECOVER (1 << 14) #define CKF_GENERATE (1 << 15) #define CKF_GENERATE_KEY_PAIR (1 << 16) #define CKF_WRAP (1 << 17) #define CKF_UNWRAP (1 << 18) #define CKF_DERIVE (1 << 19) #define CKF_EXTENSION ((unsigned long) (1 << 31)) /* Flags for C_WaitForSlotEvent. */ #define CKF_DONT_BLOCK (1) typedef unsigned long ck_rv_t; typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session, ck_notification_t event, void *application); /* Forward reference. */ struct ck_function_list; #define _CK_DECLARE_FUNCTION(name, args) \ typedef ck_rv_t (*CK_ ## name) args; \ ck_rv_t CK_SPEC name args _CK_DECLARE_FUNCTION (C_Initialize, (void *init_args)); _CK_DECLARE_FUNCTION (C_Finalize, (void *reserved)); _CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info)); _CK_DECLARE_FUNCTION (C_GetFunctionList, (struct ck_function_list **function_list)); _CK_DECLARE_FUNCTION (C_GetSlotList, (unsigned char token_present, ck_slot_id_t *slot_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetSlotInfo, (ck_slot_id_t slot_id, struct ck_slot_info *info)); _CK_DECLARE_FUNCTION (C_GetTokenInfo, (ck_slot_id_t slot_id, struct ck_token_info *info)); _CK_DECLARE_FUNCTION (C_WaitForSlotEvent, (ck_flags_t flags, ck_slot_id_t *slot, void *reserved)); _CK_DECLARE_FUNCTION (C_GetMechanismList, (ck_slot_id_t slot_id, ck_mechanism_type_t *mechanism_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetMechanismInfo, (ck_slot_id_t slot_id, ck_mechanism_type_t type, struct ck_mechanism_info *info)); _CK_DECLARE_FUNCTION (C_InitToken, (ck_slot_id_t slot_id, unsigned char *pin, unsigned long pin_len, unsigned char *label)); _CK_DECLARE_FUNCTION (C_InitPIN, (ck_session_handle_t session, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_SetPIN, (ck_session_handle_t session, unsigned char *old_pin, unsigned long old_len, unsigned char *new_pin, unsigned long new_len)); _CK_DECLARE_FUNCTION (C_OpenSession, (ck_slot_id_t slot_id, ck_flags_t flags, void *application, ck_notify_t notify, ck_session_handle_t *session)); _CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id)); _CK_DECLARE_FUNCTION (C_GetSessionInfo, (ck_session_handle_t session, struct ck_session_info *info)); _CK_DECLARE_FUNCTION (C_GetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long *operation_state_len)); _CK_DECLARE_FUNCTION (C_SetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long operation_state_len, ck_object_handle_t encryption_key, ck_object_handle_t authentiation_key)); _CK_DECLARE_FUNCTION (C_Login, (ck_session_handle_t session, ck_user_type_t user_type, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CreateObject, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *object)); _CK_DECLARE_FUNCTION (C_CopyObject, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *new_object)); _CK_DECLARE_FUNCTION (C_DestroyObject, (ck_session_handle_t session, ck_object_handle_t object)); _CK_DECLARE_FUNCTION (C_GetObjectSize, (ck_session_handle_t session, ck_object_handle_t object, unsigned long *size)); _CK_DECLARE_FUNCTION (C_GetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_SetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjectsInit, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjects, (ck_session_handle_t session, ck_object_handle_t *object, unsigned long max_object_count, unsigned long *object_count)); _CK_DECLARE_FUNCTION (C_FindObjectsFinal, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_EncryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Encrypt, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *encrypted_data, unsigned long *encrypted_data_len)); _CK_DECLARE_FUNCTION (C_EncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_EncryptFinal, (ck_session_handle_t session, unsigned char *last_encrypted_part, unsigned long *last_encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Decrypt, (ck_session_handle_t session, unsigned char *encrypted_data, unsigned long encrypted_data_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DecryptUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_DecryptFinal, (ck_session_handle_t session, unsigned char *last_part, unsigned long *last_part_len)); _CK_DECLARE_FUNCTION (C_DigestInit, (ck_session_handle_t session, struct ck_mechanism *mechanism)); _CK_DECLARE_FUNCTION (C_Digest, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_DigestUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_DigestKey, (ck_session_handle_t session, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_DigestFinal, (ck_session_handle_t session, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_SignInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Sign, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_SignFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_SignRecover, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_VerifyInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Verify, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_VerifyFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_VerifyRecover, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DigestEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptDigestUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_SignEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_GenerateKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_GenerateKeyPair, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *public_key_template, unsigned long public_key_attribute_count, struct ck_attribute *private_key_template, unsigned long private_key_attribute_count, ck_object_handle_t *public_key, ck_object_handle_t *private_key)); _CK_DECLARE_FUNCTION (C_WrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t wrapping_key, ck_object_handle_t key, unsigned char *wrapped_key, unsigned long *wrapped_key_len)); _CK_DECLARE_FUNCTION (C_UnwrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t unwrapping_key, unsigned char *wrapped_key, unsigned long wrapped_key_len, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_DeriveKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t base_key, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_SeedRandom, (ck_session_handle_t session, unsigned char *seed, unsigned long seed_len)); _CK_DECLARE_FUNCTION (C_GenerateRandom, (ck_session_handle_t session, unsigned char *random_data, unsigned long random_len)); _CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session)); struct ck_function_list { struct ck_version version; CK_C_Initialize C_Initialize; CK_C_Finalize C_Finalize; CK_C_GetInfo C_GetInfo; CK_C_GetFunctionList C_GetFunctionList; CK_C_GetSlotList C_GetSlotList; CK_C_GetSlotInfo C_GetSlotInfo; CK_C_GetTokenInfo C_GetTokenInfo; CK_C_GetMechanismList C_GetMechanismList; CK_C_GetMechanismInfo C_GetMechanismInfo; CK_C_InitToken C_InitToken; CK_C_InitPIN C_InitPIN; CK_C_SetPIN C_SetPIN; CK_C_OpenSession C_OpenSession; CK_C_CloseSession C_CloseSession; CK_C_CloseAllSessions C_CloseAllSessions; CK_C_GetSessionInfo C_GetSessionInfo; CK_C_GetOperationState C_GetOperationState; CK_C_SetOperationState C_SetOperationState; CK_C_Login C_Login; CK_C_Logout C_Logout; CK_C_CreateObject C_CreateObject; CK_C_CopyObject C_CopyObject; CK_C_DestroyObject C_DestroyObject; CK_C_GetObjectSize C_GetObjectSize; CK_C_GetAttributeValue C_GetAttributeValue; CK_C_SetAttributeValue C_SetAttributeValue; CK_C_FindObjectsInit C_FindObjectsInit; CK_C_FindObjects C_FindObjects; CK_C_FindObjectsFinal C_FindObjectsFinal; CK_C_EncryptInit C_EncryptInit; CK_C_Encrypt C_Encrypt; CK_C_EncryptUpdate C_EncryptUpdate; CK_C_EncryptFinal C_EncryptFinal; CK_C_DecryptInit C_DecryptInit; CK_C_Decrypt C_Decrypt; CK_C_DecryptUpdate C_DecryptUpdate; CK_C_DecryptFinal C_DecryptFinal; CK_C_DigestInit C_DigestInit; CK_C_Digest C_Digest; CK_C_DigestUpdate C_DigestUpdate; CK_C_DigestKey C_DigestKey; CK_C_DigestFinal C_DigestFinal; CK_C_SignInit C_SignInit; CK_C_Sign C_Sign; CK_C_SignUpdate C_SignUpdate; CK_C_SignFinal C_SignFinal; CK_C_SignRecoverInit C_SignRecoverInit; CK_C_SignRecover C_SignRecover; CK_C_VerifyInit C_VerifyInit; CK_C_Verify C_Verify; CK_C_VerifyUpdate C_VerifyUpdate; CK_C_VerifyFinal C_VerifyFinal; CK_C_VerifyRecoverInit C_VerifyRecoverInit; CK_C_VerifyRecover C_VerifyRecover; CK_C_DigestEncryptUpdate C_DigestEncryptUpdate; CK_C_DecryptDigestUpdate C_DecryptDigestUpdate; CK_C_SignEncryptUpdate C_SignEncryptUpdate; CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate; CK_C_GenerateKey C_GenerateKey; CK_C_GenerateKeyPair C_GenerateKeyPair; CK_C_WrapKey C_WrapKey; CK_C_UnwrapKey C_UnwrapKey; CK_C_DeriveKey C_DeriveKey; CK_C_SeedRandom C_SeedRandom; CK_C_GenerateRandom C_GenerateRandom; CK_C_GetFunctionStatus C_GetFunctionStatus; CK_C_CancelFunction C_CancelFunction; CK_C_WaitForSlotEvent C_WaitForSlotEvent; }; typedef ck_rv_t (*ck_createmutex_t) (void **mutex); typedef ck_rv_t (*ck_destroymutex_t) (void *mutex); typedef ck_rv_t (*ck_lockmutex_t) (void *mutex); typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex); struct ck_c_initialize_args { ck_createmutex_t create_mutex; ck_destroymutex_t destroy_mutex; ck_lockmutex_t lock_mutex; ck_unlockmutex_t unlock_mutex; ck_flags_t flags; void *reserved; }; #define CKF_LIBRARY_CANT_CREATE_OS_THREADS (1 << 0) #define CKF_OS_LOCKING_OK (1 << 1) #define CKR_OK (0) #define CKR_CANCEL (1) #define CKR_HOST_MEMORY (2) #define CKR_SLOT_ID_INVALID (3) #define CKR_GENERAL_ERROR (5) #define CKR_FUNCTION_FAILED (6) #define CKR_ARGUMENTS_BAD (7) #define CKR_NO_EVENT (8) #define CKR_NEED_TO_CREATE_THREADS (9) #define CKR_CANT_LOCK (0xa) #define CKR_ATTRIBUTE_READ_ONLY (0x10) #define CKR_ATTRIBUTE_SENSITIVE (0x11) #define CKR_ATTRIBUTE_TYPE_INVALID (0x12) #define CKR_ATTRIBUTE_VALUE_INVALID (0x13) #define CKR_DATA_INVALID (0x20) #define CKR_DATA_LEN_RANGE (0x21) #define CKR_DEVICE_ERROR (0x30) #define CKR_DEVICE_MEMORY (0x31) #define CKR_DEVICE_REMOVED (0x32) #define CKR_ENCRYPTED_DATA_INVALID (0x40) #define CKR_ENCRYPTED_DATA_LEN_RANGE (0x41) #define CKR_FUNCTION_CANCELED (0x50) #define CKR_FUNCTION_NOT_PARALLEL (0x51) #define CKR_FUNCTION_NOT_SUPPORTED (0x54) #define CKR_KEY_HANDLE_INVALID (0x60) #define CKR_KEY_SIZE_RANGE (0x62) #define CKR_KEY_TYPE_INCONSISTENT (0x63) #define CKR_KEY_NOT_NEEDED (0x64) #define CKR_KEY_CHANGED (0x65) #define CKR_KEY_NEEDED (0x66) #define CKR_KEY_INDIGESTIBLE (0x67) #define CKR_KEY_FUNCTION_NOT_PERMITTED (0x68) #define CKR_KEY_NOT_WRAPPABLE (0x69) #define CKR_KEY_UNEXTRACTABLE (0x6a) #define CKR_MECHANISM_INVALID (0x70) #define CKR_MECHANISM_PARAM_INVALID (0x71) #define CKR_OBJECT_HANDLE_INVALID (0x82) #define CKR_OPERATION_ACTIVE (0x90) #define CKR_OPERATION_NOT_INITIALIZED (0x91) #define CKR_PIN_INCORRECT (0xa0) #define CKR_PIN_INVALID (0xa1) #define CKR_PIN_LEN_RANGE (0xa2) #define CKR_PIN_EXPIRED (0xa3) #define CKR_PIN_LOCKED (0xa4) #define CKR_SESSION_CLOSED (0xb0) #define CKR_SESSION_COUNT (0xb1) #define CKR_SESSION_HANDLE_INVALID (0xb3) #define CKR_SESSION_PARALLEL_NOT_SUPPORTED (0xb4) #define CKR_SESSION_READ_ONLY (0xb5) #define CKR_SESSION_EXISTS (0xb6) #define CKR_SESSION_READ_ONLY_EXISTS (0xb7) #define CKR_SESSION_READ_WRITE_SO_EXISTS (0xb8) #define CKR_SIGNATURE_INVALID (0xc0) #define CKR_SIGNATURE_LEN_RANGE (0xc1) #define CKR_TEMPLATE_INCOMPLETE (0xd0) #define CKR_TEMPLATE_INCONSISTENT (0xd1) #define CKR_TOKEN_NOT_PRESENT (0xe0) #define CKR_TOKEN_NOT_RECOGNIZED (0xe1) #define CKR_TOKEN_WRITE_PROTECTED (0xe2) #define CKR_UNWRAPPING_KEY_HANDLE_INVALID (0xf0) #define CKR_UNWRAPPING_KEY_SIZE_RANGE (0xf1) #define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT (0xf2) #define CKR_USER_ALREADY_LOGGED_IN (0x100) #define CKR_USER_NOT_LOGGED_IN (0x101) #define CKR_USER_PIN_NOT_INITIALIZED (0x102) #define CKR_USER_TYPE_INVALID (0x103) #define CKR_USER_ANOTHER_ALREADY_LOGGED_IN (0x104) #define CKR_USER_TOO_MANY_TYPES (0x105) #define CKR_WRAPPED_KEY_INVALID (0x110) #define CKR_WRAPPED_KEY_LEN_RANGE (0x112) #define CKR_WRAPPING_KEY_HANDLE_INVALID (0x113) #define CKR_WRAPPING_KEY_SIZE_RANGE (0x114) #define CKR_WRAPPING_KEY_TYPE_INCONSISTENT (0x115) #define CKR_RANDOM_SEED_NOT_SUPPORTED (0x120) #define CKR_RANDOM_NO_RNG (0x121) #define CKR_DOMAIN_PARAMS_INVALID (0x130) #define CKR_BUFFER_TOO_SMALL (0x150) #define CKR_SAVED_STATE_INVALID (0x160) #define CKR_INFORMATION_SENSITIVE (0x170) #define CKR_STATE_UNSAVEABLE (0x180) #define CKR_CRYPTOKI_NOT_INITIALIZED (0x190) #define CKR_CRYPTOKI_ALREADY_INITIALIZED (0x191) #define CKR_MUTEX_BAD (0x1a0) #define CKR_MUTEX_NOT_LOCKED (0x1a1) #define CKR_FUNCTION_REJECTED (0x200) #define CKR_VENDOR_DEFINED ((unsigned long) (1 << 31)) /* Compatibility layer. */ #ifdef CRYPTOKI_COMPAT #undef CK_DEFINE_FUNCTION #define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name /* For NULL. */ #include typedef unsigned char CK_BYTE; typedef unsigned char CK_CHAR; typedef unsigned char CK_UTF8CHAR; typedef unsigned char CK_BBOOL; typedef unsigned long int CK_ULONG; typedef long int CK_LONG; typedef CK_BYTE *CK_BYTE_PTR; typedef CK_CHAR *CK_CHAR_PTR; typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR; typedef CK_ULONG *CK_ULONG_PTR; typedef void *CK_VOID_PTR; typedef void **CK_VOID_PTR_PTR; #define CK_FALSE 0 #define CK_TRUE 1 #ifndef CK_DISABLE_TRUE_FALSE #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #endif typedef struct ck_version CK_VERSION; typedef struct ck_version *CK_VERSION_PTR; typedef struct ck_info CK_INFO; typedef struct ck_info *CK_INFO_PTR; typedef ck_slot_id_t *CK_SLOT_ID_PTR; typedef struct ck_slot_info CK_SLOT_INFO; typedef struct ck_slot_info *CK_SLOT_INFO_PTR; typedef struct ck_token_info CK_TOKEN_INFO; typedef struct ck_token_info *CK_TOKEN_INFO_PTR; typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR; typedef struct ck_session_info CK_SESSION_INFO; typedef struct ck_session_info *CK_SESSION_INFO_PTR; typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR; typedef ck_object_class_t *CK_OBJECT_CLASS_PTR; typedef struct ck_attribute CK_ATTRIBUTE; typedef struct ck_attribute *CK_ATTRIBUTE_PTR; typedef struct ck_date CK_DATE; typedef struct ck_date *CK_DATE_PTR; typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR; typedef struct ck_mechanism CK_MECHANISM; typedef struct ck_mechanism *CK_MECHANISM_PTR; typedef struct ck_mechanism_info CK_MECHANISM_INFO; typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR; typedef struct ck_function_list CK_FUNCTION_LIST; typedef struct ck_function_list *CK_FUNCTION_LIST_PTR; typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR; typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS; typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR; #define NULL_PTR NULL /* Delete the helper macros defined at the top of the file. */ #undef ck_flags_t #undef ck_version #undef ck_info #undef cryptoki_version #undef manufacturer_id #undef library_description #undef library_version #undef ck_notification_t #undef ck_slot_id_t #undef ck_slot_info #undef slot_description #undef hardware_version #undef firmware_version #undef ck_token_info #undef serial_number #undef max_session_count #undef session_count #undef max_rw_session_count #undef rw_session_count #undef max_pin_len #undef min_pin_len #undef total_public_memory #undef free_public_memory #undef total_private_memory #undef free_private_memory #undef utc_time #undef ck_session_handle_t #undef ck_user_type_t #undef ck_state_t #undef ck_session_info #undef slot_id #undef device_error #undef ck_object_handle_t #undef ck_object_class_t #undef ck_hw_feature_type_t #undef ck_key_type_t #undef ck_certificate_type_t #undef ck_attribute_type_t #undef ck_attribute #undef value #undef value_len #undef ck_date #undef ck_mechanism_type_t #undef ck_mechanism #undef parameter #undef parameter_len #undef ck_mechanism_info #undef min_key_size #undef max_key_size #undef ck_rv_t #undef ck_notify_t #undef ck_function_list #undef ck_createmutex_t #undef ck_destroymutex_t #undef ck_lockmutex_t #undef ck_unlockmutex_t #undef ck_c_initialize_args #undef create_mutex #undef destroy_mutex #undef lock_mutex #undef unlock_mutex #undef reserved #endif /* CRYPTOKI_COMPAT */ /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) #pragma pack(pop, cryptoki) #endif #if defined(__cplusplus) } #endif #endif /* PKCS11_H */ opendnssec-1.4.3/libhsm/src/lib/libhsm.c0000664000175000017500000030767012245347113015057 00000000000000/* $Id: libhsm.c 7439 2013-11-27 10:49:47Z matthijs $ */ /* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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, 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 ``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 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. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "libhsm.h" #include "libhsmdns.h" #include "compat.h" #include /*! Fixed length from PKCS#11 specification */ #define HSM_TOKEN_LABEL_LENGTH 32 /*! Global (initial) context */ hsm_ctx_t *_hsm_ctx; /*! General PKCS11 helper functions */ static char * ldns_pkcs11_rv_str(CK_RV rv) { switch (rv) { case CKR_OK: return "CKR_OK"; case CKR_CANCEL: return "CKR_CANCEL"; case CKR_HOST_MEMORY: return "CKR_HOST_MEMORY"; case CKR_GENERAL_ERROR: return "CKR_GENERAL_ERROR"; case CKR_FUNCTION_FAILED: return "CKR_FUNCTION_FAILED"; case CKR_SLOT_ID_INVALID: return "CKR_SLOT_ID_INVALID"; case CKR_ATTRIBUTE_READ_ONLY: return "CKR_ATTRIBUTE_READ_ONLY"; case CKR_ATTRIBUTE_SENSITIVE: return "CKR_ATTRIBUTE_SENSITIVE"; case CKR_ATTRIBUTE_TYPE_INVALID: return "CKR_ATTRIBUTE_TYPE_INVALID"; case CKR_ATTRIBUTE_VALUE_INVALID: return "CKR_ATTRIBUTE_VALUE_INVALID"; case CKR_DATA_INVALID: return "CKR_DATA_INVALID"; case CKR_DATA_LEN_RANGE: return "CKR_DATA_LEN_RANGE"; case CKR_DEVICE_ERROR: return "CKR_DEVICE_ERROR"; case CKR_DEVICE_MEMORY: return "CKR_DEVICE_MEMORY"; case CKR_DEVICE_REMOVED: return "CKR_DEVICE_REMOVED"; case CKR_ENCRYPTED_DATA_INVALID: return "CKR_ENCRYPTED_DATA_INVALID"; case CKR_ENCRYPTED_DATA_LEN_RANGE: return "CKR_ENCRYPTED_DATA_LEN_RANGE"; case CKR_FUNCTION_CANCELED: return "CKR_FUNCTION_CANCELED"; case CKR_FUNCTION_NOT_PARALLEL: return "CKR_FUNCTION_NOT_PARALLEL"; case CKR_FUNCTION_NOT_SUPPORTED: return "CKR_FUNCTION_NOT_SUPPORTED"; case CKR_KEY_HANDLE_INVALID: return "CKR_KEY_HANDLE_INVALID"; case CKR_KEY_SIZE_RANGE: return "CKR_KEY_SIZE_RANGE"; case CKR_KEY_TYPE_INCONSISTENT: return "CKR_KEY_TYPE_INCONSISTENT"; case CKR_MECHANISM_INVALID: return "CKR_MECHANISM_INVALID"; case CKR_MECHANISM_PARAM_INVALID: return "CKR_MECHANISM_PARAM_INVALID"; case CKR_OBJECT_HANDLE_INVALID: return "CKR_OBJECT_HANDLE_INVALID"; case CKR_OPERATION_ACTIVE: return "CKR_OPERATION_ACTIVE"; case CKR_OPERATION_NOT_INITIALIZED: return "CKR_OPERATION_NOT_INITIALIZED"; case CKR_PIN_INCORRECT: return "CKR_PIN_INCORRECT"; case CKR_PIN_INVALID: return "CKR_PIN_INVALID"; case CKR_PIN_LEN_RANGE: return "CKR_PIN_LEN_RANGE"; case CKR_SESSION_CLOSED: return "CKR_SESSION_CLOSED"; case CKR_SESSION_COUNT: return "CKR_SESSION_COUNT"; case CKR_SESSION_HANDLE_INVALID: return "CKR_SESSION_HANDLE_INVALID"; case CKR_SESSION_PARALLEL_NOT_SUPPORTED: return "CKR_SESSION_PARALLEL_NOT_SUPPORTED"; case CKR_SESSION_READ_ONLY: return "CKR_SESSION_READ_ONLY"; case CKR_SESSION_EXISTS: return "CKR_SESSION_EXISTS"; case CKR_SIGNATURE_INVALID: return "CKR_SIGNATURE_INVALID"; case CKR_SIGNATURE_LEN_RANGE: return "CKR_SIGNATURE_LEN_RANGE"; case CKR_TEMPLATE_INCOMPLETE: return "CKR_TEMPLATE_INCOMPLETE"; case CKR_TEMPLATE_INCONSISTENT: return "CKR_TEMPLATE_INCONSISTENT"; case CKR_TOKEN_NOT_PRESENT: return "CKR_TOKEN_NOT_PRESENT"; case CKR_TOKEN_NOT_RECOGNIZED: return "CKR_TOKEN_NOT_RECOGNIZED"; case CKR_TOKEN_WRITE_PROTECTED: return "CKR_TOKEN_WRITE_PROTECTED"; case CKR_UNWRAPPING_KEY_HANDLE_INVALID: return "CKR_UNWRAPPING_KEY_HANDLE_INVALID"; case CKR_UNWRAPPING_KEY_SIZE_RANGE: return "CKR_UNWRAPPING_KEY_SIZE_RANGE"; case CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT: return "CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT"; case CKR_USER_ALREADY_LOGGED_IN: return "CKR_USER_ALREADY_LOGGED_IN"; case CKR_USER_NOT_LOGGED_IN: return "CKR_USER_NOT_LOGGED_IN"; case CKR_USER_PIN_NOT_INITIALIZED: return "CKR_USER_PIN_NOT_INITIALIZED"; case CKR_USER_TYPE_INVALID: return "CKR_USER_TYPE_INVALID"; case CKR_WRAPPED_KEY_INVALID: return "CKR_WRAPPED_KEY_INVALID"; case CKR_WRAPPED_KEY_LEN_RANGE: return "CKR_WRAPPED_KEY_LEN_RANGE"; case CKR_WRAPPING_KEY_HANDLE_INVALID: return "CKR_WRAPPING_KEY_HANDLE_INVALID"; case CKR_WRAPPING_KEY_SIZE_RANGE: return "CKR_WRAPPING_KEY_SIZE_RANGE"; case CKR_WRAPPING_KEY_TYPE_INCONSISTENT: return "CKR_WRAPPING_KEY_TYPE_INCONSISTENT"; case CKR_RANDOM_SEED_NOT_SUPPORTED: return "CKR_RANDOM_SEED_NOT_SUPPORTED"; case CKR_VENDOR_DEFINED: return "CKR_VENDOR_DEFINED"; case CKR_BUFFER_TOO_SMALL: return "CKR_BUFFER_TOO_SMALL"; case CKR_SAVED_STATE_INVALID: return "CKR_SAVED_STATE_INVALID"; case CKR_INFORMATION_SENSITIVE: return "CKR_INFORMATION_SENSITIVE"; case CKR_STATE_UNSAVEABLE: return "CKR_STATE_UNSAVEABLE"; case CKR_CRYPTOKI_NOT_INITIALIZED: return "CKR_CRYPTOKI_NOT_INITIALIZED"; case CKR_CRYPTOKI_ALREADY_INITIALIZED: return "CKR_CRYPTOKI_ALREADY_INITIALIZED"; case CKR_MUTEX_BAD: return "CKR_MUTEX_BAD"; case CKR_MUTEX_NOT_LOCKED: return "CKR_MUTEX_NOT_LOCKED"; default: return "Unknown error"; } } /*! Set HSM Context Error If the ctx is given, and it's error value is still 0, the value will be set to 'error', and the error_message and error_action will be set to the given strings. \param ctx HSM context \param error error code \param action action for which the error occured \param message error message format string */ void hsm_ctx_set_error(hsm_ctx_t *ctx, int error, const char *action, const char *message, ...) { va_list args; if (ctx && ctx->error == 0) { ctx->error = error; ctx->error_action = action; va_start(args, message); vsnprintf(ctx->error_message, sizeof(ctx->error_message), message, args); va_end(args); } } /*! Check HSM Context for Error If the rv is not CKR_OK, and there is not previous error registered in the context, to set the context error based on PKCS#11 return value. \param ctx HSM context \param rv PKCS#11 return value \param action action for which the error occured \param message error message format string \return 0 if rv == CKR_OK, otherwise 1 */ static int hsm_pkcs11_check_error(hsm_ctx_t *ctx, CK_RV rv, const char *action) { if (rv != CKR_OK) { if (ctx && ctx->error == 0) { ctx->error = (int) rv; ctx->error_action = action; strlcpy(ctx->error_message, ldns_pkcs11_rv_str(rv), sizeof(ctx->error_message)); } return 1; } return 0; } /*! Unload PKCS#11 provider */ static void hsm_pkcs11_unload_functions(void *handle) { int result; if (handle) { #if defined(HAVE_LOADLIBRARY) /* no idea */ #elif defined(HAVE_DLOPEN) result = dlclose(handle); #endif } } /*! Load PKCS#11 provider */ static CK_RV hsm_pkcs11_load_functions(hsm_module_t *module) { CK_C_GetFunctionList pGetFunctionList = NULL; if (module && module->path) { /* library provided by application or user */ #if defined(HAVE_LOADLIBRARY) /* Load PKCS #11 library */ HINSTANCE hDLL = LoadLibrary(_T(module->path)); if (hDLL == NULL) { /* Failed to load the PKCS #11 library */ return CKR_FUNCTION_FAILED; } /* Retrieve the entry point for C_GetFunctionList */ pGetFunctionList = (CK_C_GetFunctionList) GetProcAddress(hDLL, _T("C_GetFunctionList")); #elif defined(HAVE_DLOPEN) /* Load PKCS #11 library */ void* pDynLib = dlopen(module->path, RTLD_NOW | RTLD_LOCAL); if (pDynLib == NULL) { /* Failed to load the PKCS #11 library */ return CKR_FUNCTION_FAILED; } /* Retrieve the entry point for C_GetFunctionList */ pGetFunctionList = (CK_C_GetFunctionList) dlsym(pDynLib, "C_GetFunctionList"); /* Store the handle so we can dlclose it later */ module->handle = pDynLib; #else return CKR_FUNCTION_FAILED; #endif } else { /* No library provided, use the statically compiled softHSM */ #ifdef HAVE_PKCS11_MODULE return C_GetFunctionList(pkcs11_functions); #else return CKR_FUNCTION_FAILED; #endif } if (pGetFunctionList == NULL) { /* Failed to load the PKCS #11 library */ return CKR_FUNCTION_FAILED; } /* Retrieve the function list */ (pGetFunctionList)((CK_FUNCTION_LIST_PTR_PTR)(&module->sym)); return CKR_OK; } static void hsm_remove_leading_zeroes(CK_BYTE_PTR data, CK_ULONG *len) { CK_BYTE_PTR p = data; CK_ULONG l; if (data == NULL || len == NULL) return; l = *len; while ((unsigned short int)(*p) == 0 && l > 1) { p++; l--; } if (p != data) { memmove(data, p, l); *len = l; } } static int hsm_pkcs11_check_token_name(hsm_ctx_t *ctx, CK_FUNCTION_LIST_PTR pkcs11_functions, CK_SLOT_ID slotId, const char *token_name) { /* token label is always 32 bytes */ char token_name_bytes[HSM_TOKEN_LABEL_LENGTH]; int result = 0; CK_RV rv; CK_TOKEN_INFO token_info; rv = pkcs11_functions->C_GetTokenInfo(slotId, &token_info); if (hsm_pkcs11_check_error(ctx, rv, "C_GetTokenInfo")) { return 0; } memset(token_name_bytes, ' ', HSM_TOKEN_LABEL_LENGTH); if (strlen(token_name) < HSM_TOKEN_LABEL_LENGTH) { memcpy(token_name_bytes, token_name, strlen(token_name)); } else { memcpy(token_name_bytes, token_name, HSM_TOKEN_LABEL_LENGTH); } result = memcmp(token_info.label, token_name_bytes, HSM_TOKEN_LABEL_LENGTH) == 0; return result; } int hsm_get_slot_id(hsm_ctx_t *ctx, CK_FUNCTION_LIST_PTR pkcs11_functions, const char *token_name, CK_SLOT_ID *slotId) { CK_RV rv; CK_ULONG slotCount; CK_SLOT_ID cur_slot; CK_SLOT_ID *slotIds; int found = 0; if (token_name == NULL || slotId == NULL) return HSM_ERROR; rv = pkcs11_functions->C_GetSlotList(CK_TRUE, NULL_PTR, &slotCount); if (hsm_pkcs11_check_error(ctx, rv, "get slot list")) { return HSM_ERROR; } if (slotCount < 1) { hsm_ctx_set_error(ctx, HSM_ERROR, "hsm_get_slot_id()", "No slots found in HSM"); return HSM_ERROR; } slotIds = malloc(sizeof(CK_SLOT_ID) * slotCount); rv = pkcs11_functions->C_GetSlotList(CK_TRUE, slotIds, &slotCount); if (hsm_pkcs11_check_error(ctx, rv, "get slot list")) { return HSM_ERROR; } for (cur_slot = 0; cur_slot < slotCount; cur_slot++) { if (hsm_pkcs11_check_token_name(ctx, pkcs11_functions, slotIds[cur_slot], token_name)) { *slotId = slotIds[cur_slot]; found = 1; break; } } free(slotIds); if (!found) { hsm_ctx_set_error(ctx, -1, "hsm_get_slot_id()", "could not find token with the name %s", token_name); return HSM_ERROR; } return HSM_OK; } /* internal functions */ static hsm_module_t * hsm_module_new(const char *repository, const char *token_label, const char *path, const hsm_config_t *config) { hsm_module_t *module; if (!repository || !path) return NULL; module = malloc(sizeof(hsm_module_t)); if (!module) return NULL; if (config) { module->config = malloc(sizeof(hsm_config_t)); if (!module->config) { free(module); return NULL; } memcpy(module->config, config, sizeof(hsm_config_t)); } else { module->config = NULL; } module->id = 0; /*TODO i think we can remove this*/ module->name = strdup(repository); module->token_label = strdup(token_label); module->path = strdup(path); module->handle = NULL; module->sym = NULL; return module; } static void hsm_module_free(hsm_module_t *module) { if (module) { if (module->name) free(module->name); if (module->token_label) free(module->token_label); if (module->path) free(module->path); if (module->config) free(module->config); free(module); } } static hsm_session_t * hsm_session_new(hsm_module_t *module, CK_SESSION_HANDLE session_handle) { hsm_session_t *session; session = malloc(sizeof(hsm_session_t)); session->module = module; session->session = session_handle; return session; } static void hsm_session_free(hsm_session_t *session) { if (session) { free(session); } } /*! Set default HSM configuration */ static void hsm_config_default(hsm_config_t *config) { config->use_pubkey = 1; } /* creates a session_t structure, and automatically adds and initializes * a module_t struct for it */ static int hsm_session_init(hsm_ctx_t *ctx, hsm_session_t **session, const char *repository, const char *token_label, const char *module_path, const char *pin, const hsm_config_t *config) { CK_RV rv; CK_RV rv_login; hsm_module_t *module; CK_SLOT_ID slot_id; CK_SESSION_HANDLE session_handle; int first = 1, result; CK_C_INITIALIZE_ARGS InitArgs = {NULL, NULL, NULL, NULL, CKF_OS_LOCKING_OK, NULL }; if (pin == NULL) return HSM_ERROR; module = hsm_module_new(repository, token_label, module_path, config); if (!module) return HSM_ERROR; rv = hsm_pkcs11_load_functions(module); if (rv != CKR_OK) { hsm_ctx_set_error(ctx, HSM_MODULE_NOT_FOUND, "hsm_session_init()", "PKCS#11 module load failed: %s", module_path); hsm_module_free(module); return HSM_MODULE_NOT_FOUND; } rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Initialize((CK_VOID_PTR) &InitArgs); /* ALREADY_INITIALIZED is ok, apparently we are using a second * device with the same library */ if (rv != CKR_CRYPTOKI_ALREADY_INITIALIZED) { if (hsm_pkcs11_check_error(ctx, rv, "Initialization")) { hsm_module_free(module); return HSM_ERROR; } } else { first = 0; } result = hsm_get_slot_id(ctx, module->sym, token_label, &slot_id); if (result != HSM_OK) { hsm_module_free(module); return HSM_ERROR; } rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_OpenSession(slot_id, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_handle); if (hsm_pkcs11_check_error(ctx, rv, "Open first session")) { hsm_module_free(module); return HSM_ERROR; } rv_login = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Login(session_handle, CKU_USER, (unsigned char *) pin, strlen((char *)pin)); if (rv_login == CKR_OK) { *session = hsm_session_new(module, session_handle); return HSM_OK; } else { /* uninitialize the session again */ if (session_handle) { rv = ((CK_FUNCTION_LIST_PTR) module->sym)-> C_CloseSession(session_handle); if (hsm_pkcs11_check_error(ctx, rv, "finalize after failed login")) { hsm_module_free(module); return HSM_ERROR; } } /* if this was not the first, don't close the library for * the rest of us */ if (first) { rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Finalize(NULL); if (hsm_pkcs11_check_error(ctx, rv, "finalize after failed login")) { hsm_module_free(module); return HSM_ERROR; } } hsm_module_free(module); *session = NULL; switch(rv_login) { case CKR_PIN_INCORRECT: hsm_ctx_set_error(ctx, HSM_PIN_INCORRECT, "hsm_session_init()", "Incorrect PIN for repository %s", repository); return HSM_PIN_INCORRECT; default: return HSM_ERROR; } } } /* open a second session from the given one */ static hsm_session_t * hsm_session_clone(hsm_ctx_t *ctx, hsm_session_t *session) { CK_RV rv; CK_SLOT_ID slot_id; CK_SESSION_HANDLE session_handle; hsm_session_t *new_session; int result; result = hsm_get_slot_id(ctx, session->module->sym, session->module->token_label, &slot_id); if (result != HSM_OK) return NULL; rv = ((CK_FUNCTION_LIST_PTR) session->module->sym)->C_OpenSession(slot_id, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_handle); if (hsm_pkcs11_check_error(ctx, rv, "Clone session")) { return NULL; } new_session = hsm_session_new(session->module, session_handle); return new_session; } static hsm_ctx_t * hsm_ctx_new() { hsm_ctx_t *ctx; ctx = malloc(sizeof(hsm_ctx_t)); memset(ctx->session, 0, HSM_MAX_SESSIONS); ctx->session_count = 0; ctx->error = 0; return ctx; } /* ctx_free frees the structure */ static void hsm_ctx_free(hsm_ctx_t *ctx) { unsigned int i; if (ctx) { for (i = 0; i < ctx->session_count; i++) { hsm_session_free(ctx->session[i]); } free(ctx); } } /* close the session, and free the allocated data * * if unload is non-zero, C_Logout() is called, * the dlopen()d module is closed and unloaded * (only call this on the last session for each * module, ie. the one in the global ctx) */ static void hsm_session_close(hsm_ctx_t *ctx, hsm_session_t *session, int unload) { /* If we loaded this library more than once, we may have * already finalized it before, so we can safely ignore * NOT_INITIALIZED */ CK_RV rv; if (unload) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Logout(session->session); if (rv != CKR_CRYPTOKI_NOT_INITIALIZED) { (void) hsm_pkcs11_check_error(ctx, rv, "Logout"); } } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_CloseSession(session->session); if (rv != CKR_CRYPTOKI_NOT_INITIALIZED) { (void) hsm_pkcs11_check_error(ctx, rv, "Close session"); } if (unload) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Finalize(NULL); if (rv != CKR_CRYPTOKI_NOT_INITIALIZED) { (void) hsm_pkcs11_check_error(ctx, rv, "Finalize"); hsm_pkcs11_unload_functions(session->module->handle); } hsm_module_free(session->module); session->module = NULL; } hsm_session_free(session); } /* ctx_close closes all session, and free * the structures. * * if unload is non-zero, the associated dynamic libraries are unloaded * (hence only use that on the last, global, ctx) */ static void hsm_ctx_close(hsm_ctx_t *ctx, int unload) { unsigned int i; if (ctx) { for (i = 0; i < ctx->session_count; i++) { /* todo syslog? */ /*printf("close session %u (unload: %d)\n", i, unload);*/ /*hsm_print_ctx(ctx);*/ hsm_session_close(ctx, ctx->session[i], unload); ctx->session[i] = NULL; /* if this was the last session in the array, decrease * the session counter of the context */ if (i == _hsm_ctx->session_count) { while(ctx->session_count > 0 && !ctx->session[i]) { ctx->session_count--; } } } free(ctx); } } /* adds a session to the context. * returns 0 on success * 1 if the maximum number of sessions (HSM_MAX_SESSIONS) was * reached * -1 if one of the arguments is NULL */ static int hsm_ctx_add_session(hsm_ctx_t *ctx, hsm_session_t *session) { if (!ctx || !session) return -1; if (ctx->session_count >= HSM_MAX_SESSIONS) return 1; ctx->session[ctx->session_count] = session; ctx->session_count++; return 0; } static hsm_ctx_t * hsm_ctx_clone(hsm_ctx_t *ctx) { unsigned int i; hsm_ctx_t *new_ctx; hsm_session_t *new_session; new_ctx = NULL; if (ctx) { new_ctx = hsm_ctx_new(); for (i = 0; i < ctx->session_count; i++) { new_session = hsm_session_clone(ctx, ctx->session[i]); if (!new_session) { /* one of the sessions failed to clone. Clear the * new ctx and return NULL */ hsm_ctx_close(new_ctx, 0); return NULL; } hsm_ctx_add_session(new_ctx, new_session); } } return new_ctx; } static hsm_key_t * hsm_key_new() { hsm_key_t *key; key = malloc(sizeof(hsm_key_t)); key->module = NULL; key->private_key = 0; key->public_key = 0; return key; } /* find the session belonging to a key, by iterating over the modules * in the context */ static hsm_session_t * hsm_find_key_session(hsm_ctx_t *ctx, const hsm_key_t *key) { unsigned int i; if (!key || !key->module) return NULL; if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i] && ctx->session[i]->module == key->module) { return ctx->session[i]; } } return NULL; } /* Returns the key type (algorithm) of the given key */ static CK_KEY_TYPE hsm_get_key_algorithm(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_KEY_TYPE key_type; CK_ATTRIBUTE template[] = { {CKA_KEY_TYPE, &key_type, sizeof(CK_KEY_TYPE)} }; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value algorithm type")) { /* this is actually not a good return value; * CKK_RSA is also 0. But we can't return a negative * value. Should we #define a specific 'key type' that * indicates an error? (TODO) */ return 0; } if ((CK_LONG)template[0].ulValueLen < 1) { /* this is actually not a good return value; * CKK_RSA is also 0. But we can't return a negative * value. Should we #define a specific 'key type' that * indicates an error? (TODO) */ return 0; } return key_type; } /* returns a CK_ULONG with the key size of the given RSA key. The * key is not checked for type. For RSA, the number of bits in the * modulus is the key size (CKA_MODULUS_BITS) */ static CK_ULONG hsm_get_key_size_rsa(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_ULONG modulus_bits; /* Template for public keys */ CK_ATTRIBUTE template[] = { {CKA_MODULUS_BITS, &modulus_bits, sizeof(CK_KEY_TYPE)} }; /* Template for private keys */ CK_BYTE_PTR modulus = NULL; int mask; CK_ATTRIBUTE template2[] = { {CKA_MODULUS, NULL, 0} }; if (session->module->config->use_pubkey) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value algorithm type")) { return 0; } if ((CK_ULONG)template[0].ulValueLen < 1) { return 0; } } else { // Get buffer size rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template2, 1); if (hsm_pkcs11_check_error(ctx, rv, "Could not get the size of the modulus of the private key")) { return 0; } // Allocate memory modulus = (CK_BYTE_PTR)malloc(template2[0].ulValueLen); template2[0].pValue = modulus; if (modulus == NULL) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_size_rsa()", "Error allocating memory for modulus"); return 0; } // Get attribute rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template2, 1); if (hsm_pkcs11_check_error(ctx, rv, "Could not get the modulus of the private key")) { free(modulus); return 0; } // Calculate size modulus_bits = template2[0].ulValueLen * 8; mask = 0x80; for (int i = 0; modulus_bits && (modulus[i] & mask) == 0; modulus_bits--) { mask >>= 1; if (mask == 0) { i++; mask = 0x80; } } free(modulus); } return modulus_bits; } /* returns a CK_ULONG with the key size of the given DSA key. The * key is not checked for type. For DSA, the number of bits in the * prime is the key size (CKA_PRIME) */ static CK_ULONG hsm_get_key_size_dsa(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; /* Template */ CK_ATTRIBUTE template2[] = { {CKA_PRIME, NULL, 0} }; // Get buffer size rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template2, 1); if (hsm_pkcs11_check_error(ctx, rv, "Could not get the size of the prime of the private key")) { return 0; } return template2[0].ulValueLen * 8; } /* Wrapper for specific key size functions */ static CK_ULONG hsm_get_key_size(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key, const unsigned long algorithm) { /* TODO: Add ECDSA */ switch (algorithm) { case CKK_RSA: return hsm_get_key_size_rsa(ctx, session, key); break; case CKK_DSA: return hsm_get_key_size_dsa(ctx, session, key); break; case CKK_GOSTR3410: /* GOST public keys always have a size of 512 bits */ return 512; break; default: return 0; } } static CK_OBJECT_HANDLE hsm_find_object_handle_for_id(hsm_ctx_t *ctx, const hsm_session_t *session, CK_OBJECT_CLASS key_class, CK_BYTE *id, CK_ULONG id_len) { CK_ULONG objectCount; CK_OBJECT_HANDLE object; CK_RV rv; CK_ATTRIBUTE template[] = { { CKA_CLASS, &key_class, sizeof(key_class) }, { CKA_ID, id, id_len }, }; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsInit(session->session, template, 2); if (hsm_pkcs11_check_error(ctx, rv, "Find objects init")) { return 0; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjects(session->session, &object, 1, &objectCount); if (hsm_pkcs11_check_error(ctx, rv, "Find object")) { return 0; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsFinal(session->session); if (hsm_pkcs11_check_error(ctx, rv, "Find object final")) { return 0; } if (objectCount > 0) { return object; } else { return 0; } } /* * Parses the null-terminated string hex as hex values, * Returns allocated data that needs to be freed (or NULL on error) * len will contain the number of bytes allocated, or 0 on error */ static unsigned char * hsm_hex_parse(const char *hex, size_t *len) { unsigned char *bytes; /* length of the hex input */ size_t hex_len; size_t i; if (!len) return NULL; *len = 0; if (!hex) return NULL; hex_len = strlen(hex); if (hex_len % 2 != 0) { return NULL; } *len = hex_len / 2; bytes = malloc(*len); for (i = 0; i < *len; i++) { bytes[i] = ldns_hexdigit_to_int(hex[2*i]) * 16 + ldns_hexdigit_to_int(hex[2*i+1]); } return bytes; } /* put a hexadecimal representation of the data from src into dst * len is the number of bytes to read from src * dst must have allocated enough space (len*2 + 1) */ static void hsm_hex_unparse(char *dst, const unsigned char *src, size_t len) { size_t dst_len = len*2 + 1; size_t i; for (i = 0; i < len; i++) { snprintf(dst + (2*i), dst_len, "%02x", src[i]); } dst[len*2] = '\0'; } /* returns an allocated byte array with the CKA_ID for the given object * len will contain the result size * returns NULL and size zero if not found in this session */ static CK_BYTE * hsm_get_id_for_object(hsm_ctx_t *ctx, const hsm_session_t *session, CK_OBJECT_HANDLE object, size_t *len) { CK_RV rv; CK_BYTE *id = NULL; CK_ATTRIBUTE template[] = { {CKA_ID, id, 0} }; /* find out the size of the id first */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, object, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value")) { *len = 0; return NULL; } if ((CK_LONG)template[0].ulValueLen < 1) { /* No CKA_ID found, return NULL */ *len = 0; return NULL; } template[0].pValue = malloc(template[0].ulValueLen); rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, object, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value 2")) { *len = 0; free(template[0].pValue); return NULL; } *len = template[0].ulValueLen; return template[0].pValue; } /* returns an hsm_key_t object for the given *private key* object handle * the module, private key, and public key handle are set * The session needs to be free to perform a search for the public key */ static hsm_key_t * hsm_key_new_privkey_object_handle(hsm_ctx_t *ctx, const hsm_session_t *session, CK_OBJECT_HANDLE object) { hsm_key_t *key; CK_BYTE *id; size_t len; id = hsm_get_id_for_object(ctx, session, object, &len); if (!id) return NULL; key = hsm_key_new(); key->module = session->module; key->private_key = object; if (session->module->config->use_pubkey) { key->public_key = hsm_find_object_handle_for_id( ctx, session, CKO_PUBLIC_KEY, id, len); } else { key->public_key = 0; } free(id); return key; } /* helper function to find both key counts or the keys themselves * if the argument store is 0, results are not returned; the * function will only set the count and return NULL * Otherwise, a newly allocated key array will be returned * (on error, the count will also be zero and NULL returned) */ static hsm_key_t ** hsm_list_keys_session_internal(hsm_ctx_t *ctx, const hsm_session_t *session, size_t *count, int store) { hsm_key_t **keys = NULL; hsm_key_t *key; CK_RV rv; CK_OBJECT_CLASS key_class = CKO_PRIVATE_KEY; CK_ATTRIBUTE template[] = { { CKA_CLASS, &key_class, sizeof(key_class) }, }; CK_ULONG total_count = 0; CK_ULONG objectCount = 1; /* find 100 keys at a time (and loop until there are none left) */ CK_ULONG max_object_count = 100; CK_ULONG i, j; CK_OBJECT_HANDLE object[max_object_count]; CK_OBJECT_HANDLE *key_handles = NULL; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsInit(session->session, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Find objects init")) { *count = 0; return NULL; } j = 0; while (objectCount > 0) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjects(session->session, object, max_object_count, &objectCount); if (hsm_pkcs11_check_error(ctx, rv, "Find first object")) { free(key_handles); *count = 0; return NULL; } total_count += objectCount; if (objectCount > 0 && store) { key_handles = realloc(key_handles, total_count * sizeof(CK_OBJECT_HANDLE)); for (i = 0; i < objectCount; i++) { key_handles[j] = object[i]; j++; } } } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsFinal(session->session); if (hsm_pkcs11_check_error(ctx, rv, "Find objects final")) { free(key_handles); *count = 0; return NULL; } if (store) { keys = realloc(keys, total_count * sizeof(hsm_key_t *)); for (i = 0; i < total_count; i++) { key = hsm_key_new_privkey_object_handle(ctx, session, key_handles[i]); /* todo, if we get NULL, free all and return error? */ keys[i] = key; } } free(key_handles); *count = total_count; return keys; } /* returns an array of all keys available to the given session * * \param session the session to find the keys in * \param count this value will contain the number of keys found * * \return the list of keys */ hsm_key_t ** hsm_list_keys_session(hsm_ctx_t *ctx, const hsm_session_t *session, size_t *count) { return hsm_list_keys_session_internal(ctx, session, count, 1); } /* returns a count all keys available to the given session * * \param session the session to find the keys in * * \return the number of keys */ size_t hsm_count_keys_session(hsm_ctx_t *ctx, const hsm_session_t *session) { size_t count = 0; (void) hsm_list_keys_session_internal(ctx, session, &count, 0); return count; } /* returns a newly allocated key structure containing the key data * for the given CKA_ID available in the session. Returns NULL if not * found */ static hsm_key_t * hsm_find_key_by_id_session(hsm_ctx_t *ctx, const hsm_session_t *session, const unsigned char *id, size_t len) { hsm_key_t *key; CK_OBJECT_HANDLE private_key_handle; private_key_handle = hsm_find_object_handle_for_id( ctx, session, CKO_PRIVATE_KEY, (CK_BYTE *) id, (CK_ULONG) len); if (private_key_handle != 0) { key = hsm_key_new_privkey_object_handle(ctx, session, private_key_handle); return key; } else { return NULL; } } /* Find a key pair by CKA_ID (as byte array) The returned key structure can be freed with hsm_key_free() \param context HSM context \param id CKA_ID of key to find (array of bytes) \param len number of bytes in the id \return key identifier or NULL if not found */ static hsm_key_t * hsm_find_key_by_id_bin(hsm_ctx_t *ctx, const unsigned char *id, size_t len) { hsm_key_t *key; unsigned int i; if (!ctx) ctx = _hsm_ctx; if (!id) return NULL; for (i = 0; i < ctx->session_count; i++) { key = hsm_find_key_by_id_session(ctx, ctx->session[i], id, len); if (key) return key; } return NULL; } /** * returns the first session found if repository is null, otherwise * finds the session belonging to the repository with the given name * returns NULL if not found */ static hsm_session_t * hsm_find_repository_session(hsm_ctx_t *ctx, const char *repository) { unsigned int i; if (!repository) { for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i]) { return ctx->session[i]; } } } else { for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i] && strcmp(repository, ctx->session[i]->module->name) == 0) { return ctx->session[i]; } } } hsm_ctx_set_error(ctx, HSM_REPOSITORY_NOT_FOUND, "hsm_find_repository_session()", "Can't find repository: %s", repository); return NULL; } static ldns_rdf * hsm_get_key_rdata_rsa(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_BYTE_PTR public_exponent = NULL; CK_ULONG public_exponent_len = 0; CK_BYTE_PTR modulus = NULL; CK_ULONG modulus_len = 0; unsigned long hKey = 0; unsigned char *data = NULL; size_t data_size = 0; CK_ATTRIBUTE template[] = { {CKA_PUBLIC_EXPONENT, NULL, 0}, {CKA_MODULUS, NULL, 0}, }; ldns_rdf *rdf; if (!session || !session->module) { return NULL; } if (session->module->config->use_pubkey) { hKey = key->public_key; } else { hKey = key->private_key; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, hKey, template, 2); if (hsm_pkcs11_check_error(ctx, rv, "C_GetAttributeValue")) { return NULL; } public_exponent_len = template[0].ulValueLen; modulus_len = template[1].ulValueLen; public_exponent = template[0].pValue = malloc(public_exponent_len); if (!public_exponent) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for public exponent"); return NULL; } modulus = template[1].pValue = malloc(modulus_len); if (!modulus) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for modulus"); free(public_exponent); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, hKey, template, 2); if (hsm_pkcs11_check_error(ctx, rv, "get attribute value")) { free(template[0].pValue); free(template[1].pValue); return NULL; } // Remove leading zeroes hsm_remove_leading_zeroes(public_exponent, &public_exponent_len); hsm_remove_leading_zeroes(modulus, &modulus_len); data_size = public_exponent_len + modulus_len + 1; if (public_exponent_len <= 256) { data = malloc(data_size); if (!data) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for pub key rr data"); free(public_exponent); free(modulus); return NULL; } data[0] = public_exponent_len; memcpy(&data[1], public_exponent, public_exponent_len); memcpy(&data[1 + public_exponent_len], modulus, modulus_len); } else if (public_exponent_len <= 65535) { data_size += 2; data = malloc(data_size); if (!data) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for pub key rr data"); free(public_exponent); free(modulus); return NULL; } data[0] = 0; ldns_write_uint16(&data[1], (uint16_t) public_exponent_len); memcpy(&data[3], public_exponent, public_exponent_len); memcpy(&data[3 + public_exponent_len], modulus, modulus_len); } else { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Public exponent too big"); free(public_exponent); free(modulus); return NULL; } rdf = ldns_rdf_new(LDNS_RDF_TYPE_B64, data_size, data); free(public_exponent); free(modulus); return rdf; } static ldns_rdf * hsm_get_key_rdata_dsa(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_BYTE_PTR prime = NULL; CK_ULONG prime_len = 0; CK_BYTE_PTR subprime = NULL; CK_ULONG subprime_len = 0; CK_BYTE_PTR base = NULL; CK_ULONG base_len = 0; CK_BYTE_PTR value = NULL; CK_ULONG value_len = 0; unsigned char *data = NULL; size_t data_size = 0; CK_ATTRIBUTE template[] = { {CKA_PRIME, NULL, 0}, {CKA_SUBPRIME, NULL, 0}, {CKA_BASE, NULL, 0}, {CKA_VALUE, NULL, 0}, }; ldns_rdf *rdf; if (!session || !session->module) { return NULL; } /* DSA needs the public key compared with RSA */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 4); if (hsm_pkcs11_check_error(ctx, rv, "C_GetAttributeValue")) { return NULL; } prime_len = template[0].ulValueLen; subprime_len = template[1].ulValueLen; base_len = template[2].ulValueLen; value_len = template[3].ulValueLen; prime = template[0].pValue = malloc(prime_len); if (!prime) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for prime"); return NULL; } subprime = template[1].pValue = malloc(subprime_len); if (!subprime) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for subprime"); free(prime); return NULL; } base = template[2].pValue = malloc(base_len); if (!base) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for base"); free(prime); free(subprime); return NULL; } value = template[3].pValue = malloc(value_len); if (!value) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for value"); free(prime); free(subprime); free(base); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 4); if (hsm_pkcs11_check_error(ctx, rv, "get attribute value")) { free(prime); free(subprime); free(base); free(value); return NULL; } data_size = prime_len + subprime_len + base_len + value_len + 1; data = malloc(data_size); if (!data) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for pub key rr data"); free(prime); free(subprime); free(base); free(value); return NULL; } data[0] = (prime_len - 64) / 8; memcpy(&data[1], subprime, subprime_len); memcpy(&data[1 + subprime_len], prime, prime_len); memcpy(&data[1 + subprime_len + prime_len], base, base_len); memcpy(&data[1 + subprime_len + prime_len + base_len], value, value_len); rdf = ldns_rdf_new(LDNS_RDF_TYPE_B64, data_size, data); free(prime); free(subprime); free(base); free(value); return rdf; } static ldns_rdf * hsm_get_key_rdata_gost(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_BYTE_PTR value = NULL; CK_ULONG value_len = 0; CK_ATTRIBUTE template[] = { {CKA_VALUE, NULL, 0}, }; ldns_rdf *rdf; if (!session || !session->module) { return NULL; } /* GOST needs the public key compared with RSA */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "C_GetAttributeValue")) { return NULL; } value_len = template[0].ulValueLen; value = template[0].pValue = malloc(value_len); if (!value) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for value"); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "get attribute value")) { free(value); return NULL; } rdf = ldns_rdf_new(LDNS_RDF_TYPE_B64, value_len, value); return rdf; } static ldns_rdf * hsm_get_key_rdata(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { /* TODO: Add ECDSA */ switch (hsm_get_key_algorithm(ctx, session, key)) { case CKK_RSA: return hsm_get_key_rdata_rsa(ctx, session, key); break; case CKK_DSA: return hsm_get_key_rdata_dsa(ctx, session, key); break; case CKK_GOSTR3410: return hsm_get_key_rdata_gost(ctx, session, key); break; default: return 0; } } /* this function allocates memory for the mechanism ID and enough room * to leave the upcoming digest data. It fills in the mechanism id * use with care. The returned data must be free'd by the caller. * Only used by RSA PKCS. */ static CK_BYTE * hsm_create_prefix(CK_ULONG digest_len, ldns_algorithm algorithm, CK_ULONG *data_size) { CK_BYTE *data; const CK_BYTE RSA_MD5_ID[] = { 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 }; const CK_BYTE RSA_SHA1_ID[] = { 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14 }; const CK_BYTE RSA_SHA256_ID[] = { 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 }; const CK_BYTE RSA_SHA512_ID[] = { 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 }; switch(algorithm) { case LDNS_SIGN_RSAMD5: *data_size = sizeof(RSA_MD5_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_MD5_ID, sizeof(RSA_MD5_ID)); break; case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: *data_size = sizeof(RSA_SHA1_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_SHA1_ID, sizeof(RSA_SHA1_ID)); break; case LDNS_SIGN_RSASHA256: *data_size = sizeof(RSA_SHA256_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_SHA256_ID, sizeof(RSA_SHA256_ID)); break; case LDNS_SIGN_RSASHA512: *data_size = sizeof(RSA_SHA512_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_SHA512_ID, sizeof(RSA_SHA512_ID)); break; case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: case LDNS_SIGN_ECC_GOST: #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #endif *data_size = digest_len; data = malloc(*data_size); break; default: return NULL; } return data; } static CK_BYTE * hsm_digest_through_hsm(hsm_ctx_t *ctx, hsm_session_t *session, CK_MECHANISM_TYPE mechanism_type, CK_ULONG digest_len, ldns_buffer *sign_buf) { CK_MECHANISM digest_mechanism; CK_BYTE *digest; CK_RV rv; digest_mechanism.pParameter = NULL; digest_mechanism.ulParameterLen = 0; digest_mechanism.mechanism = mechanism_type; digest = malloc(digest_len); rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DigestInit(session->session, &digest_mechanism); if (hsm_pkcs11_check_error(ctx, rv, "HSM digest init")) { free(digest); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Digest(session->session, ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest, &digest_len); if (hsm_pkcs11_check_error(ctx, rv, "HSM digest")) { free(digest); return NULL; } return digest; } static ldns_rdf * hsm_sign_buffer(hsm_ctx_t *ctx, ldns_buffer *sign_buf, const hsm_key_t *key, ldns_algorithm algorithm) { CK_RV rv; CK_ULONG signatureLen = HSM_MAX_SIGNATURE_LENGTH; CK_BYTE signature[HSM_MAX_SIGNATURE_LENGTH]; CK_MECHANISM sign_mechanism; ldns_rdf *sig_rdf; CK_BYTE *digest = NULL; CK_ULONG digest_len; CK_BYTE *data = NULL; CK_ULONG data_len = 0; hsm_session_t *session; session = hsm_find_key_session(ctx, key); if (!session) return NULL; /* some HSMs don't really handle CKM_SHA1_RSA_PKCS well, so * we'll do the hashing manually */ /* When adding algorithms, remember there is another switch below */ switch (algorithm) { case LDNS_SIGN_RSAMD5: digest_len = 16; digest = hsm_digest_through_hsm(ctx, session, CKM_MD5, digest_len, sign_buf); break; case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: digest_len = LDNS_SHA1_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha1(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; case LDNS_SIGN_RSASHA256: #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: #endif digest_len = LDNS_SHA256_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha256(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP384SHA384: digest_len = LDNS_SHA384_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha384(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; #endif case LDNS_SIGN_RSASHA512: digest_len = LDNS_SHA512_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha512(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; case LDNS_SIGN_ECC_GOST: digest_len = 16; digest = hsm_digest_through_hsm(ctx, session, CKM_GOSTR3411, digest_len, sign_buf); break; default: /* log error? or should we not even get here for * unsupported algorithms? */ return NULL; } if (!digest) { return NULL; } /* CKM_RSA_PKCS does the padding, but cannot know the identifier * prefix, so we need to add that ourselves. * The other algorithms will just get the digest buffer returned. */ data = hsm_create_prefix(digest_len, algorithm, &data_len); memcpy(data + data_len - digest_len, digest, digest_len); sign_mechanism.pParameter = NULL; sign_mechanism.ulParameterLen = 0; switch(algorithm) { case LDNS_SIGN_RSAMD5: case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_RSASHA256: case LDNS_SIGN_RSASHA512: sign_mechanism.mechanism = CKM_RSA_PKCS; break; case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: sign_mechanism.mechanism = CKM_DSA; break; case LDNS_SIGN_ECC_GOST: sign_mechanism.mechanism = CKM_GOSTR3410; break; #if LDNS_BUILD_CONFIG_USE_ECDSA /* TODO: Add ECDSA */ case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #endif default: /* log error? or should we not even get here for * unsupported algorithms? */ free(data); free(digest); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_SignInit( session->session, &sign_mechanism, key->private_key); if (hsm_pkcs11_check_error(ctx, rv, "sign init")) { free(data); free(digest); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Sign(session->session, data, data_len, signature, &signatureLen); if (hsm_pkcs11_check_error(ctx, rv, "sign final")) { free(data); free(digest); return NULL; } sig_rdf = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_B64, signatureLen, signature); free(data); free(digest); return sig_rdf; } static int hsm_dname_is_wildcard(const ldns_rdf* dname) { return ( ldns_dname_label_count(dname) > 0 && ldns_rdf_data(dname)[0] == 1 && ldns_rdf_data(dname)[1] == '*'); } static ldns_rr * hsm_create_empty_rrsig(const ldns_rr_list *rrset, const hsm_sign_params_t *sign_params) { ldns_rr *rrsig; uint32_t orig_ttl; uint32_t orig_class; time_t now; uint8_t label_count; label_count = ldns_dname_label_count( ldns_rr_owner(ldns_rr_list_rr(rrset, 0))); /* RFC 4035 section 2.2: dnssec label length and wildcards */ if (hsm_dname_is_wildcard(ldns_rr_owner(ldns_rr_list_rr(rrset, 0)))) { label_count--; } rrsig = ldns_rr_new_frm_type(LDNS_RR_TYPE_RRSIG); /* set the type on the new signature */ orig_ttl = ldns_rr_ttl(ldns_rr_list_rr(rrset, 0)); orig_class = ldns_rr_get_class(ldns_rr_list_rr(rrset, 0)); ldns_rr_set_class(rrsig, orig_class); ldns_rr_set_ttl(rrsig, orig_ttl); ldns_rr_set_owner(rrsig, ldns_rdf_clone( ldns_rr_owner( ldns_rr_list_rr(rrset, 0)))); /* fill in what we know of the signature */ /* set the orig_ttl */ (void)ldns_rr_rrsig_set_origttl( rrsig, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, orig_ttl)); /* the signers name */ (void)ldns_rr_rrsig_set_signame( rrsig, ldns_rdf_clone(sign_params->owner)); /* label count - get it from the first rr in the rr_list */ (void)ldns_rr_rrsig_set_labels( rrsig, ldns_native2rdf_int8(LDNS_RDF_TYPE_INT8, label_count)); /* inception, expiration */ now = time(NULL); if (sign_params->inception != 0) { (void)ldns_rr_rrsig_set_inception( rrsig, ldns_native2rdf_int32( LDNS_RDF_TYPE_TIME, sign_params->inception)); } else { (void)ldns_rr_rrsig_set_inception( rrsig, ldns_native2rdf_int32(LDNS_RDF_TYPE_TIME, now)); } if (sign_params->expiration != 0) { (void)ldns_rr_rrsig_set_expiration( rrsig, ldns_native2rdf_int32( LDNS_RDF_TYPE_TIME, sign_params->expiration)); } else { (void)ldns_rr_rrsig_set_expiration( rrsig, ldns_native2rdf_int32( LDNS_RDF_TYPE_TIME, now + LDNS_DEFAULT_EXP_TIME)); } (void)ldns_rr_rrsig_set_keytag( rrsig, ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, sign_params->keytag)); (void)ldns_rr_rrsig_set_algorithm( rrsig, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, sign_params->algorithm)); (void)ldns_rr_rrsig_set_typecovered( rrsig, ldns_native2rdf_int16( LDNS_RDF_TYPE_TYPE, ldns_rr_get_type(ldns_rr_list_rr(rrset, 0)))); return rrsig; } /* * API functions */ int hsm_open(const char *config, char *(pin_callback)(unsigned int, const char *, unsigned int)) { xmlDocPtr doc; xmlXPathContextPtr xpath_ctx; xmlXPathObjectPtr xpath_obj; xmlNode *curNode; xmlChar *xexpr; int i; char *config_file; char *repository; char *token_label; char *module_path; char *module_pin; hsm_config_t module_config; int result = HSM_OK; int tries; int repositories = 0; /* create an internal context with an attached session for each * configured HSM. */ _hsm_ctx = hsm_ctx_new(); if (config) { config_file = strdup(config); } else{ config_file = strdup(HSM_DEFAULT_CONFIG); } /* Load XML document */ doc = xmlParseFile(config_file); free(config_file); if (doc == NULL) { return HSM_CONFIG_FILE_ERROR; } /* Create xpath evaluation context */ xpath_ctx = xmlXPathNewContext(doc); if(xpath_ctx == NULL) { xmlFreeDoc(doc); hsm_ctx_free(_hsm_ctx); _hsm_ctx = NULL; return -1; } /* Evaluate xpath expression */ xexpr = (xmlChar *)"//Configuration/RepositoryList/Repository"; xpath_obj = xmlXPathEvalExpression(xexpr, xpath_ctx); if(xpath_obj == NULL) { xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); hsm_ctx_free(_hsm_ctx); _hsm_ctx = NULL; return -1; } if (xpath_obj->nodesetval) { for (i = 0; i < xpath_obj->nodesetval->nodeNr; i++) { /*module = hsm_module_new();*/ token_label = NULL; module_path = NULL; module_pin = NULL; hsm_config_default(&module_config); curNode = xpath_obj->nodesetval->nodeTab[i]->xmlChildrenNode; repository = (char *) xmlGetProp(xpath_obj->nodesetval->nodeTab[i], (const xmlChar *)"name"); while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"TokenLabel")) token_label = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"Module")) module_path = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"PIN")) module_pin = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"SkipPublicKey")) module_config.use_pubkey = 0; curNode = curNode->next; } if (repository && token_label && module_path) { if (module_pin) { result = hsm_attach(repository, token_label, module_path, module_pin, &module_config); free(module_pin); } else { if (pin_callback) { result = HSM_PIN_INCORRECT; tries = 0; while (result == HSM_PIN_INCORRECT && tries < 3) { if (tries == 0) { module_pin = pin_callback(_hsm_ctx->session_count, repository, HSM_PIN_FIRST); } else { module_pin = pin_callback(_hsm_ctx->session_count, repository, HSM_PIN_RETRY); } if (module_pin == NULL) break; result = hsm_attach(repository, token_label, module_path, module_pin, &module_config); if (result == HSM_OK) { pin_callback(_hsm_ctx->session_count - 1, repository, HSM_PIN_SAVE); } memset(module_pin, 0, strlen(module_pin)); tries++; } } else { /* no pin, no callback */ hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_open()", "No pin or callback function"); result = HSM_ERROR; } } free(repository); free(token_label); free(module_path); if (result != HSM_OK) { break; } repositories++; } } } xmlXPathFreeObject(xpath_obj); xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); if (result == HSM_OK && repositories == 0) { hsm_ctx_set_error(_hsm_ctx, HSM_NO_REPOSITORIES, "hsm_open()", "No repositories found"); return HSM_NO_REPOSITORIES; } return result; } int hsm_close() { hsm_ctx_close(_hsm_ctx, 1); return 0; } hsm_ctx_t * hsm_create_context() { return hsm_ctx_clone(_hsm_ctx); } int hsm_check_context(hsm_ctx_t *ctx) { unsigned int i; hsm_session_t *session; CK_SESSION_INFO info; CK_RV rv; CK_SESSION_HANDLE session_handle; if (ctx == NULL) { ctx = _hsm_ctx; } for (i = 0; i < ctx->session_count; i++) { session = ctx->session[i]; if (session == NULL) continue; /* Get session info */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetSessionInfo( session->session, &info); if (hsm_pkcs11_check_error(ctx, rv, "get session info")) { return HSM_ERROR; } /* Check session info */ if (info.state != CKS_RW_USER_FUNCTIONS) { hsm_ctx_set_error(ctx, HSM_ERROR, "hsm_check_context()", "Session not logged in"); return HSM_ERROR; } /* Try open and close a session with the token */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_OpenSession(info.slotID, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_handle); if (hsm_pkcs11_check_error(ctx, rv, "test open session")) { return HSM_ERROR; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_CloseSession(session_handle); if (hsm_pkcs11_check_error(ctx, rv, "test close session")) { return HSM_ERROR; } } return HSM_OK; } void hsm_destroy_context(hsm_ctx_t *ctx) { hsm_ctx_close(ctx, 0); } /** * Returns an allocated hsm_sign_params_t with some defaults */ hsm_sign_params_t * hsm_sign_params_new() { hsm_sign_params_t *params; params = malloc(sizeof(hsm_sign_params_t)); if (!params) { return NULL; } params->algorithm = LDNS_SIGN_RSASHA256; params->flags = LDNS_KEY_ZONE_KEY; params->inception = 0; params->expiration = 0; params->keytag = 0; params->owner = NULL; return params; } void hsm_sign_params_free(hsm_sign_params_t *params) { if (params) { if (params->owner) ldns_rdf_deep_free(params->owner); free(params); } } hsm_key_t ** hsm_list_keys(hsm_ctx_t *ctx, size_t *count) { hsm_key_t **keys = NULL; size_t key_count = 0; size_t cur_key_count; hsm_key_t **session_keys; unsigned int i, j; if (!ctx) { ctx = _hsm_ctx; } for (i = 0; i < ctx->session_count; i++) { session_keys = hsm_list_keys_session(ctx, ctx->session[i], &cur_key_count); keys = realloc(keys, (key_count + cur_key_count) * sizeof(hsm_key_t *)); for (j = 0; j < cur_key_count; j++) { keys[key_count + j] = session_keys[j]; } key_count += cur_key_count; free(session_keys); } if (count) { *count = key_count; } return keys; } hsm_key_t ** hsm_list_keys_repository(hsm_ctx_t *ctx, size_t *count, const char *repository) { hsm_session_t *session; if (!repository) return NULL; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) { *count = 0; return NULL; } return hsm_list_keys_session(ctx, session, count); } size_t hsm_count_keys(hsm_ctx_t *ctx) { size_t count = 0; unsigned int i; if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { count += hsm_count_keys_session(ctx, ctx->session[i]); } return count; } size_t hsm_count_keys_repository(hsm_ctx_t *ctx, const char *repository) { hsm_session_t *session; if (!repository) return 0; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) { return 0; } return hsm_count_keys_session(ctx, session); } hsm_key_t * hsm_find_key_by_id(hsm_ctx_t *ctx, const char *id) { unsigned char *id_bytes; size_t len; hsm_key_t *key; id_bytes = hsm_hex_parse(id, &len); if (!id_bytes) return NULL; key = hsm_find_key_by_id_bin(ctx, id_bytes, len); free(id_bytes); return key; } hsm_key_t * hsm_generate_rsa_key(hsm_ctx_t *ctx, const char *repository, unsigned long keysize) { hsm_key_t *new_key; hsm_session_t *session; /* ids we create are 16 bytes of data */ unsigned char id[16]; /* that's 33 bytes in string (16*2 + 1 for \0) */ char id_str[33]; CK_RV rv; CK_OBJECT_HANDLE publicKey, privateKey; CK_KEY_TYPE keyType = CKK_RSA; CK_MECHANISM mechanism = { CKM_RSA_PKCS_KEY_PAIR_GEN, NULL_PTR, 0 }; CK_BYTE publicExponent[] = { 1, 0, 1 }; CK_BBOOL ctrue = CK_TRUE; CK_BBOOL cfalse = CK_FALSE; CK_BBOOL ctoken = CK_TRUE; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) return NULL; /* check whether this key doesn't happen to exist already */ do { hsm_random_buffer(ctx, id, 16); } while (hsm_find_key_by_id_bin(ctx, id, 16)); /* the CKA_LABEL will contain a hexadecimal string representation * of the id */ hsm_hex_unparse(id_str, id, 16); if (! session->module->config->use_pubkey) { ctoken = CK_FALSE; } CK_ATTRIBUTE publicKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen(id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_VERIFY, &ctrue, sizeof(ctrue) }, { CKA_ENCRYPT, &cfalse, sizeof(cfalse) }, { CKA_WRAP, &cfalse, sizeof(cfalse) }, { CKA_TOKEN, &ctoken, sizeof(ctoken) }, { CKA_MODULUS_BITS, &keysize, sizeof(keysize) }, { CKA_PUBLIC_EXPONENT, &publicExponent, sizeof(publicExponent)} }; CK_ATTRIBUTE privateKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR *) id_str, strlen (id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_SIGN, &ctrue, sizeof (ctrue) }, { CKA_DECRYPT, &cfalse, sizeof (cfalse) }, { CKA_UNWRAP, &cfalse, sizeof (cfalse) }, { CKA_SENSITIVE, &ctrue, sizeof (ctrue) }, { CKA_TOKEN, &ctrue, sizeof (ctrue) }, { CKA_PRIVATE, &ctrue, sizeof (ctrue) }, { CKA_EXTRACTABLE, &cfalse, sizeof (cfalse) } }; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKeyPair(session->session, &mechanism, publicKeyTemplate, 9, privateKeyTemplate, 10, &publicKey, &privateKey); if (hsm_pkcs11_check_error(ctx, rv, "generate key pair")) { return NULL; } new_key = hsm_key_new(); new_key->module = session->module; if (session->module->config->use_pubkey) { new_key->public_key = publicKey; } else { new_key->public_key = 0; } new_key->private_key = privateKey; return new_key; } hsm_key_t * hsm_generate_dsa_key(hsm_ctx_t *ctx, const char *repository, unsigned long keysize) { CK_RV rv; hsm_key_t *new_key; hsm_session_t *session; CK_OBJECT_HANDLE domainPar, publicKey, privateKey; CK_BBOOL ctrue = CK_TRUE; CK_BBOOL cfalse = CK_FALSE; /* ids we create are 16 bytes of data */ unsigned char id[16]; /* that's 33 bytes in string (16*2 + 1 for \0) */ char id_str[33]; CK_KEY_TYPE keyType = CKK_DSA; CK_MECHANISM mechanism1 = { CKM_DSA_PARAMETER_GEN, NULL_PTR, 0 }; CK_MECHANISM mechanism2 = { CKM_DSA_KEY_PAIR_GEN, NULL_PTR, 0 }; /* The maximum size for DSA in DNSSEC */ CK_BYTE dsa_p[128]; CK_BYTE dsa_q[20]; CK_BYTE dsa_g[128]; CK_ATTRIBUTE domainTemplate[] = { { CKA_PRIME_BITS, &keysize, sizeof(keysize) } }; CK_ATTRIBUTE publicKeyTemplate[] = { { CKA_PRIME, dsa_p, sizeof(dsa_p) }, { CKA_SUBPRIME, dsa_q, sizeof(dsa_q) }, { CKA_BASE, dsa_g, sizeof(dsa_g) }, { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen(id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_VERIFY, &ctrue, sizeof(ctrue) }, { CKA_ENCRYPT, &cfalse, sizeof(cfalse) }, { CKA_WRAP, &cfalse, sizeof(cfalse) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) } }; CK_ATTRIBUTE privateKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen (id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_SIGN, &ctrue, sizeof(ctrue) }, { CKA_DECRYPT, &cfalse, sizeof(cfalse) }, { CKA_UNWRAP, &cfalse, sizeof(cfalse) }, { CKA_SENSITIVE, &ctrue, sizeof(ctrue) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) }, { CKA_PRIVATE, &ctrue, sizeof(ctrue) }, { CKA_EXTRACTABLE, &cfalse, sizeof(cfalse) } }; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) return NULL; /* check whether this key doesn't happen to exist already */ do { hsm_random_buffer(ctx, id, 16); } while (hsm_find_key_by_id_bin(ctx, id, 16)); /* the CKA_LABEL will contain a hexadecimal string representation * of the id */ hsm_hex_unparse(id_str, id, 16); /* Generate the domain parameters */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKey(session->session, &mechanism1, domainTemplate, 1, &domainPar); if (hsm_pkcs11_check_error(ctx, rv, "generate domain parameters")) { return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue(session->session, domainPar, publicKeyTemplate, 3); if (hsm_pkcs11_check_error(ctx, rv, "get domain parameters")) { return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, domainPar); if (hsm_pkcs11_check_error(ctx, rv, "destroy domain parameters")) { return NULL; } /* Generate key pair */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKeyPair(session->session, &mechanism2, publicKeyTemplate, 10, privateKeyTemplate, 10, &publicKey, &privateKey); if (hsm_pkcs11_check_error(ctx, rv, "generate key pair")) { return NULL; } new_key = hsm_key_new(); new_key->module = session->module; new_key->public_key = publicKey; new_key->private_key = privateKey; return new_key; } hsm_key_t * hsm_generate_gost_key(hsm_ctx_t *ctx, const char *repository) { CK_RV rv; hsm_key_t *new_key; hsm_session_t *session; CK_OBJECT_HANDLE publicKey, privateKey; CK_BBOOL ctrue = CK_TRUE; CK_BBOOL cfalse = CK_FALSE; /* ids we create are 16 bytes of data */ unsigned char id[16]; /* that's 33 bytes in string (16*2 + 1 for \0) */ char id_str[33]; CK_KEY_TYPE keyType = CKK_GOSTR3410; CK_MECHANISM mechanism = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL_PTR, 0 }; CK_BYTE oid[] = { 0x06, 0x07, 0x2A, 0x85, 0x03, 0x02, 0x02, 0x23, 0x01 }; CK_ATTRIBUTE publicKeyTemplate[] = { { CKA_GOSTR3410PARAMS, oid, sizeof(oid) }, { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen(id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_VERIFY, &ctrue, sizeof(ctrue) }, { CKA_ENCRYPT, &cfalse, sizeof(cfalse) }, { CKA_WRAP, &cfalse, sizeof(cfalse) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) } }; CK_ATTRIBUTE privateKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen (id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_SIGN, &ctrue, sizeof(ctrue) }, { CKA_DECRYPT, &cfalse, sizeof(cfalse) }, { CKA_UNWRAP, &cfalse, sizeof(cfalse) }, { CKA_SENSITIVE, &ctrue, sizeof(ctrue) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) }, { CKA_PRIVATE, &ctrue, sizeof(ctrue) }, { CKA_EXTRACTABLE, &cfalse, sizeof(cfalse) } }; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) return NULL; /* check whether this key doesn't happen to exist already */ do { hsm_random_buffer(ctx, id, 16); } while (hsm_find_key_by_id_bin(ctx, id, 16)); /* the CKA_LABEL will contain a hexadecimal string representation * of the id */ hsm_hex_unparse(id_str, id, 16); /* Generate key pair */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKeyPair(session->session, &mechanism, publicKeyTemplate, 10, privateKeyTemplate, 10, &publicKey, &privateKey); if (hsm_pkcs11_check_error(ctx, rv, "generate key pair")) { return NULL; } new_key = hsm_key_new(); new_key->module = session->module; new_key->public_key = publicKey; new_key->private_key = privateKey; return new_key; } int hsm_remove_key(hsm_ctx_t *ctx, hsm_key_t *key) { CK_RV rv; hsm_session_t *session; if (!ctx) ctx = _hsm_ctx; if (!key) return -1; session = hsm_find_key_session(ctx, key); if (!session) return -2; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, key->private_key); if (hsm_pkcs11_check_error(ctx, rv, "Destroy private key")) { return -3; } key->private_key = 0; if (session->module->config->use_pubkey) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, key->public_key); if (hsm_pkcs11_check_error(ctx, rv, "Destroy public key")) { return -4; } } key->public_key = 0; return 0; } void hsm_key_free(hsm_key_t *key) { if (key) { free(key); } } void hsm_key_list_free(hsm_key_t **key_list, size_t count) { size_t i; for (i = 0; i < count; i++) { hsm_key_free(key_list[i]); } free(key_list); } char * hsm_get_key_id(hsm_ctx_t *ctx, const hsm_key_t *key) { unsigned char *id; char *id_str; size_t len; hsm_session_t *session; if (!ctx) ctx = _hsm_ctx; if (!key) return NULL; session = hsm_find_key_session(ctx, key); if (!session) return NULL; id = hsm_get_id_for_object(ctx, session, key->private_key, &len); if (!id) return NULL; /* this is plain binary data, we need to convert it to hex */ id_str = malloc(len * 2 + 1); if (!id_str) return NULL; hsm_hex_unparse(id_str, id, len); free(id); return id_str; } hsm_key_info_t * hsm_get_key_info(hsm_ctx_t *ctx, const hsm_key_t *key) { hsm_key_info_t *key_info; hsm_session_t *session; if (!ctx) ctx = _hsm_ctx; session = hsm_find_key_session(ctx, key); if (!session) return NULL; key_info = malloc(sizeof(hsm_key_info_t)); key_info->id = hsm_get_key_id(ctx, key); if (key_info->id == NULL) { key_info->id = strdup(""); } key_info->algorithm = (unsigned long) hsm_get_key_algorithm(ctx, session, key); key_info->keysize = (unsigned long) hsm_get_key_size(ctx, session, key, key_info->algorithm); /* TODO: Add ECDSA */ switch(key_info->algorithm) { case CKK_RSA: key_info->algorithm_name = strdup("RSA"); break; case CKK_DSA: key_info->algorithm_name = strdup("DSA"); break; case CKK_GOSTR3410: key_info->algorithm_name = strdup("GOST"); break; default: key_info->algorithm_name = malloc(HSM_MAX_ALGONAME); snprintf(key_info->algorithm_name, HSM_MAX_ALGONAME, "%lu", key_info->algorithm); break; } return key_info; } void hsm_key_info_free(hsm_key_info_t *key_info) { if (key_info) { if (key_info->id) { free(key_info->id); } if (key_info->algorithm_name) { free(key_info->algorithm_name); } free(key_info); } } ldns_rr* hsm_sign_rrset(hsm_ctx_t *ctx, const ldns_rr_list* rrset, const hsm_key_t *key, const hsm_sign_params_t *sign_params) { ldns_rr *signature; ldns_buffer *sign_buf; ldns_rdf *b64_rdf; size_t i; (void) ctx; if (!key) return NULL; if (!sign_params) return NULL; signature = hsm_create_empty_rrsig((ldns_rr_list *)rrset, sign_params); /* right now, we have: a key, a semi-sig and an rrset. For * which we can create the sig and base64 encode that and * add that to the signature */ sign_buf = ldns_buffer_new(LDNS_MAX_PACKETLEN); if (ldns_rrsig2buffer_wire(sign_buf, signature) != LDNS_STATUS_OK) { ldns_buffer_free(sign_buf); /* ERROR */ return NULL; } /* make it canonical */ for(i = 0; i < ldns_rr_list_rr_count(rrset); i++) { ldns_rr2canonical(ldns_rr_list_rr(rrset, i)); } /* add the rrset in sign_buf */ if (ldns_rr_list2buffer_wire(sign_buf, rrset) != LDNS_STATUS_OK) { ldns_buffer_free(sign_buf); return NULL; } b64_rdf = hsm_sign_buffer(ctx, sign_buf, key, sign_params->algorithm); ldns_buffer_free(sign_buf); if (!b64_rdf) { /* signing went wrong */ return NULL; } ldns_rr_rrsig_set_sig(signature, b64_rdf); return signature; } /* returns a newly allocated (not null-terminated!) string containing * the message digest of the given source string * digest length contains the length of the result * caller must free returned data with free() * returns NULL (and zero digest length) on error */ static CK_BYTE * hsm_digest(hsm_ctx_t *ctx, hsm_session_t *session, CK_MECHANISM digest_mechanism, char *source, size_t length, size_t *digest_length) { CK_RV rv; CK_BYTE *digest; CK_ULONG d = 0; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DigestInit(session->session, &digest_mechanism); if (hsm_pkcs11_check_error(ctx, rv, "digest init")) { *digest_length = 0; return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Digest(session->session, (CK_BYTE *)source, length, NULL, &d); if (hsm_pkcs11_check_error(ctx, rv, "digest to determine result size")) { *digest_length = 0; return NULL; } digest = malloc(d); rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Digest(session->session, (CK_BYTE *)source, length, digest, &d); if (hsm_pkcs11_check_error(ctx, rv, "digest")) { *digest_length = 0; free(digest); return NULL; } *digest_length = d; return digest; } ldns_rdf * hsm_nsec3_hash_name(hsm_ctx_t *ctx, ldns_rdf *name, uint8_t algorithm, uint16_t iterations, uint8_t salt_length, uint8_t *salt) { char *orig_owner_str; size_t hashed_owner_str_len; ldns_rdf *hashed_owner; char *hashed_owner_str; char *hashed_owner_b32; int hashed_owner_b32_len; uint32_t cur_it; char *hash = NULL; size_t hash_length = 0; ldns_status status; CK_MECHANISM mechanism; unsigned int i; hsm_session_t *session = NULL; char *error_name; switch(algorithm) { case 1: mechanism.mechanism = CKM_SHA_1; mechanism.pParameter = NULL; mechanism.ulParameterLen = 0; break; default: printf("unknown algo: %u\n", (unsigned int)algorithm); return NULL; break; } /* just use the first available session */ if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i]) session = ctx->session[i]; } if (!session) { return NULL; } /* prepare the owner name according to the draft section bla */ orig_owner_str = ldns_rdf2str(name); hashed_owner_str_len = salt_length + ldns_rdf_size(name); hashed_owner_str = LDNS_XMALLOC(char, hashed_owner_str_len); memcpy(hashed_owner_str, ldns_rdf_data(name), ldns_rdf_size(name)); memcpy(hashed_owner_str + ldns_rdf_size(name), salt, salt_length); for (cur_it = iterations + 1; cur_it > 0; cur_it--) { if (hash != NULL) free(hash); hash = (char *) hsm_digest(ctx, session, mechanism, hashed_owner_str, hashed_owner_str_len, &hash_length); LDNS_FREE(hashed_owner_str); hashed_owner_str_len = salt_length + hash_length; hashed_owner_str = LDNS_XMALLOC(char, hashed_owner_str_len); if (!hashed_owner_str) { hsm_ctx_set_error(ctx, -1, "hsm_nsec3_hash_name()", "Memory error"); return NULL; } memcpy(hashed_owner_str, hash, hash_length); memcpy(hashed_owner_str + hash_length, salt, salt_length); } LDNS_FREE(hashed_owner_str); hashed_owner_str = hash; hashed_owner_str_len = hash_length; hashed_owner_b32 = LDNS_XMALLOC(char, ldns_b32_ntop_calculate_size( hashed_owner_str_len) + 1); LDNS_FREE(orig_owner_str); hashed_owner_b32_len = (size_t) ldns_b32_ntop_extended_hex((uint8_t *) hashed_owner_str, hashed_owner_str_len, hashed_owner_b32, ldns_b32_ntop_calculate_size( hashed_owner_str_len)); if (hashed_owner_b32_len < 1) { error_name = ldns_rdf2str(name); hsm_ctx_set_error(ctx, -1, "hsm_nsec3_hash_name()", "Error in base32 extended hex encoding " "of hashed owner name (name: %s, return code: %d)", error_name, hashed_owner_b32_len); LDNS_FREE(error_name); LDNS_FREE(hashed_owner_b32); return NULL; } hashed_owner_str_len = hashed_owner_b32_len; hashed_owner_b32[hashed_owner_b32_len] = '\0'; status = ldns_str2rdf_dname(&hashed_owner, hashed_owner_b32); if (status != LDNS_STATUS_OK) { hsm_ctx_set_error(ctx, -1, "hsm_nsec3_hash_name()", "Error creating rdf from %s", hashed_owner_b32); LDNS_FREE(hashed_owner_b32); return NULL; } free(hash); LDNS_FREE(hashed_owner_b32); return hashed_owner; } ldns_rr * hsm_get_dnskey(hsm_ctx_t *ctx, const hsm_key_t *key, const hsm_sign_params_t *sign_params) { /* CK_RV rv; */ ldns_rr *dnskey; hsm_session_t *session; ldns_rdf *rdata; if (!ctx) ctx = _hsm_ctx; if (!key) { hsm_ctx_set_error(ctx, -1, "hsm_get_dnskey()", "Got NULL key"); return NULL; } if (!sign_params) { hsm_ctx_set_error(ctx, -1, "hsm_get_dnskey()", "Got NULL sign_params"); return NULL; } session = hsm_find_key_session(ctx, key); if (!session) return NULL; dnskey = ldns_rr_new(); ldns_rr_set_type(dnskey, LDNS_RR_TYPE_DNSKEY); ldns_rr_set_owner(dnskey, ldns_rdf_clone(sign_params->owner)); ldns_rr_push_rdf(dnskey, ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, sign_params->flags)); ldns_rr_push_rdf(dnskey, ldns_native2rdf_int8(LDNS_RDF_TYPE_INT8, LDNS_DNSSEC_KEYPROTO)); ldns_rr_push_rdf(dnskey, ldns_native2rdf_int8(LDNS_RDF_TYPE_ALG, sign_params->algorithm)); rdata = hsm_get_key_rdata(ctx, session, key); if (rdata == NULL) { ldns_rr_free(dnskey); return NULL; } ldns_rr_push_rdf(dnskey, rdata); return dnskey; } int hsm_random_buffer(hsm_ctx_t *ctx, unsigned char *buffer, unsigned long length) { CK_RV rv; unsigned int i; hsm_session_t *session; if (!buffer) return -1; if (!ctx) ctx = _hsm_ctx; /* just try every attached token. If one errors (be it NO_RNG, or * any other error, simply try the next */ for (i = 0; i < ctx->session_count; i++) { session = ctx->session[i]; if (session) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateRandom( session->session, buffer, length); if (rv == CKR_OK) { return 0; } } } return 1; } uint32_t hsm_random32(hsm_ctx_t *ctx) { uint32_t rnd; int result; unsigned char rnd_buf[4]; result = hsm_random_buffer(ctx, rnd_buf, 4); if (result == 0) { memcpy(&rnd, rnd_buf, 4); return rnd; } else { return 0; } } uint64_t hsm_random64(hsm_ctx_t *ctx) { uint64_t rnd; int result; unsigned char rnd_buf[8]; result = hsm_random_buffer(ctx, rnd_buf, 8); if (result == 0) { memcpy(&rnd, rnd_buf, 8); return rnd; } else { return 0; } } /* * Additional functions */ int hsm_attach(const char *repository, const char *token_label, const char *path, const char *pin, const hsm_config_t *config) { hsm_session_t *session; int result; result = hsm_session_init(_hsm_ctx, &session, repository, token_label, path, pin, config); if (result == HSM_OK) { return hsm_ctx_add_session(_hsm_ctx, session); } else { return result; } } /*! Detach a named HSM */ int hsm_detach(const char *repository) { unsigned int i; for (i = 0; i < _hsm_ctx->session_count; i++) { if (_hsm_ctx->session[i] && strcmp(_hsm_ctx->session[i]->module->name, repository) == 0) { hsm_session_close(_hsm_ctx, _hsm_ctx->session[i], 1); _hsm_ctx->session[i] = NULL; /* if this was the last session in the list, decrease the * session count */ if (i == _hsm_ctx->session_count) { while(_hsm_ctx->session_count > 0 && !_hsm_ctx->session[i]) { _hsm_ctx->session_count--; } } return 0; } } return -1; } int hsm_token_attached(hsm_ctx_t *ctx, const char *repository) { unsigned int i; if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i] && strcmp(ctx->session[i]->module->name, repository) == 0) { return 1; } } hsm_ctx_set_error(ctx, HSM_REPOSITORY_NOT_FOUND, "hsm_token_attached()", "Can't find repository: %s", repository); return 0; } int hsm_supported_algorithm(ldns_algorithm algorithm) { switch(algorithm) { case LDNS_SIGN_RSAMD5: case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_RSASHA256: case LDNS_SIGN_RSASHA512: case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: case LDNS_SIGN_ECC_GOST: return 0; break; #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #endif default: return -1; } } char * hsm_get_error(hsm_ctx_t *gctx) { hsm_ctx_t *ctx; char *message; if (!gctx) { ctx = _hsm_ctx; } else { ctx = gctx; } if (ctx->error) { ctx->error = 0; message = malloc(HSM_ERROR_MSGSIZE); if (message == NULL) { return strdup("libhsm memory allocation failed"); } snprintf(message, HSM_ERROR_MSGSIZE, "%s: %s", ctx->error_action ? ctx->error_action : "unknown()", ctx->error_message ? ctx->error_message : "unknown error"); return message; }; return NULL; } void hsm_print_session(hsm_session_t *session) { printf("\t\tmodule at %p (sym %p)\n", (void *) session->module, (void *) session->module->sym); printf("\t\tmodule path: %s\n", session->module->path); printf("\t\trepository name: %s\n", session->module->name); printf("\t\ttoken label: %s\n", session->module->token_label); printf("\t\tsess handle: %u\n", (unsigned int) session->session); } void hsm_print_ctx(hsm_ctx_t *gctx) { hsm_ctx_t *ctx; unsigned int i; if (!gctx) { ctx = _hsm_ctx; } else { ctx = gctx; } printf("CTX Sessions: %lu\n", (long unsigned int) ctx->session_count); for (i = 0; i < ctx->session_count; i++) { printf("\tSession at %p\n", (void *) ctx->session[i]); hsm_print_session(ctx->session[i]); } } void hsm_print_key(hsm_key_t *key) { hsm_key_info_t *key_info; if (key) { key_info = hsm_get_key_info(NULL, key); if (key_info) { printf("key:\n"); printf("\tmodule: %p\n", (void *) key->module); printf("\tprivkey handle: %u\n", (unsigned int) key->private_key); if (key->module->config->use_pubkey) { printf("\tpubkey handle: %u\n", (unsigned int) key->public_key); } else { printf("\tpubkey handle: %s\n", "NULL"); } printf("\trepository: %s\n", key->module->name); printf("\talgorithm: %s\n", key_info->algorithm_name); printf("\tsize: %lu\n", key_info->keysize); printf("\tid: %s\n", key_info->id); hsm_key_info_free(key_info); } else { printf("key: hsm_get_key_info() returned NULL\n"); } } else { printf("key: \n"); } } void hsm_print_error(hsm_ctx_t *gctx) { char *message; message = hsm_get_error(gctx); if (message) { fprintf(stderr, "%s\n", message); free(message); } else { fprintf(stderr, "Unknown error\n"); } } void hsm_print_tokeninfo(hsm_ctx_t *gctx) { CK_RV rv; CK_SLOT_ID slot_id; CK_TOKEN_INFO token_info; hsm_ctx_t *ctx; unsigned int i; hsm_session_t *session; int result; if (!gctx) { ctx = _hsm_ctx; } else { ctx = gctx; } for (i = 0; i < ctx->session_count; i++) { session = ctx->session[i]; result = hsm_get_slot_id(ctx, session->module->sym, session->module->token_label, &slot_id); if (result != HSM_OK) return; rv = ((CK_FUNCTION_LIST_PTR) session->module->sym)->C_GetTokenInfo(slot_id, &token_info); if (hsm_pkcs11_check_error(ctx, rv, "C_GetTokenInfo")) { return; } printf("Repository: %s\n",session->module->name); printf("\tModule: %s\n", session->module->path); printf("\tSlot: %lu\n", slot_id); printf("\tToken Label: %.*s\n", (int) sizeof(token_info.label), token_info.label); printf("\tManufacturer: %.*s\n", (int) sizeof(token_info.manufacturerID), token_info.manufacturerID); printf("\tModel: %.*s\n", (int) sizeof(token_info.model), token_info.model); printf("\tSerial: %.*s\n", (int) sizeof(token_info.serialNumber), token_info.serialNumber); if (i + 1 != ctx->session_count) printf("\n"); } } opendnssec-1.4.3/libhsm/src/lib/Makefile.in0000664000175000017500000004341712247571137015505 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6560 2012-08-28 06:31:40Z rb $ VPATH = @srcdir@ 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@ subdir = libhsm/src/lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libhsm_a_AR = $(AR) $(ARFLAGS) libhsm_a_LIBADD = am_libhsm_a_OBJECTS = libhsm.$(OBJEXT) pin.$(OBJEXT) libhsm_a_OBJECTS = $(am_libhsm_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common 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 = $(libhsm_a_SOURCES) DIST_SOURCES = $(libhsm_a_SOURCES) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/cryptoki_compat \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 noinst_LIBRARIES = libhsm.a libhsm_a_SOURCES = libhsm.c libhsm.h libhsmdns.h pin.c \ cryptoki_compat/pkcs11.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 libhsm/src/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/src/lib/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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libhsm.a: $(libhsm_a_OBJECTS) $(libhsm_a_DEPENDENCIES) $(EXTRA_libhsm_a_DEPENDENCIES) -rm -f libhsm.a $(libhsm_a_AR) libhsm.a $(libhsm_a_OBJECTS) $(libhsm_a_LIBADD) $(RANLIB) libhsm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pin.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 $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 $(LIBRARIES) installdirs: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES 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-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # 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: opendnssec-1.4.3/libhsm/src/lib/libhsm.h0000664000175000017500000003500212026571507015052 00000000000000/* $Id: libhsm.h 6704 2012-09-20 10:43:19Z rb $ */ /* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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, 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 ``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 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. */ #ifndef HSM_H #define HSM_H 1 #include /* Note that currently the MySQL kasp schema limits the number of HSMs to * 127; so to increase it beyond that requires some database changes similar * to when keypairs(id) was increased, see svn r4465. * * Note that this constant also determines the size of the shared PIN memory. * Increasing this size requires any existing memory to be removed and should * be part of a migration script. */ #define HSM_MAX_SESSIONS 100 #define HSM_MAX_ALGONAME 16 #define HSM_ERROR_MSGSIZE 512 /* TODO: depends on type and key, or just leave it at current * maximum? */ #define HSM_MAX_SIGNATURE_LENGTH 512 /* Note that this constant also determines the size of the shared PIN memory. * Increasing this size requires any existing memory to be removed and should * be part of a migration script. */ #define HSM_MAX_PIN_LENGTH 255 /*! Return codes for some of the functions */ /*! These should be different than the list of CKR_ values defined * by pkcs11 (for easier debugging purposes of calling applications) */ #define HSM_OK 0 #define HSM_ERROR 0x10000001 #define HSM_PIN_INCORRECT 0x10000002 #define HSM_CONFIG_FILE_ERROR 0x10000003 #define HSM_REPOSITORY_NOT_FOUND 0x10000004 #define HSM_NO_REPOSITORIES 0x10000005 #define HSM_MODULE_NOT_FOUND 0x10000006 /*! The mode for the PIN callback functions */ #define HSM_PIN_FIRST 0 /* Used when getting the PIN for the first time. */ #define HSM_PIN_RETRY 1 /* Used when we failed to login the first time. */ #define HSM_PIN_SAVE 2 /* The latest PIN can be saved for future use. Called after a successful login. */ /*! HSM configuration */ typedef struct { unsigned int use_pubkey; /*!< Maintain public keys in HSM */ } hsm_config_t; /*! Data type to describe an HSM */ typedef struct { unsigned int id; /*!< HSM numerical identifier */ char *name; /*!< name of repository */ char *token_label; /*!< label of the token */ char *path; /*!< path to PKCS#11 library */ void *handle; /*!< handle from dlopen()*/ void *sym; /*!< Function list from dlsym */ hsm_config_t *config; /*!< optional per HSM configuration */ } hsm_module_t; /*! HSM Session */ typedef struct { hsm_module_t *module; unsigned long session; } hsm_session_t; /*! HSM Key Pair */ typedef struct { const hsm_module_t *module; /*!< pointer to module */ unsigned long private_key; /*!< private key within module */ unsigned long public_key; /*!< public key within module */ } hsm_key_t; /*! HSM Key Pair Information */ typedef struct { char *id; /*!< key id */ unsigned long algorithm; /*!< key algorithm (cast from CKK_*)*/ char *algorithm_name; /*!< key algorithm name */ unsigned long keysize; /*!< key size */ } hsm_key_info_t; /*! HSM context to keep track of sessions */ typedef struct { hsm_session_t *session[HSM_MAX_SESSIONS]; /*!< HSM sessions */ size_t session_count; /*!< number of configured HSMs */ /*!< non-zero if the last operation failed (only the first error will be set) */ int error; /*!< static string describing the action we were trying to do when the first error happened */ const char *error_action; /*!< static string describing the first error */ char error_message[HSM_ERROR_MSGSIZE]; } hsm_ctx_t; /*! Open HSM library \param config path to OpenDNSSEC XML configuration file \param pin_callback This function will be called for tokens that have no PIN configured. The default hsm_prompt_pin() can be used. If this value is NULL, these tokens will be skipped \return 0 if successful, !0 if failed Attaches all configured HSMs, querying for PINs (using the given callback function) if not known. Also creates initial sessions (not part of any context; every API function that takes a context can be passed NULL, in which case the global context will be used) and log into each HSM. */ int hsm_open(const char *config, char *(pin_callback)(unsigned int, const char *, unsigned int)); /*! Function that queries for a PIN, can be used as callback for hsm_open(). Stores the PIN in the shared memory. \param id Used for identifying the repository. Will have a value between zero and HSM_MAX_SESSIONS. \param repository The repository name will be included in the prompt \param mode The type of mode the function should run in. \return The string the user enters */ char * hsm_prompt_pin(unsigned int id, const char *repository, unsigned int mode); /*! Function that will check if there is a PIN in the shared memory and returns it. \param id Used for identifying the repository. Will have a value between zero and HSM_MAX_SESSIONS. \param repository The repository name will be included in the prompt \param mode The type of mode the function should run in. \return The string the user enters */ char * hsm_check_pin(unsigned int id, const char *repository, unsigned int mode); /*! Logout Function that will logout the user by deleting the shared memory and semaphore. Any authenticated process will still be able to interact with the HSM. */ int hsm_logout_pin(); /*! Close HSM library Log out and detach from all configured HSMs This cleans up all data for libhsm, and should be the last function called. */ int hsm_close(); /*! Create new HSM context Creates a new session for each attached HSM. The returned hsm_ctx_t * can be freed with hsm_destroy_context() */ hsm_ctx_t * hsm_create_context(void); /*! Check HSM context Check if the associated sessions are still alive. If they are not alive, then try re-open libhsm. \param context HSM context \return 0 if successful, !0 if failed */ int hsm_check_context(hsm_ctx_t *context); /*! Destroy HSM context \param context HSM context Also destroys any associated sessions. */ void hsm_destroy_context(hsm_ctx_t *context); /*! List all known keys in all attached HSMs After the function has run, the value at count contains the number of keys found. The resulting key list can be freed with hsm_key_list_free() Alternatively, each individual key structure in the list could be freed with hsm_key_free() \param context HSM context \param count location to store the number of keys found */ hsm_key_t ** hsm_list_keys(hsm_ctx_t *context, size_t *count); /*! List all known keys in a HSM After the function has run, the value at count contains the number of keys found. The resulting key list can be freed with hsm_key_list_free() Alternatively, each individual key structure in the list could be freed with hsm_key_free() \param context HSM context \param count location to store the number of keys found \param repository repository to list the keys in */ hsm_key_t ** hsm_list_keys_repository(hsm_ctx_t *context, size_t *count, const char *repository); /*! Count all known keys in all attached HSMs \param context HSM context */ size_t hsm_count_keys(hsm_ctx_t *context); /*! Count all known keys in a HSM \param context HSM context \param repository repository in where to count the keys */ size_t hsm_count_keys_repository(hsm_ctx_t *context, const char *repository); /*! Find a key pair by CKA_ID (as hex string) The returned key structure can be freed with hsm_key_free() \param context HSM context \param id CKA_ID of key to find (null-terminated string of hex characters) \return key identifier or NULL if not found (or invalid input) */ hsm_key_t * hsm_find_key_by_id(hsm_ctx_t *context, const char *id); /*! Generate new key pair in HSM Keys generated by libhsm will have a 16-byte identifier set as CKA_ID and the hexadecimal representation of it set as CKA_LABEL. Other stuff, like exponent, may be needed here as well. The returned key structure can be freed with hsm_key_free() \param context HSM context \param repository repository in where to create the key \param keysize Size of RSA key \return return key identifier or NULL if key generation failed */ hsm_key_t * hsm_generate_rsa_key(hsm_ctx_t *context, const char *repository, unsigned long keysize); /*! Generate new key pair in HSM Keys generated by libhsm will have a 16-byte identifier set as CKA_ID and the hexadecimal representation of it set as CKA_LABEL. The returned key structure can be freed with hsm_key_free() \param context HSM context \param repository repository in where to create the key \param keysize Size of DSA key \return return key identifier or NULL if key generation failed */ hsm_key_t * hsm_generate_dsa_key(hsm_ctx_t *context, const char *repository, unsigned long keysize); /*! Generate new key pair in HSM Keys generated by libhsm will have a 16-byte identifier set as CKA_ID and the hexadecimal representation of it set as CKA_LABEL. The returned key structure can be freed with hsm_key_free() \param context HSM context \param repository repository in where to create the key \return return key identifier or NULL if key generation failed */ hsm_key_t * hsm_generate_gost_key(hsm_ctx_t *context, const char *repository); /*! Remove a key pair from HSM When a key is removed, the module pointer is set to NULL, and the public and private key handles are set to 0. The structure still needs to be freed. \param context HSM context \param key Key pair to be removed \return 0 if successful, !0 if failed */ int hsm_remove_key(hsm_ctx_t *context, hsm_key_t *key); /*! Free the memory for a key structure. \param key The key structure to free */ void hsm_key_free(hsm_key_t *key); /*! Free the memory of an array of key structures, as returned by hsm_list_keys() \param key_list The array of keys to free \param count The number of keys in the array */ void hsm_key_list_free(hsm_key_t **key_list, size_t count); /*! Get id as null-terminated hex string using key identifier The returned id is allocated data, and must be free()d by the caller \param context HSM context \param key Key pair to get the ID from \return id of key pair */ char * hsm_get_key_id(hsm_ctx_t *context, const hsm_key_t *key); /*! Get extended key information The returned id is allocated data, and must be freed by the caller With hsm_key_info_free() \param context HSM context \param key Key pair to get information about \return key information */ hsm_key_info_t * hsm_get_key_info(hsm_ctx_t *context, const hsm_key_t *key); /*! Frees the hsm_key_info_t structure \param key_info The structure to free */ void hsm_key_info_free(hsm_key_info_t *key_info); /*! Fill a buffer with random data from any attached HSM \param context HSM context \param buffer Buffer to fill with random data \param length Size of random buffer \return 0 if successful, !0 if failed */ int hsm_random_buffer(hsm_ctx_t *ctx, unsigned char *buffer, unsigned long length); /*! Return unsigned 32-bit random number from any attached HSM \param context HSM context \return 32-bit random number, or 0 if no HSM with a random generator is attached */ uint32_t hsm_random32(hsm_ctx_t *ctx); /*! Return unsigned 64-bit random number from any attached HSM \param context HSM context \return 64-bit random number, or 0 if no HSM with a random generator is attached */ uint64_t hsm_random64(hsm_ctx_t *ctx); /* * Additional functions for debugging, and non-general use-cases. */ /*! Attached a named HSM using a PKCS#11 shared library and optional credentials (may be NULL, but then undefined) This function changes the global state, and is not threadsafe \param repository the name of the repository \param token_label the name of the token to attach \param path the path of the shared PKCS#11 library \param pin the PIN to log into the token \param config optional configuration \return 0 on success, -1 on error */ int hsm_attach(const char *repository, const char *token_name, const char *path, const char *pin, const hsm_config_t *config); /*! Detach a named HSM This function changes the global state, and is not threadsafe \param token_name the token to detach \return 0 on success, -1 on error */ int hsm_detach(const char *repository); /*! Check whether a named token has been initialized in this context \param ctx HSM context \param token_name The name of the token \return 1 if the token is attached, 0 if not found */ int hsm_token_attached(hsm_ctx_t *ctx, const char *repository); /*! Return the current error message The returned message is allocated data, and must be free()d by the caller \param ctx HSM context \return error message string */ char * hsm_get_error(hsm_ctx_t *gctx); /* a few debug functions for applications */ void hsm_print_session(hsm_session_t *session); void hsm_print_ctx(hsm_ctx_t *gctx); void hsm_print_key(hsm_key_t *key); void hsm_print_error(hsm_ctx_t *ctx); void hsm_print_tokeninfo(hsm_ctx_t *gctx); #endif /* HSM_H */ opendnssec-1.4.3/libhsm/src/lib/pin.c0000664000175000017500000003203012026571507014353 00000000000000/* $Id: pin.c 6704 2012-09-20 10:43:19Z rb $ */ /* * Copyright (c) 2011 .SE (The Internet Infrastructure Foundation). * 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, 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 ``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 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. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "libhsm.h" /*! Global (initial) context */ extern hsm_ctx_t *_hsm_ctx; /* Function from libhsm.c */ void hsm_ctx_set_error(hsm_ctx_t *ctx, int error, const char *action, const char *message, ...); /* Constants */ #define SHM_KEY (key_t)0x0d50d5ec #define SEM_KEY (key_t)0x0d50d5ec #define SHM_PERM S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP #define SEM_PERM S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP #ifndef HAVE_UNION_SEMUN /* From man page for semctl */ union semun { int val; /* Value for SETVAL */ struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ unsigned short *array; /* Array for GETALL, SETALL */ }; #endif /* Remember PIN that we can save */ static char pin[HSM_MAX_PIN_LENGTH+1]; char * prompt_pass(char *prompt) { int c, i = 0; static char pass[HSM_MAX_PIN_LENGTH+1]; struct termios oldt, newt; if (prompt == NULL) return NULL; printf("%s", prompt); /* Turn echoing off */ if (isatty(fileno(stdin))) { if (tcgetattr(fileno(stdin), &oldt) != 0) return NULL; newt = oldt; newt.c_lflag &= ~ECHO; if (tcsetattr(fileno(stdin), TCSAFLUSH, &newt) != 0) return NULL; } /* Get the password */ do { c = fgetc(stdin); pass[i] = c; i++; } while (c != EOF && c != '\n' && c != '\r' && i < HSM_MAX_PIN_LENGTH+1); pass[i-1] = '\0'; /* Restore echoing */ if (isatty(fileno(stdin))) { tcsetattr(fileno(stdin), TCSAFLUSH, &oldt); } printf("\n"); return pass; } int hsm_sem_open() { int semid; struct semid_ds buf; union semun arg; /* Create/get the semaphore */ semid = semget(SEM_KEY, 1, IPC_CREAT|IPC_EXCL|SEM_PERM); if (semid == -1) { semid = semget(SEM_KEY, 1, IPC_CREAT|SEM_PERM); if (semid == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Could not access the semaphore: %s", strerror(errno)); return -1; } } else { /* Set value to 1 if we created it */ arg.val = 1; if (semctl(semid, 0, SETVAL, arg) == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Could not set value on the semaphore: %s", strerror(errno)); return -1; } } /* Get information about the semaphore */ arg.buf = &buf; if (semctl(semid, 0, IPC_STAT, arg) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Could not stat the semaphore: %s", strerror(errno)); return -1; } /* Check permission to avoid an attack */ if ((buf.sem_perm.mode & (SEM_PERM)) != (SEM_PERM) || buf.sem_perm.gid != getegid()) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Bad permissions on the semaphore, please read Getting Help/Troubleshooting on OpenDNSSEC Wiki about this."); return -1; } return semid; } int hsm_sem_wait(int semid) { struct sembuf sb = { 0, -1, 0 }; if (semop(semid, &sb, 1) == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_wait()", "Could not lock the semaphore: %s", strerror(errno)); return -1; } return 0; } int hsm_sem_post(int semid) { struct sembuf sb = { 0, 1, 0 }; if (semop(semid, &sb, 1) == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_post()", "Could not unlock the semaphore: %s", strerror(errno)); return -1; } return 0; } int hsm_shm_open() { int shmid; size_t shmsize; struct shmid_ds buf; /* Create/get the shared memory */ shmsize = sizeof(char)*HSM_MAX_SESSIONS*(HSM_MAX_PIN_LENGTH+1); shmid = shmget(SHM_KEY, shmsize, IPC_CREAT|IPC_EXCL|SHM_PERM); if (shmid == -1) { shmid = shmget(SHM_KEY, shmsize, IPC_CREAT|SHM_PERM); if (shmid == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Could not access the shared memory: %s", strerror(errno)); return -1; } } else { /* Zeroize if we created the memory area */ /* The data should be set to zero according to man page */ } /* Get information about the shared memory */ if (shmctl(shmid, IPC_STAT, &buf) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Could not stat the semaphore: %s", strerror(errno)); return -1; } /* Check the size of the memory segment */ if (buf.shm_segsz != shmsize) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Bad memory size, please read Getting Help/Troubleshooting on OpenDNSSEC Wiki about this."); return -1; } /* Check permission to avoid an attack */ if ((buf.shm_perm.mode & (SHM_PERM)) != (SHM_PERM) || buf.shm_perm.gid != getegid()) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Bad permissions on the shared memory, please read Getting Help/Troubleshooting on OpenDNSSEC Wiki about this."); return -1; } return shmid; } char * hsm_prompt_pin(unsigned int id, const char *repository, unsigned int mode) { /* Shared memory */ int shmid; int semid; char *pins = NULL; int index = id * (HSM_MAX_PIN_LENGTH + 1); /* PIN from getpass */ char prompt[64]; char *prompt_pin = NULL; unsigned int size = 0; /* Check input data */ if (id >= HSM_MAX_SESSIONS) return NULL; if (repository == NULL) return NULL; if (mode != HSM_PIN_FIRST && mode != HSM_PIN_RETRY && mode != HSM_PIN_SAVE) return NULL; /* Create/get the semaphore */ semid = hsm_sem_open(); if (semid == -1) return NULL; /* Lock the semaphore */ if (hsm_sem_wait(semid) != 0) return NULL; /* Create/get the shared memory */ shmid = hsm_shm_open(); if (shmid == -1) { hsm_sem_post(semid); return NULL; } /* Attach to the shared memory */ pins = (char *)shmat(shmid, NULL, 0); if (pins == (char *)-1) { pins = NULL; hsm_sem_post(semid); return NULL; } /* Get the PIN */ if (mode != HSM_PIN_SAVE) { /* Do we have a PIN in the shared memory? */ if (mode == HSM_PIN_FIRST && pins[index] != '\0') { size = strlen(&pins[index]); if (size > HSM_MAX_PIN_LENGTH) size = HSM_MAX_PIN_LENGTH; memcpy(pin, &pins[index], size); pin[size] = '\0'; } else { /* Zeroize bad PIN in shared memory */ if (mode == HSM_PIN_RETRY && pins[index] != '\0') { memset(&pins[index], '\0', HSM_MAX_PIN_LENGTH+1); } /* Unlock the semaphore if someone would do Ctrl+C */ hsm_sem_post(semid); /* Get PIN */ snprintf(prompt, 64, "Enter PIN for token %s: ", repository); prompt_pin = prompt_pass(prompt); if (prompt_pin == NULL) { shmdt(pins); pins = NULL; return NULL; } /* Lock the semaphore */ hsm_sem_wait(semid); /* Remember PIN */ size = strlen(prompt_pin); if (size > HSM_MAX_PIN_LENGTH) size = HSM_MAX_PIN_LENGTH; memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); memcpy(pin, prompt_pin, size); /* Zeroize the prompt_pass PIN */ memset(prompt_pin, '\0', strlen(prompt_pin)); } } else { /* Save the PIN */ memcpy(&pins[index], pin, HSM_MAX_PIN_LENGTH+1); /* Zeroize the PIN */ memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); } /* Detach from the shared memory */ shmdt(pins); pins = NULL; /* Unlock the semaphore */ hsm_sem_post(semid); return pin; } char * hsm_check_pin(unsigned int id, const char *repository, unsigned int mode) { /* Shared memory */ int shmid; int semid; char *pins = NULL; int index = id * (HSM_MAX_PIN_LENGTH + 1); unsigned int size = 0; /* Check input data */ if (id >= HSM_MAX_SESSIONS) return NULL; if (repository == NULL) return NULL; if (mode != HSM_PIN_FIRST && mode != HSM_PIN_RETRY && mode != HSM_PIN_SAVE) return NULL; if (mode == HSM_PIN_SAVE) { /* Nothing to save */ /* Zeroize the PIN */ memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); return pin; } /* Create/get the semaphore */ semid = hsm_sem_open(); if (semid == -1) return NULL; /* Lock the semaphore */ if (hsm_sem_wait(semid) != 0) return NULL; /* Create/get the shared memory */ shmid = hsm_shm_open(); if (shmid == -1) { hsm_sem_post(semid); return NULL; } /* Attach to the shared memory */ pins = (char *)shmat(shmid, NULL, 0); if (pins == (char *)-1) { pins = NULL; hsm_sem_post(semid); return NULL; } /* Zeroize PIN buffer */ memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); /* Check if there is no PIN */ if (pins[index] == '\0') { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_check_pin()", "No PIN in shared memory. " "Please login with \"ods-hsmutil login\""); shmdt(pins); pins = NULL; hsm_sem_post(semid); return NULL; } /* Zeroize bad PIN in shared memory */ if (mode == HSM_PIN_RETRY) { memset(&pins[index], '\0', HSM_MAX_PIN_LENGTH+1); hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_check_pin()", "Removed bad PIN in shared memory. " "Please login again with \"ods-hsmutil login\""); shmdt(pins); pins = NULL; hsm_sem_post(semid); return NULL; } /* Get the PIN */ size = strlen(&pins[index]); if (size > HSM_MAX_PIN_LENGTH) size = HSM_MAX_PIN_LENGTH; memcpy(pin, &pins[index], size); pin[size] = '\0'; /* Detach from the shared memory */ shmdt(pins); pins = NULL; /* Unlock the semaphore */ hsm_sem_post(semid); return pin; } int hsm_logout_pin() { int semid; int shmid; union semun arg; struct shmid_ds buf; /* Get the semaphore */ semid = semget(SEM_KEY, 1, 0); if (semid == -1) { if (errno != ENOENT) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not access the semaphore: %s", strerror(errno)); return HSM_ERROR; } } else { /* Remove the semaphore */ if (semctl(semid, 0, IPC_RMID, arg) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not delete the semaphore: %s", strerror(errno)); return HSM_ERROR; } } /* Get the shared memory */ shmid = shmget(SHM_KEY, 0, 0); if (shmid == -1) { if (errno != ENOENT) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not access the shared memory: %s", strerror(errno)); return HSM_ERROR; } } else { /* Remove the shared memory */ if (shmctl(shmid, IPC_RMID, &buf) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not stat the semaphore: %s", strerror(errno)); return HSM_ERROR; } } return HSM_OK; } opendnssec-1.4.3/libhsm/src/lib/Makefile.am0000664000175000017500000000056312017062714015456 00000000000000# $Id: Makefile.am 6560 2012-08-28 06:31:40Z rb $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/cryptoki_compat \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 noinst_LIBRARIES = libhsm.a libhsm_a_SOURCES = libhsm.c libhsm.h libhsmdns.h pin.c \ cryptoki_compat/pkcs11.h opendnssec-1.4.3/libhsm/src/lib/libhsmdns.h0000664000175000017500000000740712017062714015562 00000000000000/* $Id: libhsmdns.h 6560 2012-08-28 06:31:40Z rb $ */ /* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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, 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 ``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 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. */ #ifndef HSMDNS_H #define HSMDNS_H 1 #include /*! Extra information for signing rrsets (algorithm, expiration, etc) */ typedef struct { /** The DNS signing algorithm identifier */ ldns_algorithm algorithm; /** Key flags */ uint16_t flags; /** The inception date of signatures made with this key. */ uint32_t inception; /** The expiration date of signatures made with this key. */ uint32_t expiration; /** The keytag of the key (is this necessary?) */ uint16_t keytag; /** The owner name of the key */ ldns_rdf *owner; } hsm_sign_params_t; /*! * Returns an allocated hsm_sign_params_t with some defaults */ hsm_sign_params_t * hsm_sign_params_new(); /*! Free the signer parameters structure If params->owner has been set, ldns_rdf_deep_free() will be called on it. \param params The signer parameters to free */ void hsm_sign_params_free(hsm_sign_params_t *params); /*! Sign RRset using key The returned ldns_rr structure can be freed with ldns_rr_free() \param context HSM context \param rrset RRset to sign \param key Key pair used to sign \return ldns_rr* Signed RRset */ ldns_rr* hsm_sign_rrset(hsm_ctx_t *ctx, const ldns_rr_list* rrset, const hsm_key_t *key, const hsm_sign_params_t *sign_params); /*! Generate a base32 encoded hashed NSEC3 name \param ctx HSM context \param name Domain name to hash \param algorithm NSEC3 algorithm (must be 1 atm) \param iteration number of hash iterations \param salt_length the length of the salt \param salt the salt */ ldns_rdf * hsm_nsec3_hash_name(hsm_ctx_t *ctx, ldns_rdf *name, uint8_t algorithm, uint16_t iterations, uint8_t salt_length, uint8_t *salt); /*! Get DNSKEY RR The returned ldns_rr structure can be freed with ldns_rr_free() \param context HSM context \param key Key to get DNSKEY RR from \param sign_params the signing parameters (flags, algorithm, etc) \return ldns_rr* */ ldns_rr* hsm_get_dnskey(hsm_ctx_t *ctx, const hsm_key_t *key, const hsm_sign_params_t *sign_params); /*! Check if a given DNSSEC algorithm is supported \param ldns_algorithm algorithm number \return 0 if supported, -1 otherwise */ int hsm_supported_algorithm(ldns_algorithm algorithm); #endif /* HSMDNS_H */ opendnssec-1.4.3/libhsm/src/Makefile.am0000664000175000017500000000016311616243264014711 00000000000000# $Id: Makefile.am 5348 2011-08-03 13:01:40Z rb $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = lib bin opendnssec-1.4.3/libhsm/Makefile.am0000664000175000017500000000054211427766226014133 00000000000000# $Id: Makefile.am 3682 2010-08-09 11:55:02Z jakob $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src checks doxygen: rm -fr $(top_builddir)/libhsm/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-libhsm" \ SRCDIR=$(top_srcdir)/libhsm \ OUTPUTDIR=$(top_builddir)/libhsm/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) opendnssec-1.4.3/signer/0000775000175000017500000000000012247571206012160 500000000000000opendnssec-1.4.3/signer/Makefile.in0000664000175000017500000005073212247571137014157 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 4098 2010-10-13 14:40:53Z matthijs $ VPATH = @srcdir@ 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@ subdir = signer DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ AUTHORS ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src man all: all-recursive .SUFFIXES: $(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 signer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign signer/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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am doxygen: rm -fr $(top_builddir)/signer/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-signer" \ SRCDIR=$(top_srcdir)/signer \ OUTPUTDIR=$(top_builddir)/signer/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) # 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: opendnssec-1.4.3/signer/man/0000775000175000017500000000000012247571207012734 500000000000000opendnssec-1.4.3/signer/man/Makefile.in0000664000175000017500000004167112247571137014734 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id$ VPATH = @srcdir@ 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@ subdir = signer/man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ods-signer.8.in $(srcdir)/ods-signerd.8.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = ods-signer.8 ods-signerd.8 CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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 am__installdirs = "$(DESTDIR)$(man8dir)" NROFF = nroff MANS = $(man8_MANS) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in man8_MANS = ods-signer.8 ods-signerd.8 all: all-am .SUFFIXES: $(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 signer/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign signer/man/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): ods-signer.8: $(top_builddir)/config.status $(srcdir)/ods-signer.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-signerd.8: $(top_builddir)/config.status $(srcdir)/ods-signerd.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man8_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | 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='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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) tags: TAGS TAGS: ctags: CTAGS CTAGS: 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 $(MANS) installdirs: for dir in "$(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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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-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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool 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-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man8 # 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: opendnssec-1.4.3/signer/man/ods-signerd.8.in0000664000175000017500000000240511721247530015564 00000000000000.TH "ods-signerd" "22" "February 2012" "OpenDNSSEC" "OpenDNSSEC ods-signerd" .\" $Id: ods-signerd.8.in 2785 2010-02-02 16:45:00Z rb $ .SH "NAME" .LP .B ods\-signerd \- OpenDNSSEC Signer Engine daemon .SH "SYNOPSIS" .LP .B ods\-signerd .RB [ \-1 ] .RB [ \-c .IR FILE ] .RB [ \-d ] .RB [ \-h ] .RB [ \-i ] .RB [ \-v ] .RB [ \-V ] .P .SH "DESCRIPTION" .LP ods\-signerd is part of the OpenDNSSEC software. It will keep your DNS zones continuous signed. For more information, go to .B http://www.opendnssec.org and visit the Documentation page. .P .SH "OPTIONS" .LP .TP .B \-1 Run signer engine once, then exit (for debugging purposes). .TP .B \-c\fI FILE Read configuration from file, instead of using the default. .TP .B \-d Run daemon in foreground. .TP .B \-h Show this help. .TP .B \-i Print configuration and exit (for debugging purposes). .TP .B \-v Increase verbosity. .TP .B \-V Show version and exit. .P .SH "DIAGNOSTICS" .LP will log all the problems via standard syslog(8). .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-signerd was written by NLnet Labs as part of the OpenDNSSEC project. opendnssec-1.4.3/signer/man/ods-signer.8.in0000664000175000017500000000214312156031121015405 00000000000000.TH "ods-signer" "22" "February 2012" "OpenDNSSEC" "OpenDNSSEC ods-signer" .\" $Id: ods-signer.8.in 3709 2010-08-10 13:03:45Z rb $ .SH "NAME" .B ods\-signer \- OpenDNSSEC Signer Engine client .LP .SH "SYNOPSIS" .B ods\-signer .RB [ \-h ] .I clear .IR | .I flush | .I queue | .I reload | .I running | .I sign .IR [ \-\-serial ] | .I sign \-\-all | .I start | .I stop | .I update .RB [ \-\-all ] | .I update .IR | .I verbosity .IR | .I zones .LP .SH "DESCRIPTION" ods\-signer is part of the OpenDNSSEC software. With this tool, you can send commands to the signer engine daemon. For more information, go to .B http://www.opendnssec.org and visit the Documentation page. .LP .SH "OPTIONS" .LP .TP .B \-h Show this help. .P .SH "DIAGNOSTICS" .LP will log all the problems via stderr. .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-signer was written by NLnet Labs as part of the OpenDNSSEC project. opendnssec-1.4.3/signer/man/Makefile.am0000664000175000017500000000013611455342344014706 00000000000000# $Id$ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in man8_MANS = ods-signer.8 ods-signerd.8 opendnssec-1.4.3/signer/AUTHORS0000664000175000017500000000027711261074127013151 00000000000000$Id: AUTHORS 1992 2009-10-01 09:37:27Z matthijs $ Main developers: Jelte Jansen (jelte@NLnetLabs.nl) http://www.NLnetLabs.nl Matthijs Mekking (matthijs@NLnetLabs.nl) http://www.NLnetLabs.nl opendnssec-1.4.3/signer/src/0000775000175000017500000000000012247571206012747 500000000000000opendnssec-1.4.3/signer/src/scheduler/0000775000175000017500000000000012247571206014725 500000000000000opendnssec-1.4.3/signer/src/scheduler/schedule.c0000664000175000017500000002316312107367651016614 00000000000000/* * $Id$ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Task scheduling. * */ #include "config.h" #include "scheduler/schedule.h" #include "scheduler/task.h" #include "shared/duration.h" #include "shared/log.h" #include static const char* schedule_str = "scheduler"; /** * Create new schedule. * */ schedule_type* schedule_create(allocator_type* allocator) { schedule_type* schedule; if (!allocator) { return NULL; } schedule = (schedule_type*) allocator_alloc(allocator, sizeof(schedule_type)); if (!schedule) { ods_log_error("[%s] unable to create schedule: allocator_alloc() " "failed", schedule_str); return NULL; } schedule->allocator = allocator; schedule->loading = 0; schedule->flushcount = 0; schedule->tasks = ldns_rbtree_create(task_compare); if (!schedule->tasks) { ods_log_error("[%s] unable to create schedule: ldns_rbtree_create() " "failed", schedule_str); allocator_deallocate(allocator, (void*) schedule); return NULL; } lock_basic_init(&schedule->schedule_lock); return schedule; } /** * Flush schedule. * */ void schedule_flush(schedule_type* schedule, task_id override) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* task = NULL; ods_log_debug("[%s] flush all tasks", schedule_str); if (!schedule || !schedule->tasks) { return; } node = ldns_rbtree_first(schedule->tasks); while (node && node != LDNS_RBTREE_NULL) { task = (task_type*) node->data; task->flush = 1; schedule->flushcount++; if (override != TASK_NONE) { task->what = override; } node = ldns_rbtree_next(node); } return; } /** * Convert task to a tree node. * */ static ldns_rbnode_t* task2node(task_type* task) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (node) { node->key = task; node->data = task; } return node; } /** * Look up task. * */ task_type* schedule_lookup_task(schedule_type* schedule, task_type* task) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* lookup = NULL; if (!schedule || !task) { return NULL; } ods_log_assert(schedule->tasks); node = ldns_rbtree_search(schedule->tasks, task); if (node && node != LDNS_RBTREE_NULL) { lookup = (task_type*) node->data; } return lookup; } /** * Schedule task. * */ ods_status schedule_task(schedule_type* schedule, task_type* task, int log) { ldns_rbnode_t* new_node = NULL; ldns_rbnode_t* ins_node = NULL; if (!task || !schedule || !schedule->tasks) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] schedule task %s for zone %s", schedule_str, task_what2str(task->what), task_who2str(task)); if (schedule_lookup_task(schedule, task) != NULL) { ods_log_error("[%s] unable to schedule task %s for zone %s: " " already present", schedule_str, task_what2str(task->what), task_who2str(task)); return ODS_STATUS_ERR; } new_node = task2node(task); if (!new_node) { ods_log_error("[%s] unable to schedule task %s for zone %s: " " task2node() failed", schedule_str, task_what2str(task->what), task_who2str(task)); return ODS_STATUS_MALLOC_ERR; } ins_node = ldns_rbtree_insert(schedule->tasks, new_node); if (!ins_node) { ods_log_error("[%s] unable to schedule task %s for zone %s: " " insert failed", schedule_str, task_what2str(task->what), task_who2str(task)); free((void*)new_node); return ODS_STATUS_ERR; } if (task->flush) { schedule->flushcount++; } if (log) { task_log(task); } return ODS_STATUS_OK; } /** * Unschedule task. * */ task_type* unschedule_task(schedule_type* schedule, task_type* task) { ldns_rbnode_t* del_node = LDNS_RBTREE_NULL; task_type* del_task = NULL; if (!task || !schedule || !schedule->tasks) { return NULL; } ods_log_debug("[%s] unschedule task %s for zone %s", schedule_str, task_what2str(task->what), task_who2str(task)); del_node = ldns_rbtree_delete(schedule->tasks, (const void*) task); if (del_node) { del_task = (task_type*) del_node->data; free((void*)del_node); } else { ods_log_warning("[%s] unable to unschedule task %s for zone %s: not " "scheduled", schedule_str, task_what2str(task->what), task_who2str(task)); return NULL; } if (del_task->flush) { del_task->flush = 0; schedule->flushcount--; } return del_task; } /** * Reschedule task. * */ ods_status reschedule_task(schedule_type* schedule, task_type* task, task_id what, time_t when) { task_type* del_task = NULL; if (!task || !schedule || !schedule->tasks) { return ODS_STATUS_ASSERT_ERR; } del_task = unschedule_task(schedule, task); if (!del_task) { del_task = task; } del_task->what = what; del_task->when = when; return schedule_task(schedule, del_task, 1); } /** * Get the first scheduled task. * */ task_type* schedule_get_first_task(schedule_type* schedule) { ldns_rbnode_t* first_node = LDNS_RBTREE_NULL; ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* pop = NULL; if (!schedule || !schedule->tasks) { return NULL; } first_node = ldns_rbtree_first(schedule->tasks); if (!first_node) { return NULL; } if (schedule->flushcount > 0) { /* find remaining to be flushed tasks */ node = first_node; while (node && node != LDNS_RBTREE_NULL) { pop = (task_type*) node->data; if (pop->flush) { return pop; } node = ldns_rbtree_next(node); } /* no more to be flushed tasks found */ ods_log_warning("[%s] unable to get first scheduled task: could not " "find flush-task, while there should be %i flush-tasks left", schedule_str, schedule->flushcount); ods_log_info("[%s] reset flush count to 0", schedule_str); schedule->flushcount = 0; } /* no more tasks to be flushed, return first task in schedule */ pop = (task_type*) first_node->data; return pop; } /** * Pop the first scheduled task. * */ task_type* schedule_pop_task(schedule_type* schedule) { task_type* pop = NULL; time_t now = 0; if (!schedule || !schedule->tasks) { return NULL; } now = time_now(); pop = schedule_get_first_task(schedule); if (pop && (pop->flush || pop->when <= now)) { if (pop->flush) { ods_log_debug("[%s] flush task for zone %s", schedule_str, task_who2str(pop)); } else { ods_log_debug("[%s] pop task for zone %s", schedule_str, task_who2str(pop)); } return unschedule_task(schedule, pop); } return NULL; } /** * Print schedule. * */ void schedule_print(FILE* out, schedule_type* schedule) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* task = NULL; if (!out || !schedule || !schedule->tasks) { return; } node = ldns_rbtree_first(schedule->tasks); while (node && node != LDNS_RBTREE_NULL) { task = (task_type*) node->data; task_print(out, task); node = ldns_rbtree_next(node); } fprintf(out, "\n"); return; } /** * Internal task cleanup function. * */ static void task_delfunc(ldns_rbnode_t* elem) { task_type* task; if (elem && elem != LDNS_RBTREE_NULL) { task = (task_type*) elem->data; task_delfunc(elem->left); task_delfunc(elem->right); task_cleanup(task); free((void*)elem); } return; } /** * Clean up schedule. * */ void schedule_cleanup(schedule_type* schedule) { allocator_type* allocator; lock_basic_type schedule_lock; if (!schedule) { return; } ods_log_debug("[%s] cleanup schedule", schedule_str); if (schedule->tasks) { task_delfunc(schedule->tasks->root); ldns_rbtree_free(schedule->tasks); schedule->tasks = NULL; } allocator = schedule->allocator; schedule_lock = schedule->schedule_lock; allocator_deallocate(allocator, (void*) schedule); lock_basic_destroy(&schedule_lock); return; } opendnssec-1.4.3/signer/src/scheduler/fifoq.h0000664000175000017500000000555712127027127016131 00000000000000/* * $Id$ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * FIFO Queue. * */ #ifndef SCHEDULER_FIFOQ_H #define SCHEDULER_FIFOQ_H #include "config.h" #include "daemon/worker.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #define FIFOQ_MAX_COUNT 1000 #define FIFOQ_TRIES_COUNT 10 /** * FIFO Queue. */ typedef struct fifoq_struct fifoq_type; struct fifoq_struct { allocator_type* allocator; void* blob[FIFOQ_MAX_COUNT]; worker_type* owner[FIFOQ_MAX_COUNT]; size_t count; lock_basic_type q_lock; cond_basic_type q_threshold; cond_basic_type q_nonfull; }; /** * Create new FIFO queue. * \param[in] allocator memory allocator * \return fifoq_type* created queue * */ fifoq_type* fifoq_create(allocator_type* allocator); /** * Wipe queue. * \param[in] q queue to be wiped * */ void fifoq_wipe(fifoq_type* q); /** * Pop item from queue. * \param[in] q queue * \param[out] worker worker that owns the item * \return void* popped item * */ void* fifoq_pop(fifoq_type* q, worker_type** worker); /** * Push item to queue. * \param[in] q queue * \param[in] item item * \param[in] worker owner of item * \param[out] tries number of tries * \return ods_status status * */ ods_status fifoq_push(fifoq_type* q, void* item, worker_type* worker, int* tries); /** * Clean up queue. * \param[in] q queue to be cleaned up * */ void fifoq_cleanup(fifoq_type* q); #endif /* SCHEDULER_FIFOQ_H */ opendnssec-1.4.3/signer/src/scheduler/schedule.h0000664000175000017500000000753611541662172016624 00000000000000/* * $Id$ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Task scheduling. * */ #ifndef SCHEDULER_SCHEDULE_H #define SCHEDULER_SCHEDULE_H #include "config.h" #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include /** * Task schedule. */ typedef struct schedule_struct schedule_type; struct schedule_struct { allocator_type* allocator; ldns_rbtree_t* tasks; int flushcount; int loading; /* to determine backoff */ lock_basic_type schedule_lock; }; /** * Create new schedule. * \param[in] allocator memory allocator * \return schedule_type* created schedule * */ schedule_type* schedule_create(allocator_type* allocator); /** * Flush schedule. * \param[in] schedule schedule to be flushed * \param[in] override override task * */ void schedule_flush(schedule_type* schedule, task_id override); /** * Look up task. * \param[in] schedule schedule * \param[in] task task * \return task_type* task, if found * */ task_type* schedule_lookup_task(schedule_type* schedule, task_type* task); /** * Schedule task. * \param[in] schedule schedule * \param[in] task task * \param[in] log add entry in log for this * \return ods_status status * */ ods_status schedule_task(schedule_type* schedule, task_type* task, int log); /** * Unschedule task. * \param[in] schedule schedule * \param[in] task task to delete * \return task_type* task, if it was scheduled * */ task_type* unschedule_task(schedule_type* schedule, task_type* task); /** * Reschedule task. * \param[in] schedule schedule * \param[in] task task to delete * \param[in] what new task * \param[in] when new time * \return ods_status status * */ ods_status reschedule_task(schedule_type* schedule, task_type* task, task_id what, time_t when); /** * Pop the first scheduled task. * \param[in] schedule schedule * \return task_type* popped task * */ task_type* schedule_pop_task(schedule_type* schedule); /** * Get the first scheduled task. * \param[in] schedule schedule * \return task_type* first scheduled task * */ task_type* schedule_get_first_task(schedule_type* schedule); /** * Print schedule. * \param[in] out file descriptor * \param[in] schedule schedule * */ void schedule_print(FILE* out, schedule_type* schedule); /** * Clean up schedule. * \param[in] schedule schedule to be cleaned up * */ void schedule_cleanup(schedule_type* schedule); #endif /* SCHEDULER_SCHEDULE_H */ opendnssec-1.4.3/signer/src/scheduler/task.h0000664000175000017500000000644511720723101015755 00000000000000/* * $Id: task.h 6181 2012-02-21 14:12:17Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Tasks. * */ #ifndef SCHEDULER_TASK_H #define SCHEDULER_TASK_H #include "config.h" #include "shared/allocator.h" #include enum task_id_enum { TASK_NONE = 0, TASK_SIGNCONF, /* ods-signer update */ TASK_READ, /* ods-signer sign */ TASK_NSECIFY, TASK_SIGN, /* ods-signer flush */ TASK_WRITE }; typedef enum task_id_enum task_id; /** * Task. */ typedef struct task_struct task_type; struct task_struct { allocator_type* allocator; task_id what; task_id interrupt; task_id halted; time_t when; time_t halted_when; time_t backoff; int flush; void* zone; }; /** * Create a new task. * \param[in] what task identifier * \param[in] when scheduled time * \param[in] zone zone reference * \return task_type* created task * */ task_type* task_create(task_id what, time_t when, void* zone); /** * Backup task. * \param[in] fd file descriptor * \param[in] task task * */ void task_backup(FILE* fd, task_type* task); /** * Compare tasks. * \param[in] a one task * \param[in] b another task * \return int -1, 0 or 1 * */ int task_compare(const void* a, const void* b); /** * Convert task to string. * \param[in] task task * \param[out] buffer to store string-based task in * \return string-format task * */ char* task2str(task_type* task, char* buftask); /** * String-format of who. * \param[in] what task identifier * \return const char* string-format of what * */ const char* task_what2str(task_id what); /** * String-format of who. * \param[in] task task * \return const char* string-format of who */ const char* task_who2str(task_type* task); /** * Print task. * \param[in] out file descriptor * \param[in] task task * */ void task_print(FILE* out, task_type* task); /** * Log task. * \param[in] task task * */ void task_log(task_type* task); /** * Clean up task. * \param[in] task task * */ void task_cleanup(task_type* task); #endif /* SCHEDULER_TASK_H */ opendnssec-1.4.3/signer/src/scheduler/fifoq.c0000664000175000017500000001061512062067777016130 00000000000000/* * $Id$ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * FIFO Queue. * */ #include "config.h" #include "scheduler/fifoq.h" #include "shared/log.h" #include static const char* fifoq_str = "fifo"; /** * Create new FIFO queue. * */ fifoq_type* fifoq_create(allocator_type* allocator) { fifoq_type* fifoq; if (!allocator) { return NULL; } fifoq = (fifoq_type*) allocator_alloc(allocator, sizeof(fifoq_type)); if (!fifoq) { ods_log_error("[%s] unable to create fifoq: allocator_alloc() failed", fifoq_str); return NULL; } fifoq->allocator = allocator; fifoq_wipe(fifoq); lock_basic_init(&fifoq->q_lock); lock_basic_set(&fifoq->q_threshold); lock_basic_set(&fifoq->q_nonfull); return fifoq; } /** * Wipe queue. * */ void fifoq_wipe(fifoq_type* q) { size_t i = 0; for (i=0; i < FIFOQ_MAX_COUNT; i++) { q->blob[i] = NULL; q->owner[i] = NULL; } q->count = 0; return; } /** * Pop item from queue. * */ void* fifoq_pop(fifoq_type* q, worker_type** worker) { void* pop = NULL; size_t i = 0; if (!q || q->count <= 0) { return NULL; } pop = q->blob[0]; *worker = q->owner[0]; for (i = 0; i < q->count-1; i++) { q->blob[i] = q->blob[i+1]; q->owner[i] = q->owner[i+1]; } q->count -= 1; if (q->count <= (size_t) FIFOQ_MAX_COUNT * 0.1) { /** * Notify waiting workers that they can start queuing again * If no workers are waiting, this call has no effect. */ lock_basic_broadcast(&q->q_nonfull); } return pop; } /** * Push item to queue. * */ ods_status fifoq_push(fifoq_type* q, void* item, worker_type* worker, int* tries) { if (!q || !item || !worker) { return ODS_STATUS_ASSERT_ERR; } if (q->count >= FIFOQ_MAX_COUNT) { /** * #262: * If drudgers remain on hold, do additional broadcast. * If no drudgers are waiting, this call has no effect. */ if (*tries > FIFOQ_TRIES_COUNT) { lock_basic_broadcast(&q->q_threshold); ods_log_debug("[%s] queue full, notify drudgers again", fifoq_str); /* reset tries */ *tries = 0; } return ODS_STATUS_UNCHANGED; } q->blob[q->count] = item; q->owner[q->count] = worker; q->count += 1; if (q->count == 1) { ods_log_deeebug("[%s] threshold %u reached, notify drudgers", fifoq_str, q->count); /* If no drudgers are waiting, this call has no effect. */ lock_basic_broadcast(&q->q_threshold); } return ODS_STATUS_OK; } /** * Clean up queue. * */ void fifoq_cleanup(fifoq_type* q) { allocator_type* allocator; lock_basic_type q_lock; cond_basic_type q_threshold; cond_basic_type q_nonfull; if (!q) { return; } allocator = q->allocator; q_lock = q->q_lock; q_threshold = q->q_threshold; q_nonfull = q->q_nonfull; allocator_deallocate(allocator, (void*) q); lock_basic_off(&q_threshold); lock_basic_off(&q_nonfull); lock_basic_destroy(&q_lock); return; } opendnssec-1.4.3/signer/src/scheduler/task.c0000664000175000017500000001532012107367651015756 00000000000000/* * $Id: task.c 7040 2013-02-15 08:19:53Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Tasks. * */ #include "config.h" #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "signer/zone.h" static const char* task_str = "task"; /** * Create a new task. * */ task_type* task_create(task_id what, time_t when, void* zone) { allocator_type* allocator = NULL; task_type* task = NULL; if (!zone) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create task: allocator_create() failed", task_str); return NULL; } task = (task_type*) allocator_alloc(allocator, sizeof(task_type)); if (!task) { ods_log_error("[%s] unable to create task: allocator_alloc() failed", task_str); allocator_cleanup(allocator); return NULL; } task->allocator = allocator; task->what = what; task->interrupt = TASK_NONE; task->halted = TASK_NONE; task->when = when; task->halted_when = 0; task->backoff = 0; task->flush = 0; task->zone = zone; return task; } /** * Backup task. * */ void task_backup(FILE* fd, task_type* task) { if (!fd || !task) { return; } ods_log_assert(fd); ods_log_assert(task); fprintf(fd, ";;Task: when %u what %i interrupt %i halted %i backoff %i " "flush %i\n", (unsigned) task->when, (int) task->what, (int) task->interrupt, (int) task->halted, (unsigned) task->backoff, task->flush); return; } /** * Compare tasks. * */ int task_compare(const void* a, const void* b) { task_type* x = (task_type*)a; task_type* y = (task_type*)b; zone_type* zx = NULL; zone_type* zy = NULL; ods_log_assert(x); ods_log_assert(y); zx = (zone_type*) x->zone; zy = (zone_type*) y->zone; if (!ldns_dname_compare((const void*) zx->apex, (const void*) zy->apex)) { /* if dname is the same, consider the same task */ return 0; } /* order task on time, what to do, dname */ if (x->when != y->when) { return (int) x->when - y->when; } if (x->what != y->what) { return (int) x->what - y->what; } /* this is unfair, it prioritizes zones that are first in canonical line */ return ldns_dname_compare((const void*) zx->apex, (const void*) zy->apex); } /** * String-format of what. * */ const char* task_what2str(task_id what) { switch (what) { case TASK_NONE: return "[ignore]"; break; case TASK_SIGNCONF: return "[configure]"; break; case TASK_READ: return "[read]"; break; case TASK_SIGN: return "[sign]"; break; case TASK_WRITE: return "[write]"; break; default: break; } return "[???]"; } /** * String-format of who. * */ const char* task_who2str(task_type* task) { zone_type* zone = NULL; if (task) { zone = (zone_type*) task->zone; } if (zone && zone->name) { return zone->name; } return "(null)"; } /** * Convert task to string. * */ char* task2str(task_type* task, char* buftask) { char* strtime = NULL; char* strtask = NULL; if (task) { strtime = ctime(&task->when); if (strtime) { strtime[strlen(strtime)-1] = '\0'; } if (buftask) { (void)snprintf(buftask, ODS_SE_MAXLINE, "%s %s I will %s zone %s" "\n", task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); return buftask; } else { strtask = (char*) calloc(ODS_SE_MAXLINE, sizeof(char)); if (strtask) { snprintf(strtask, ODS_SE_MAXLINE, "%s %s I will %s zone %s\n", task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); return strtask; } else { ods_log_error("[%s] unable to convert task to string: malloc " "error", task_str); } } } return NULL; } /** * Print task. * */ void task_print(FILE* out, task_type* task) { char* strtime = NULL; if (out && task) { strtime = ctime(&task->when); if (strtime) { strtime[strlen(strtime)-1] = '\0'; } fprintf(out, "%s %s I will %s zone %s\n", task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); } return; } /** * Log task. * */ void task_log(task_type* task) { char* strtime = NULL; if (task) { strtime = ctime(&task->when); if (strtime) { strtime[strlen(strtime)-1] = '\0'; } ods_log_debug("[%s] %s %s I will %s zone %s", task_str, task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); } return; } /** * Clean up task. * */ void task_cleanup(task_type* task) { allocator_type* allocator; if (!task) { return; } allocator = task->allocator; allocator_deallocate(allocator, (void*) task); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/parser/0000775000175000017500000000000012247571206014243 500000000000000opendnssec-1.4.3/signer/src/parser/confparser.h0000664000175000017500000000745612117625023016503 00000000000000/* * $Id: confparser.h 7065 2013-03-12 13:13:55Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing configuration files. * */ #ifndef PARSER_CONFPARSER_H #define PARSER_CONFPARSER_H #include "config.h" #include "wire/listener.h" #include "shared/allocator.h" #include "shared/status.h" #define ADMAX 6 /* Maximum number of adapters that can be initialized */ /** * Check config file with rng file. * \param[in] cfgfile the configuration file name * \param[in] rngfile the rng file name * \return ods_status status * */ ods_status parse_file_check(const char* cfgfile, const char* rngfile); /** * Parse elements from the configuration file. * \param[in] cfgfile configuration file * \param[in] expr xml expression * \param[in] required if the element is required * \return const char* string value * */ const char* parse_conf_string(const char* cfgfile, const char* expr, int required); /** * Parse the listener interfaces. * \param[in] allocator the allocator * \param[in] cfgfile the configuration file name * \return listener_type* listener interfaces * */ listener_type* parse_conf_listener(allocator_type* allocator, const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] allocator the allocator * \param[in] cfgfile the configuration file name * \return const char* string * */ /** Common */ const char* parse_conf_zonelist_filename(allocator_type* allocator, const char* cfgfile); const char* parse_conf_log_filename(allocator_type* allocator, const char* cfgfile); /** Signer specific */ const char* parse_conf_pid_filename(allocator_type* allocator, const char* cfgfile); const char* parse_conf_notify_command(allocator_type* allocator, const char* cfgfile); const char* parse_conf_clisock_filename(allocator_type* allocator, const char* cfgfile); const char* parse_conf_working_dir(allocator_type* allocator, const char* cfgfile); const char* parse_conf_username(allocator_type* allocator, const char* cfgfile); const char* parse_conf_group(allocator_type* allocator, const char* cfgfile); const char* parse_conf_chroot(allocator_type* allocator, const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name * \return int integer * */ /** Common */ int parse_conf_use_syslog(const char* cfgfile); int parse_conf_verbosity(const char* cfgfile); /** Signer specific */ int parse_conf_worker_threads(const char* cfgfile); int parse_conf_signer_threads(const char* cfgfile); #endif /* PARSE_CONFPARSER_H */ opendnssec-1.4.3/signer/src/parser/addnsparser.h0000664000175000017500000000554311665407046016654 00000000000000/* * $Id: addnsparser.h 4661 2011-03-25 10:30:29Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing DNS Adapter. * */ #ifndef PARSER_ADDNSPARSER_H #define PARSER_ADDNSPARSER_H #include "wire/acl.h" #include "wire/tsig.h" #include #include /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_request_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_allow_notify(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_provide_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_do_notify(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \return tsig_type* TSIG * */ tsig_type* parse_addns_tsig(allocator_type* allocator, const char* filename); #endif /* PARSER_ADDNSPARSER_H */ opendnssec-1.4.3/signer/src/parser/confparser.c0000664000175000017500000003426212117625023016471 00000000000000/* * $Id: confparser.c 7065 2013-03-12 13:13:55Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing configuration files. * */ #include "parser/confparser.h" #include "parser/zonelistparser.h" #include "shared/allocator.h" #include "shared/log.h" #include "shared/status.h" #include "wire/acl.h" #include #include #include #include #include static const char* parser_str = "parser"; /** * Parse elements from the configuration file. * */ ods_status parse_file_check(const char* cfgfile, const char* rngfile) { xmlDocPtr doc = NULL; xmlDocPtr rngdoc = NULL; xmlRelaxNGParserCtxtPtr rngpctx = NULL; xmlRelaxNGValidCtxtPtr rngctx = NULL; xmlRelaxNGPtr schema = NULL; int status = 0; if (!cfgfile || !rngfile) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] check cfgfile %s with rngfile %s", parser_str, cfgfile, rngfile); /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] unable to parse file: failed to load cfgfile %s", parser_str, cfgfile); return ODS_STATUS_XML_ERR; } /* Load rng document */ rngdoc = xmlParseFile(rngfile); if (rngdoc == NULL) { ods_log_error("[%s] unable to parse file: failed to load rngfile %s", parser_str, rngfile); xmlFreeDoc(doc); return ODS_STATUS_XML_ERR; } /* Create an XML RelaxNGs parser context for the relax-ng document. */ rngpctx = xmlRelaxNGNewDocParserCtxt(rngdoc); if (rngpctx == NULL) { ods_log_error("[%s] unable to parse file: " "xmlRelaxNGNewDocParserCtxt() failed", parser_str); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_XML_ERR; } /* Parse a schema definition resource and * build an internal XML schema structure. */ schema = xmlRelaxNGParse(rngpctx); if (schema == NULL) { ods_log_error("[%s] unable to parse file: xmlRelaxNGParse() failed", parser_str); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_PARSE_ERR; } /* Create an XML RelaxNGs validation context. */ rngctx = xmlRelaxNGNewValidCtxt(schema); if (rngctx == NULL) { ods_log_error("[%s] unable to parse file: xmlRelaxNGNewValidCtxt() " "failed", parser_str); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_RNG_ERR; } /* Validate a document tree in memory. */ status = xmlRelaxNGValidateDoc(rngctx,doc); if (status != 0) { ods_log_error("[%s] unable to parse file: xmlRelaxNGValidateDoc() " "failed", parser_str); xmlRelaxNGFreeValidCtxt(rngctx); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_RNG_ERR; } xmlRelaxNGFreeValidCtxt(rngctx); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_OK; } /* TODO: look how the enforcer reads this now */ /** * Parse the listener interfaces. * */ listener_type* parse_conf_listener(allocator_type* allocator, const char* cfgfile) { listener_type* listener = NULL; interface_type* interface = NULL; int i = 0; char* address = NULL; char* port = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; ods_log_assert(allocator); ods_log_assert(cfgfile); /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] could not parse : " "xmlParseFile() failed", parser_str); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse : " "xmlXPathNewContext() failed", parser_str); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) "//Configuration/Signer/Listener/Interface"; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse : " "xmlXPathEvalExpression failed", parser_str); return NULL; } /* Parse interfaces */ listener = listener_create(allocator); ods_log_assert(listener); if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { address = NULL; port = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Address")) { address = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Port")) { port = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (address) { interface = listener_push(listener, address, acl_parse_family(address), port); } else { interface = listener_push(listener, "", AF_INET, port); if (interface) { interface = listener_push(listener, "", AF_INET6, port); } } if (!interface) { ods_log_error("[%s] unable to add %s:%s interface: " "listener_push() failed", parser_str, address?address:"", port?port:""); } else { ods_log_debug("[%s] added %s:%s interface to listener", parser_str, address?address:"", port?port:""); } free((void*)port); free((void*)address); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return listener; } /** * Parse elements from the configuration file. * */ const char* parse_conf_string(const char* cfgfile, const char* expr, int required) { xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlChar *xexpr = NULL; const char* string = NULL; ods_log_assert(expr); ods_log_assert(cfgfile); /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] unable to parse file %s: xmlParseFile() failed", parser_str, cfgfile); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if (xpathCtx == NULL) { ods_log_error("[%s] unable to parse file %s: xmlXPathNewContext() " "failed", parser_str, cfgfile); xmlFreeDoc(doc); return NULL; } /* Get string */ xexpr = (unsigned char*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if (xpathObj == NULL || xpathObj->nodesetval == NULL || xpathObj->nodesetval->nodeNr <= 0) { if (required) { ods_log_error("[%s] unable to evaluate expression %s in cfgile %s", parser_str, (char*) xexpr, cfgfile); } xmlXPathFreeContext(xpathCtx); if (xpathObj) { xmlXPathFreeObject(xpathObj); } xmlFreeDoc(doc); return NULL; } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { string = (const char*) xmlXPathCastToString(xpathObj); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); xmlFreeDoc(doc); return string; } xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); xmlFreeDoc(doc); return NULL; } const char* parse_conf_zonelist_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Common/ZoneListFile", 1); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_log_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/Syslog/Facility", 0); if (!str) { str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/File/Filename", 0); } if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; /* NULL, Facility or Filename */ } const char* parse_conf_pid_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/PidFile", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } else { dup = allocator_strdup(allocator, ODS_SE_PIDFILE); } return dup; } const char* parse_conf_notify_command(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/NotifyCommand", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_clisock_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/SocketFile", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } else { dup = allocator_strdup(allocator, ODS_SE_SOCKFILE); } return dup; } const char* parse_conf_working_dir(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/WorkingDirectory", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } else { dup = allocator_strdup(allocator, ODS_SE_WORKDIR); } ods_log_assert(dup); return dup; } const char* parse_conf_username(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/Privileges/User", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_group(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/Privileges/Group", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_chroot(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/Privileges/Directory", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } /** * Parse elements from the configuration file. * */ int parse_conf_use_syslog(const char* cfgfile) { const char* str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/Syslog/Facility", 0); if (str) { free((void*)str); return 1; } return 0; } int parse_conf_verbosity(const char* cfgfile) { int verbosity = ODS_SE_VERBOSITY; const char* str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/Verbosity", 0); if (str) { if (strlen(str) > 0) { verbosity = atoi(str); } free((void*)str); } return verbosity; } int parse_conf_worker_threads(const char* cfgfile) { int numwt = ODS_SE_WORKERTHREADS; const char* str = parse_conf_string(cfgfile, "//Configuration/Signer/WorkerThreads", 0); if (str) { if (strlen(str) > 0) { numwt = atoi(str); } free((void*)str); } return numwt; } int parse_conf_signer_threads(const char* cfgfile) { int numwt = ODS_SE_WORKERTHREADS; const char* str = parse_conf_string(cfgfile, "//Configuration/Signer/SignerThreads", 0); if (str) { if (strlen(str) > 0) { numwt = atoi(str); } free((void*)str); return numwt; } /* no SignerThreads value configured, look at WorkerThreads */ return parse_conf_worker_threads(cfgfile); } opendnssec-1.4.3/signer/src/parser/signconfparser.h0000664000175000017500000000710312242400745017352 00000000000000/* * $Id: signconfparser.h 7409 2013-11-18 12:02:45Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing signer configuration files. * */ #ifndef PARSER_SIGNCONFPARSER_H #define PARSER_SIGNCONFPARSER_H #include "parser/confparser.h" #include "shared/allocator.h" #include "shared/duration.h" #include "signer/keys.h" #include "config.h" #include /** * Parse keys from the signer configuration file. * \param[in] sc signer configuration reference * \param[in] cfgfile the configuration file name. * \return keylist_type* key list * */ keylist_type* parse_sc_keys(void* sc, const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return duration_type* duration * */ duration_type* parse_sc_sig_resign_interval(const char* cfgfile); duration_type* parse_sc_sig_refresh_interval(const char* cfgfile); duration_type* parse_sc_sig_validity_default(const char* cfgfile); duration_type* parse_sc_sig_validity_denial(const char* cfgfile); duration_type* parse_sc_sig_jitter(const char* cfgfile); duration_type* parse_sc_sig_inception_offset(const char* cfgfile); duration_type* parse_sc_dnskey_ttl(const char* cfgfile); duration_type* parse_sc_nsec3param_ttl(const char* cfgfile); duration_type* parse_sc_soa_ttl(const char* cfgfile); duration_type* parse_sc_soa_min(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return ldns_rr_type rr type * */ ldns_rr_type parse_sc_nsec_type(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return uint32_t integer * */ uint32_t parse_sc_nsec3_algorithm(const char* cfgfile); uint32_t parse_sc_nsec3_iterations(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return int integer * */ int parse_sc_nsec3_optout(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return const char* string * */ const char* parse_sc_soa_serial(allocator_type* allocator, const char* cfgfile); const char* parse_sc_nsec3_salt(allocator_type* allocator, const char* cfgfile); #endif /* PARSER_SIGNCONFPARSER_H */ opendnssec-1.4.3/signer/src/parser/zonelistparser.c0000664000175000017500000002250312107375456017421 00000000000000/* * $Id: zonelistparser.c 7041 2013-02-15 09:09:02Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing zonelist files. * */ #include "adapter/adapter.h" #include "parser/zonelistparser.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/zonelist.h" #include "signer/zone.h" #include #include #include #include static const char* parser_str = "parser"; /** * Parse expr inside XPath Context. * */ static const char* parse_zonelist_element(xmlXPathContextPtr xpathCtx, xmlChar* expr) { xmlXPathObjectPtr xpathObj = NULL; const char* str = NULL; ods_log_assert(xpathCtx); ods_log_assert(expr); xpathObj = xmlXPathEvalExpression(expr, xpathCtx); if (xpathObj == NULL) { ods_log_error("[%s] unable to evaluate xpath expression %s", parser_str, expr); return NULL; } str = (const char*) xmlXPathCastToString(xpathObj); xmlXPathFreeObject(xpathObj); return str; } /** * Create adapter from configuration. * */ static adapter_type* zlp_adapter(xmlNode* curNode, adapter_mode type, unsigned inbound) { const char* file = NULL; adapter_type* adapter = NULL; file = (const char*) xmlNodeGetContent(curNode); if (!file) { ods_log_error("[%s] unable to read %s adapter", parser_str, inbound?"input":"output"); return NULL; } adapter = adapter_create(file, type, inbound); free((void*)file); return adapter; } /** * Parse adapter. * */ adapter_type* parse_zonelist_adapter(xmlXPathContextPtr xpathCtx, xmlChar* expr, int inbound) { xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* type = NULL; adapter_type* adapter = NULL; int i = 0; if (!xpathCtx || !expr) { return NULL; } xpathObj = xmlXPathEvalExpression(expr, xpathCtx); if (xpathObj == NULL) { ods_log_error("[%s] unable to parse adapter: xmlPathEvalExpression() " "failed (expr %s)", parser_str, expr); return NULL; } if (xpathObj->nodesetval) { for (i=0; i < xpathObj->nodesetval->nodeNr; i++) { curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar*)"File")) { adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); } else if (xmlStrEqual(curNode->name, (const xmlChar*)"Adapter")) { type = xmlGetProp(curNode, (const xmlChar*)"type"); if (xmlStrEqual(type, (const xmlChar*)"File")) { adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); } else if (xmlStrEqual(type, (const xmlChar*)"DNS")) { adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound); } else { ods_log_error("[%s] unable to parse %s adapter: " "unknown type", parser_str, (const char*) type); } free((void*)type); type = NULL; } if (adapter) { break; } curNode = curNode->next; } } } xmlXPathFreeObject(xpathObj); return adapter; } /** * Parse the adapters. * */ static void parse_zonelist_adapters(xmlXPathContextPtr xpathCtx, zone_type* zone) { xmlChar* i_expr = (xmlChar*) "//Zone/Adapters/Input"; xmlChar* o_expr = (xmlChar*) "//Zone/Adapters/Output"; if (!xpathCtx || !zone) { return; } zone->adinbound = parse_zonelist_adapter(xpathCtx, i_expr, 1); zone->adoutbound = parse_zonelist_adapter(xpathCtx, o_expr, 0); return; } /** * Parse the zonelist file. * */ ods_status parse_zonelist_zones(void* zlist, const char* zlfile) { char* tag_name = NULL; char* zone_name = NULL; zone_type* new_zone = NULL; int ret = 0; int error = 0; xmlTextReaderPtr reader = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlChar* name_expr = (unsigned char*) "name"; xmlChar* policy_expr = (unsigned char*) "//Zone/Policy"; xmlChar* signconf_expr = (unsigned char*) "//Zone/SignerConfiguration"; if (!zlist || !zlfile) { return ODS_STATUS_ASSERT_ERR; } reader = xmlNewTextReaderFilename(zlfile); if (!reader) { ods_log_error("[%s] unable to parse zonelist: failed to open file %s", parser_str, zlfile); return ODS_STATUS_XML_ERR; } ret = xmlTextReaderRead(reader); while (ret == XML_READER_TYPE_ELEMENT) { tag_name = (char*) xmlTextReaderLocalName(reader); if (ods_strcmp(tag_name, "Zone") == 0 && ods_strcmp(tag_name, "ZoneList") != 0 && xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) { /* Found a zone */ zone_name = (char*) xmlTextReaderGetAttribute(reader, name_expr); if (!zone_name || strlen(zone_name) <= 0) { ods_log_alert("[%s] unable to extract zone name from " "zonelist %s, skipping...", parser_str, zlfile); if (zone_name) { free((void*) zone_name); } free((void*) tag_name); ret = xmlTextReaderRead(reader); continue; } /* Expand this node to get the rest of the info */ xmlTextReaderExpand(reader); doc = xmlTextReaderCurrentDoc(reader); if (doc) { xpathCtx = xmlXPathNewContext(doc); } if (doc == NULL || xpathCtx == NULL) { ods_log_alert("[%s] unable to read zone %s, skipping...", parser_str, zone_name); ret = xmlTextReaderRead(reader); free((void*) zone_name); free((void*) tag_name); continue; } /* That worked, now read out the contents... */ new_zone = zone_create(zone_name, LDNS_RR_CLASS_IN); if (new_zone) { new_zone->policy_name = parse_zonelist_element(xpathCtx, policy_expr); new_zone->signconf_filename = parse_zonelist_element(xpathCtx, signconf_expr); parse_zonelist_adapters(xpathCtx, new_zone); if (!new_zone->policy_name || !new_zone->signconf_filename || !new_zone->adinbound || !new_zone->adoutbound) { zone_cleanup(new_zone); new_zone = NULL; ods_log_crit("[%s] unable to create zone %s", parser_str, zone_name); error = 1; } else if (zonelist_add_zone((zonelist_type*) zlist, new_zone) == NULL) { ods_log_crit("[%s] unable to add zone %s", parser_str, zone_name); zone_cleanup(new_zone); new_zone = NULL; error = 1; } } else { ods_log_crit("[%s] unable to create zone %s", parser_str, zone_name); error = 1; } xmlXPathFreeContext(xpathCtx); xpathCtx = NULL; free((void*) zone_name); if (error) { free((void*) tag_name); tag_name = NULL; ret = 1; break; } ods_log_debug("[%s] zone %s added", parser_str, new_zone->name); } free((void*) tag_name); ret = xmlTextReaderRead(reader); } /* no more zones */ ods_log_debug("[%s] no more zones", parser_str); xmlFreeTextReader(reader); if (doc) { xmlFreeDoc(doc); } if (ret != 0) { ods_log_error("[%s] unable to parse zonelist: parse error in %s", parser_str, zlfile); return ODS_STATUS_PARSE_ERR; } return ODS_STATUS_OK; } opendnssec-1.4.3/signer/src/parser/addnsparser.c0000664000175000017500000002730212024053237016631 00000000000000/* * $Id: addnsparser.h 4661 2011-03-25 10:30:29Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing DNS Adapter. * */ #include "parser/addnsparser.h" #include "shared/log.h" #include #include #include #include static const char* parser_str = "parser"; /** * Parse the remote servers. * */ static acl_type* parse_addns_remote(allocator_type* allocator, const char* filename, tsig_type* tsig, char* expr) { acl_type* acl = NULL; acl_type* new_acl = NULL; int i = 0; char* address = NULL; char* port = NULL; char* key = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; if (!allocator || !filename || !expr) { return NULL; } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { ods_log_error("[%s] could not parse %s: xmlParseFile() failed", parser_str, expr); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed", parser_str, expr); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() " "failed", parser_str, expr); return NULL; } /* Parse interfaces */ if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { address = NULL; port = NULL; key = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Address")) { address = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Port")) { port = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Key")) { key = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (address) { new_acl = acl_create(allocator, address, port, key, tsig); if (!new_acl) { ods_log_error("[%s] unable to add server %s:%s %s to list " "%s: acl_create() failed", parser_str, address, port?port:"", key?key:"", (char*) expr); } else { new_acl->next = acl; acl = new_acl; ods_log_debug("[%s] added server %s:%s %s to list %s", parser_str, address, port?port:"", key?key:"", (char*) expr); } } free((void*)address); free((void*)port); free((void*)key); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return acl; } /** * Parse the ACL interfaces. * */ static acl_type* parse_addns_acl(allocator_type* allocator, const char* filename, tsig_type* tsig, char* expr) { acl_type* acl = NULL; acl_type* new_acl = NULL; int i = 0; char* prefix = NULL; char* key = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; if (!allocator || !filename || !expr) { return NULL; } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { ods_log_error("[%s] could not parse %s: xmlParseFile() failed", parser_str, expr); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed", parser_str, expr); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() " "failed", parser_str, expr); return NULL; } /* Parse interfaces */ if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { prefix = NULL; key = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Prefix")) { prefix = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Key")) { key = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (prefix || key) { new_acl = acl_create(allocator, prefix, NULL, key, tsig); if (!new_acl) { ods_log_error("[%s] unable to add acl for %s %s to list " "%s: acl_create() failed", parser_str, prefix?prefix:"", key?key:"", (char*) expr); } else { new_acl->next = acl; acl = new_acl; ods_log_debug("[%s] added %s %s interface to list %s", parser_str, prefix?prefix:"", key?key:"", (char*) expr); } } free((void*)prefix); free((void*)key); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return acl; } /** * Parse the TSIG credentials. * */ static tsig_type* parse_addns_tsig_static(allocator_type* allocator, const char* filename, char* expr) { tsig_type* tsig = NULL; tsig_type* new_tsig = NULL; int i = 0; char* name = NULL; char* algo = NULL; char* secret = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; if (!allocator || !filename || !expr) { return NULL; } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { ods_log_error("[%s] could not parse %s: xmlParseFile() failed", parser_str, expr); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed", parser_str, expr); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() " "failed", parser_str, expr); return NULL; } /* Parse interfaces */ if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { name = NULL; algo = NULL; secret = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Name")) { name = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Algorithm")) { algo = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Secret")) { secret = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (name && algo && secret) { new_tsig = tsig_create(allocator, name, algo, secret); if (!new_tsig) { ods_log_error("[%s] unable to add tsig %s: " "tsig_create() failed", parser_str, name); } else { new_tsig->next = tsig; tsig = new_tsig; ods_log_debug("[%s] added %s tsig to list %s", parser_str, name, (char*) expr); } } free((void*)name); free((void*)algo); free((void*)secret); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return tsig; } /** * Parse . * */ acl_type* parse_addns_request_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_remote(allocator, filename, tsig, "//Adapter/DNS/Inbound/RequestTransfer/Remote" ); } /** * Parse . * */ acl_type* parse_addns_allow_notify(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_acl(allocator, filename, tsig, "//Adapter/DNS/Inbound/AllowNotify/Peer" ); } /** * Parse . * */ acl_type* parse_addns_provide_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_acl(allocator, filename, tsig, "//Adapter/DNS/Outbound/ProvideTransfer/Peer" ); } /** * Parse . * */ acl_type* parse_addns_do_notify(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_remote(allocator, filename, tsig, "//Adapter/DNS/Outbound/Notify/Remote" ); } /** * Parse . * */ tsig_type* parse_addns_tsig(allocator_type* allocator, const char* filename) { return parse_addns_tsig_static(allocator, filename, "//Adapter/DNS/TSIG" ); } opendnssec-1.4.3/signer/src/parser/signconfparser.c0000664000175000017500000002657712225246663017375 00000000000000/* * $Id: signconfparser.c 7354 2013-10-09 12:36:03Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing signer configuration files. * */ #include "parser/confparser.h" #include "parser/signconfparser.h" #include "shared/duration.h" #include "shared/log.h" #include #include #include #include #include static const char* parser_str = "parser"; /** * Parse keys from the signer configuration file. * */ keylist_type* parse_sc_keys(void* sc, const char* cfgfile) { xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; key_type* new_key = NULL; keylist_type* kl = NULL; char* locator = NULL; char* flags = NULL; char* algorithm = NULL; int ksk, zsk, publish, i; if (!cfgfile || !sc) { return NULL; } /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] unable to parse : " "xmlParseFile() failed", parser_str); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] unable to parse : " "xmlXPathNewContext() failed", parser_str); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) "//SignerConfiguration/Zone/Keys/Key"; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] unable to parse : " "xmlXPathEvalExpression() failed", parser_str); return NULL; } /* Parse keys */ kl = keylist_create(sc); ods_log_assert(kl); if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { locator = NULL; flags = NULL; algorithm = NULL; ksk = 0; zsk = 0; publish = 0; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Locator")) { locator = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Algorithm")) { algorithm = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Flags")) { flags = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"KSK")) { ksk = 1; } else if (xmlStrEqual(curNode->name, (const xmlChar *)"ZSK")) { zsk = 1; } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Publish")) { publish = 1; } curNode = curNode->next; } if (locator && algorithm && flags) { /* search for duplicates */ new_key = keylist_lookup_by_locator(kl, locator); if (new_key && new_key->algorithm == (uint8_t) atoi(algorithm) && new_key->flags == (uint32_t) atoi(flags) && new_key->publish == publish && new_key->ksk == ksk && new_key->zsk == zsk) { /* duplicate */ ods_log_warning("[%s] unable to push duplicate key %s " "to keylist, skipping", parser_str, locator); } else { (void) keylist_push(kl, locator, (uint8_t) atoi(algorithm), (uint32_t) atoi(flags), publish, ksk, zsk); } } else { ods_log_error("[%s] unable to push key to keylist: " "is missing required elements, skipping", parser_str); } /* free((void*)locator); */ free((void*)algorithm); free((void*)flags); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return kl; } /** * Parse elements from the configuration file. * */ duration_type* parse_sc_sig_resign_interval(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Resign", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_refresh_interval(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Refresh", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_validity_default(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Validity/Default", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_validity_denial(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Validity/Denial", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_jitter(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Jitter", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_inception_offset(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/InceptionOffset", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_dnskey_ttl(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Keys/TTL", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_nsec3param_ttl(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/TTL", 0); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_soa_ttl(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/SOA/TTL", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_soa_min(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/SOA/Minimum", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } /** * Parse elements from the configuration file. * */ ldns_rr_type parse_sc_nsec_type(const char* cfgfile) { const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3", 0); if (str) { free((void*)str); return LDNS_RR_TYPE_NSEC3; } str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC", 0); if (str) { free((void*)str); return LDNS_RR_TYPE_NSEC; } return LDNS_RR_TYPE_FIRST; } /** * Parse elements from the configuration file. * */ uint32_t parse_sc_nsec3_algorithm(const char* cfgfile) { int ret = 0; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/Hash/Algorithm", 1); if (str) { if (strlen(str) > 0) { ret = atoi(str); } free((void*)str); } return ret; } uint32_t parse_sc_nsec3_iterations(const char* cfgfile) { int ret = 0; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/Hash/Iterations", 1); if (str) { if (strlen(str) > 0) { ret = atoi(str); } free((void*)str); } return ret; } int parse_sc_nsec3_optout(const char* cfgfile) { int ret = 0; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/OptOut", 0); if (str) { ret = 1; free((void*)str); } return ret; } /** * Parse elements from the configuration file. * */ const char* parse_sc_soa_serial(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//SignerConfiguration/Zone/SOA/Serial", 1); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_sc_nsec3_salt(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/Hash/Salt", 1); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } opendnssec-1.4.3/signer/src/parser/zonelistparser.h0000664000175000017500000000412211631413634017413 00000000000000/* * $Id: zonelistparser.h 5557 2011-09-06 12:52:44Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Parsing zonelist files. * */ #ifndef PARSER_ZONELISTPARSER_H #define PARSER_ZONELISTPARSER_H #include "adapter/adapter.h" #include "shared/allocator.h" #include "shared/status.h" #include #include /** * Parse adapter. * \param[in] xpathCtx XPath Context Pointer * \param[in] expr expression * \param[in] inbound true if Input Adapter * */ adapter_type* parse_zonelist_adapter(xmlXPathContextPtr xpathCtx, xmlChar* expr, int inbound); /** * Parse the zonelist file. * \param[in] zlist zone list storage * \param[in] zlfile zonelist file name * \return ods_status status * */ ods_status parse_zonelist_zones(void* zlist, const char* zlfile); #endif /* PARSER_ZONELISTPARSER_H */ opendnssec-1.4.3/signer/src/daemon/0000775000175000017500000000000012247571206014212 500000000000000opendnssec-1.4.3/signer/src/daemon/engine.c0000664000175000017500000010572112173457426015556 00000000000000/* * $Id: engine.c 7194 2013-07-23 10:46:46Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * The engine. * */ #include "config.h" #include "daemon/cfg.h" #include "daemon/engine.h" #include "daemon/signal.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/hsm.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/privdrop.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zonelist.h" #include "wire/tsig.h" #include #include #include #include #include #include #include #include #include #include #include #include #include static const char* engine_str = "engine"; /** * Create engine. * */ static engine_type* engine_create(void) { engine_type* engine; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create engine: allocator_create() " "failed", engine_str); return NULL; } engine = (engine_type*) allocator_alloc(allocator, sizeof(engine_type)); if (!engine) { ods_log_error("[%s] unable to create engine: allocator_alloc() " "failed", engine_str); allocator_cleanup(allocator); return NULL; } engine->allocator = allocator; engine->config = NULL; engine->workers = NULL; engine->drudgers = NULL; engine->cmdhandler = NULL; engine->cmdhandler_done = 0; engine->dnshandler = NULL; engine->xfrhandler = NULL; engine->pid = -1; engine->uid = -1; engine->gid = -1; engine->daemonize = 0; engine->need_to_exit = 0; engine->need_to_reload = 0; lock_basic_init(&engine->signal_lock); lock_basic_set(&engine->signal_cond); lock_basic_lock(&engine->signal_lock); engine->signal = SIGNAL_INIT; lock_basic_unlock(&engine->signal_lock); engine->zonelist = zonelist_create(engine->allocator); if (!engine->zonelist) { engine_cleanup(engine); return NULL; } engine->taskq = schedule_create(engine->allocator); if (!engine->taskq) { engine_cleanup(engine); return NULL; } engine->signq = fifoq_create(engine->allocator); if (!engine->signq) { engine_cleanup(engine); return NULL; } return engine; } /** * Start command handler. * */ static void* cmdhandler_thread_start(void* arg) { cmdhandler_type* cmd = (cmdhandler_type*) arg; ods_thread_blocksigs(); cmdhandler_start(cmd); return NULL; } static void engine_start_cmdhandler(engine_type* engine) { ods_log_assert(engine); ods_log_debug("[%s] start command handler", engine_str); engine->cmdhandler->engine = engine; ods_thread_create(&engine->cmdhandler->thread_id, cmdhandler_thread_start, engine->cmdhandler); return; } /** * Self pipe trick (see Unix Network Programming). * */ static int self_pipe_trick(engine_type* engine) { int sockfd, ret; struct sockaddr_un servaddr; const char* servsock_filename = ODS_SE_SOCKFILE; ods_log_assert(engine); ods_log_assert(engine->cmdhandler); sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd < 0) { ods_log_error("[%s] unable to connect to command handler: " "socket() failed (%s)", engine_str, strerror(errno)); return 1; } else { bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_UNIX; strncpy(servaddr.sun_path, servsock_filename, sizeof(servaddr.sun_path) - 1); ret = connect(sockfd, (const struct sockaddr*) &servaddr, sizeof(servaddr)); if (ret != 0) { ods_log_error("[%s] unable to connect to command handler: " "connect() failed (%s)", engine_str, strerror(errno)); close(sockfd); return 1; } else { /* self-pipe trick */ ods_writen(sockfd, "", 1); close(sockfd); } } return 0; } /** * Stop command handler. * */ static void engine_stop_cmdhandler(engine_type* engine) { ods_log_assert(engine); if (!engine->cmdhandler) { return; } ods_log_debug("[%s] stop command handler", engine_str); engine->cmdhandler->need_to_exit = 1; if (self_pipe_trick(engine) == 0) { while (!engine->cmdhandler_done) { ods_log_debug("[%s] waiting for command handler to exit...", engine_str); sleep(1); } } else { ods_log_error("[%s] command handler self pipe trick failed, " "unclean shutdown", engine_str); } return; } /** * Start/stop dnshandler. * */ static void* dnshandler_thread_start(void* arg) { dnshandler_type* dnshandler = (dnshandler_type*) arg; dnshandler_start(dnshandler); return NULL; } static void engine_start_dnshandler(engine_type* engine) { if (!engine || !engine->dnshandler) { return; } ods_log_debug("[%s] start dnshandler", engine_str); engine->dnshandler->engine = engine; ods_thread_create(&engine->dnshandler->thread_id, dnshandler_thread_start, engine->dnshandler); return; } static void engine_stop_dnshandler(engine_type* engine) { if (!engine || !engine->dnshandler || !engine->dnshandler->thread_id) { return; } ods_log_debug("[%s] stop dnshandler", engine_str); engine->dnshandler->need_to_exit = 1; dnshandler_signal(engine->dnshandler); ods_log_debug("[%s] join dnshandler", engine_str); ods_thread_join(engine->dnshandler->thread_id); engine->dnshandler->engine = NULL; return; } /** * Start/stop xfrhandler. * */ static void* xfrhandler_thread_start(void* arg) { xfrhandler_type* xfrhandler = (xfrhandler_type*) arg; xfrhandler_start(xfrhandler); return NULL; } static void engine_start_xfrhandler(engine_type* engine) { if (!engine || !engine->xfrhandler) { return; } ods_log_debug("[%s] start xfrhandler", engine_str); engine->xfrhandler->engine = engine; ods_thread_create(&engine->xfrhandler->thread_id, xfrhandler_thread_start, engine->xfrhandler); /* This might be the wrong place to mark the xfrhandler started but * if its isn't done here we might try to shutdown and stop it before * it has marked itself started */ engine->xfrhandler->started = 1; return; } static void engine_stop_xfrhandler(engine_type* engine) { if (!engine || !engine->xfrhandler) { return; } ods_log_debug("[%s] stop xfrhandler", engine_str); engine->xfrhandler->need_to_exit = 1; xfrhandler_signal(engine->xfrhandler); ods_log_debug("[%s] join xfrhandler", engine_str); if (engine->xfrhandler->started) { ods_thread_join(engine->xfrhandler->thread_id); engine->xfrhandler->started = 0; } engine->xfrhandler->engine = NULL; return; } /** * Drop privileges. * */ static ods_status engine_privdrop(engine_type* engine) { ods_status status = ODS_STATUS_OK; uid_t uid = -1; gid_t gid = -1; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] drop privileges", engine_str); if (engine->config->username && engine->config->group) { ods_log_verbose("[%s] drop privileges to user %s, group %s", engine_str, engine->config->username, engine->config->group); } else if (engine->config->username) { ods_log_verbose("[%s] drop privileges to user %s", engine_str, engine->config->username); } else if (engine->config->group) { ods_log_verbose("[%s] drop privileges to group %s", engine_str, engine->config->group); } if (engine->config->chroot) { ods_log_verbose("[%s] chroot to %s", engine_str, engine->config->chroot); } status = privdrop(engine->config->username, engine->config->group, engine->config->chroot, &uid, &gid); engine->uid = uid; engine->gid = gid; privclose(engine->config->username, engine->config->group); return status; } /** * Start/stop workers. * */ static void engine_create_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_assert(engine->allocator); engine->workers = (worker_type**) allocator_alloc(engine->allocator, ((size_t)engine->config->num_worker_threads) * sizeof(worker_type*)); for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { engine->workers[i] = worker_create(engine->allocator, i, WORKER_WORKER); } return; } static void engine_create_drudgers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_assert(engine->allocator); engine->drudgers = (worker_type**) allocator_alloc(engine->allocator, ((size_t)engine->config->num_signer_threads) * sizeof(worker_type*)); for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { engine->drudgers[i] = worker_create(engine->allocator, i, WORKER_DRUDGER); } return; } static void* worker_thread_start(void* arg) { worker_type* worker = (worker_type*) arg; ods_thread_blocksigs(); worker_start(worker); return NULL; } static void engine_start_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] start workers", engine_str); for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { engine->workers[i]->need_to_exit = 0; engine->workers[i]->engine = (void*) engine; ods_thread_create(&engine->workers[i]->thread_id, worker_thread_start, engine->workers[i]); } return; } void engine_start_drudgers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] start drudgers", engine_str); for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { engine->drudgers[i]->need_to_exit = 0; engine->drudgers[i]->engine = (void*) engine; ods_thread_create(&engine->drudgers[i]->thread_id, worker_thread_start, engine->drudgers[i]); } return; } static void engine_stop_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] stop workers", engine_str); /* tell them to exit and wake up sleepyheads */ for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { engine->workers[i]->need_to_exit = 1; worker_wakeup(engine->workers[i]); } ods_log_debug("[%s] notify workers", engine_str); worker_notify_all(&engine->signq->q_lock, &engine->signq->q_nonfull); /* head count */ for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { ods_log_debug("[%s] join worker %i", engine_str, i+1); ods_thread_join(engine->workers[i]->thread_id); engine->workers[i]->engine = NULL; } return; } void engine_stop_drudgers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] stop drudgers", engine_str); /* tell them to exit and wake up sleepyheads */ for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { engine->drudgers[i]->need_to_exit = 1; } ods_log_debug("[%s] notify drudgers", engine_str); worker_notify_all(&engine->signq->q_lock, &engine->signq->q_threshold); /* head count */ for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { ods_log_debug("[%s] join drudger %i", engine_str, i+1); ods_thread_join(engine->drudgers[i]->thread_id); engine->drudgers[i]->engine = NULL; } return; } /** * Wake up all workers. * */ void engine_wakeup_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] wake up workers", engine_str); /* wake up sleepyheads */ for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { worker_wakeup(engine->workers[i]); } return; } /** * Set up engine. * */ static ods_status engine_setup(engine_type* engine) { ods_status status = ODS_STATUS_OK; struct sigaction action; int result = 0; int sockets[2] = {0,0}; ods_log_debug("[%s] setup signer engine", engine_str); if (!engine || !engine->config) { return ODS_STATUS_ASSERT_ERR; } /* set edns */ edns_init(&engine->edns, EDNS_MAX_MESSAGE_LEN); /* create command handler (before chowning socket file) */ engine->cmdhandler = cmdhandler_create(engine->allocator, engine->config->clisock_filename); if (!engine->cmdhandler) { return ODS_STATUS_CMDHANDLER_ERR; } engine->dnshandler = dnshandler_create(engine->allocator, engine->config->interfaces); engine->xfrhandler = xfrhandler_create(engine->allocator); if (!engine->xfrhandler) { return ODS_STATUS_XFRHANDLER_ERR; } if (engine->dnshandler) { if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets) == -1) { return ODS_STATUS_XFRHANDLER_ERR; } engine->xfrhandler->dnshandler.fd = sockets[0]; engine->dnshandler->xfrhandler.fd = sockets[1]; status = dnshandler_listen(engine->dnshandler); if (status != ODS_STATUS_OK) { ods_log_error("[%s] setup: unable to listen to sockets (%s)", engine_str, ods_status2str(status)); } } /* privdrop */ engine->uid = privuid(engine->config->username); engine->gid = privgid(engine->config->group); /* TODO: does piddir exists? */ /* remove the chown stuff: piddir? */ ods_chown(engine->config->pid_filename, engine->uid, engine->gid, 1); ods_chown(engine->config->clisock_filename, engine->uid, engine->gid, 0); ods_chown(engine->config->working_dir, engine->uid, engine->gid, 0); if (engine->config->log_filename && !engine->config->use_syslog) { ods_chown(engine->config->log_filename, engine->uid, engine->gid, 0); } if (engine->config->working_dir && chdir(engine->config->working_dir) != 0) { ods_log_error("[%s] setup: unable to chdir to %s (%s)", engine_str, engine->config->working_dir, strerror(errno)); return ODS_STATUS_CHDIR_ERR; } if (engine_privdrop(engine) != ODS_STATUS_OK) { return ODS_STATUS_PRIVDROP_ERR; } /* daemonize */ if (engine->daemonize) { switch ((engine->pid = fork())) { case -1: /* error */ ods_log_error("[%s] setup: unable to fork daemon (%s)", engine_str, strerror(errno)); return ODS_STATUS_FORK_ERR; case 0: /* child */ break; default: /* parent */ engine_cleanup(engine); engine = NULL; xmlCleanupParser(); xmlCleanupGlobals(); xmlCleanupThreads(); exit(0); } if (setsid() == -1) { ods_log_error("[%s] setup: unable to setsid daemon (%s)", engine_str, strerror(errno)); return ODS_STATUS_SETSID_ERR; } } engine->pid = getpid(); ods_log_verbose("[%s] running as pid %lu", engine_str, (unsigned long) engine->pid); /* catch signals */ signal_set_engine(engine); action.sa_handler = signal_handler; sigfillset(&action.sa_mask); action.sa_flags = 0; sigaction(SIGTERM, &action, NULL); sigaction(SIGHUP, &action, NULL); sigaction(SIGINT, &action, NULL); sigaction(SIGILL, &action, NULL); sigaction(SIGUSR1, &action, NULL); sigaction(SIGALRM, &action, NULL); sigaction(SIGCHLD, &action, NULL); action.sa_handler = SIG_IGN; sigaction(SIGPIPE, &action, NULL); /* set up hsm */ /* LEAK */ result = lhsm_open(engine->config->cfg_filename); if (result != HSM_OK) { return ODS_STATUS_HSM_ERR; } /* create workers/drudgers */ engine_create_workers(engine); engine_create_drudgers(engine); /* start cmd/dns/xfr handlers */ engine_start_cmdhandler(engine); engine_start_dnshandler(engine); engine_start_xfrhandler(engine); tsig_handler_init(engine->allocator); /* write pidfile */ if (util_write_pidfile(engine->config->pid_filename, engine->pid) == -1) { hsm_close(); return ODS_STATUS_WRITE_PIDFILE_ERR; } /* setup done */ return ODS_STATUS_OK; } /** * Make sure that all zones have been worked on at least once. * */ static int engine_all_zones_processed(engine_type* engine) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; ods_log_assert(engine); ods_log_assert(engine->zonelist); ods_log_assert(engine->zonelist->zones); node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->key; ods_log_assert(zone); ods_log_assert(zone->db); if (!zone->db->is_processed) { return 0; } node = ldns_rbtree_next(node); } return 1; } /** * Run engine, run!. * */ static void engine_run(engine_type* engine, int single_run) { if (!engine) { return; } engine_start_workers(engine); engine_start_drudgers(engine); lock_basic_lock(&engine->signal_lock); engine->signal = SIGNAL_RUN; lock_basic_unlock(&engine->signal_lock); while (!engine->need_to_exit && !engine->need_to_reload) { lock_basic_lock(&engine->signal_lock); engine->signal = signal_capture(engine->signal); switch (engine->signal) { case SIGNAL_RUN: ods_log_assert(1); break; case SIGNAL_RELOAD: engine->need_to_reload = 1; break; case SIGNAL_SHUTDOWN: engine->need_to_exit = 1; break; default: ods_log_warning("[%s] invalid signal %d captured, " "keep running", engine_str, signal); engine->signal = SIGNAL_RUN; break; } lock_basic_unlock(&engine->signal_lock); if (single_run) { engine->need_to_exit = engine_all_zones_processed(engine); } lock_basic_lock(&engine->signal_lock); if (engine->signal == SIGNAL_RUN && !single_run) { ods_log_debug("[%s] taking a break", engine_str); lock_basic_sleep(&engine->signal_cond, &engine->signal_lock, 3600); } lock_basic_unlock(&engine->signal_lock); } ods_log_debug("[%s] signer halted", engine_str); engine_stop_drudgers(engine); engine_stop_workers(engine); (void)lhsm_reopen(engine->config->cfg_filename); return; } /** * Parse notify command. * */ static void set_notify_ns(zone_type* zone, const char* cmd) { const char* str = NULL; const char* str2 = NULL; char* token = NULL; ods_log_assert(cmd); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adoutbound); if (zone->adoutbound->type == ADAPTER_FILE) { str = ods_replace(cmd, "%zonefile", zone->adoutbound->configstr); if (!str) { ods_log_error("[%s] unable to set notify ns: replace zonefile failed", engine_str); } str2 = ods_replace(str, "%zone", zone->name); free((void*)str); } else { str2 = ods_replace(cmd, "%zone", zone->name); } if (str2) { ods_str_trim((char*) str2); str = str2; if (*str) { token = NULL; while ((token = strtok((char*) str, " "))) { if (*token) { ods_str_list_add(&zone->notify_args, token); } str = NULL; } } zone->notify_command = (char*) str2; zone->notify_ns = zone->notify_args[0]; ods_log_debug("[%s] set notify ns: %s", engine_str, zone->notify_ns); } else { ods_log_error("[%s] unable to set notify ns: replace zone failed", engine_str); } return; } /** * Update DNS configuration for zone. * */ static int dnsconfig_zone(engine_type* engine, zone_type* zone) { int numdns = 0; ods_log_assert(engine); ods_log_assert(engine->xfrhandler); ods_log_assert(engine->xfrhandler->netio); ods_log_assert(zone); ods_log_assert(zone->adinbound); ods_log_assert(zone->adoutbound); ods_log_assert(zone->name); if (zone->adinbound->type == ADAPTER_DNS) { /* zone transfer handler */ if (!zone->xfrd) { ods_log_debug("[%s] add transfer handler for zone %s", engine_str, zone->name); zone->xfrd = xfrd_create((void*) engine->xfrhandler, (void*) zone); ods_log_assert(zone->xfrd); netio_add_handler(engine->xfrhandler->netio, &zone->xfrd->handler); } else if (!zone->xfrd->serial_disk_acquired) { xfrd_set_timer_now(zone->xfrd); } numdns++; } else if (zone->xfrd) { netio_remove_handler(engine->xfrhandler->netio, &zone->xfrd->handler); xfrd_cleanup(zone->xfrd); zone->xfrd = NULL; } if (zone->adoutbound->type == ADAPTER_DNS) { /* notify handler */ if (!zone->notify) { ods_log_debug("[%s] add notify handler for zone %s", engine_str, zone->name); zone->notify = notify_create((void*) engine->xfrhandler, (void*) zone); ods_log_assert(zone->notify); netio_add_handler(engine->xfrhandler->netio, &zone->notify->handler); } numdns++; } else if (zone->notify) { netio_remove_handler(engine->xfrhandler->netio, &zone->notify->handler); notify_cleanup(zone->notify); zone->notify = NULL; } return numdns; } /** * Update zones. * */ void engine_update_zones(engine_type* engine, ods_status zl_changed) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; zone_type* delzone = NULL; task_type* task = NULL; ods_status status = ODS_STATUS_OK; unsigned wake_up = 0; int warnings = 0; time_t now = 0; if (!engine || !engine->zonelist || !engine->zonelist->zones) { return; } now = time_now(); ods_log_debug("[%s] commit zone list changes", engine_str); lock_basic_lock(&engine->zonelist->zl_lock); node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->data; task = NULL; /* reset task */ if (zone->zl_status == ZONE_ZL_REMOVED) { node = ldns_rbtree_next(node); lock_basic_lock(&zone->zone_lock); delzone = zonelist_del_zone(engine->zonelist, zone); if (delzone) { lock_basic_lock(&engine->taskq->schedule_lock); task = unschedule_task(engine->taskq, (task_type*) zone->task); lock_basic_unlock(&engine->taskq->schedule_lock); } task_cleanup(task); task = NULL; lock_basic_unlock(&zone->zone_lock); netio_remove_handler(engine->xfrhandler->netio, &zone->xfrd->handler); zone_cleanup(zone); zone = NULL; continue; } else if (zone->zl_status == ZONE_ZL_ADDED) { lock_basic_lock(&zone->zone_lock); ods_log_assert(!zone->task); /* set notify nameserver command */ if (engine->config->notify_command && !zone->notify_ns) { set_notify_ns(zone, engine->config->notify_command); } /* create task */ task = task_create(TASK_SIGNCONF, now, zone); lock_basic_unlock(&zone->zone_lock); if (!task) { ods_log_crit("[%s] unable to create task for zone %s: " "task_create() failed", engine_str, zone->name); node = ldns_rbtree_next(node); continue; } } /* load adapter config */ status = adapter_load_config(zone->adinbound); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to load config for inbound adapter " "for zone %s: %s", engine_str, zone->name, ods_status2str(status)); } status = adapter_load_config(zone->adoutbound); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to load config for outbound adapter " "for zone %s: %s", engine_str, zone->name, ods_status2str(status)); } /* for dns adapters */ warnings += dnsconfig_zone(engine, zone); if (zone->zl_status == ZONE_ZL_ADDED) { ods_log_assert(task); lock_basic_lock(&zone->zone_lock); zone->task = task; lock_basic_unlock(&zone->zone_lock); lock_basic_lock(&engine->taskq->schedule_lock); status = schedule_task(engine->taskq, task, 0); lock_basic_unlock(&engine->taskq->schedule_lock); } else if (zl_changed == ODS_STATUS_OK) { /* always try to update signconf */ lock_basic_lock(&zone->zone_lock); status = zone_reschedule_task(zone, engine->taskq, TASK_SIGNCONF); lock_basic_unlock(&zone->zone_lock); } if (status != ODS_STATUS_OK) { ods_log_crit("[%s] unable to schedule task for zone %s: %s", engine_str, zone->name, ods_status2str(status)); } else { wake_up = 1; zone->zl_status = ZONE_ZL_OK; } node = ldns_rbtree_next(node); } lock_basic_unlock(&engine->zonelist->zl_lock); if (engine->dnshandler) { dnshandler_fwd_notify(engine->dnshandler, (uint8_t*) ODS_SE_NOTIFY_CMD, strlen(ODS_SE_NOTIFY_CMD)); } else if (warnings) { ods_log_warning("[%s] no dnshandler/listener configured, but zones " "are configured with dns adapters: notify and zone transfer " "requests will not work properly", engine_str); } if (wake_up) { engine_wakeup_workers(engine); } return; } /** * Try to recover from the backup files. * */ static ods_status engine_recover(engine_type* engine) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; ods_status status = ODS_STATUS_OK; ods_status result = ODS_STATUS_UNCHANGED; if (!engine || !engine->zonelist || !engine->zonelist->zones) { ods_log_error("[%s] cannot recover zones: no engine or zonelist", engine_str); return ODS_STATUS_ERR; /* no need to update zones */ } ods_log_assert(engine); ods_log_assert(engine->zonelist); ods_log_assert(engine->zonelist->zones); lock_basic_lock(&engine->zonelist->zl_lock); /* [LOCK] zonelist */ node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->data; ods_log_assert(zone->zl_status == ZONE_ZL_ADDED); lock_basic_lock(&zone->zone_lock); status = zone_recover2(zone); if (status == ODS_STATUS_OK) { ods_log_assert(zone->task); ods_log_assert(zone->db); ods_log_assert(zone->signconf); /* notify nameserver */ if (engine->config->notify_command && !zone->notify_ns) { set_notify_ns(zone, engine->config->notify_command); } /* schedule task */ lock_basic_lock(&engine->taskq->schedule_lock); /* [LOCK] schedule */ status = schedule_task(engine->taskq, (task_type*) zone->task, 0); /* [UNLOCK] schedule */ lock_basic_unlock(&engine->taskq->schedule_lock); if (status != ODS_STATUS_OK) { ods_log_crit("[%s] unable to schedule task for zone %s: %s", engine_str, zone->name, ods_status2str(status)); task_cleanup((task_type*) zone->task); zone->task = NULL; result = ODS_STATUS_OK; /* will trigger update zones */ } else { ods_log_debug("[%s] recovered zone %s", engine_str, zone->name); /* recovery done */ zone->zl_status = ZONE_ZL_OK; } } else { if (status != ODS_STATUS_UNCHANGED) { ods_log_warning("[%s] unable to recover zone %s from backup," " performing full sign", engine_str, zone->name); } result = ODS_STATUS_OK; /* will trigger update zones */ } lock_basic_unlock(&zone->zone_lock); node = ldns_rbtree_next(node); } /* [UNLOCK] zonelist */ lock_basic_unlock(&engine->zonelist->zl_lock); return result; } /** * Start engine. * */ void engine_start(const char* cfgfile, int cmdline_verbosity, int daemonize, int info, int single_run) { engine_type* engine = NULL; int use_syslog = 0; ods_status zl_changed = ODS_STATUS_UNCHANGED; ods_status status = ODS_STATUS_OK; int close_hsm = 0; ods_log_assert(cfgfile); ods_log_init(NULL, use_syslog, cmdline_verbosity); ods_log_verbose("[%s] starting signer", engine_str); /* initialize */ xmlInitGlobals(); xmlInitParser(); xmlInitThreads(); engine = engine_create(); if (!engine) { ods_fatal_exit("[%s] create failed", engine_str); return; } engine->daemonize = daemonize; /* config */ engine->config = engine_config(engine->allocator, cfgfile, cmdline_verbosity); status = engine_config_check(engine->config); if (status != ODS_STATUS_OK) { ods_log_error("[%s] cfgfile %s has errors", engine_str, cfgfile); goto earlyexit; } if (info) { engine_config_print(stdout, engine->config); /* for debugging */ goto earlyexit; } /* check pidfile */ if (!util_check_pidfile(engine->config->pid_filename)) { exit(1); } /* open log */ ods_log_init(engine->config->log_filename, engine->config->use_syslog, engine->config->verbosity); /* setup */ tzset(); /* for portability */ status = engine_setup(engine); if (status != ODS_STATUS_OK) { ods_log_error("[%s] setup failed: %s", engine_str, ods_status2str(status)); engine->need_to_exit = 1; if (status != ODS_STATUS_WRITE_PIDFILE_ERR) { /* command handler had not yet been started */ engine->cmdhandler_done = 1; } } else { /* setup ok, mark hsm open */ close_hsm = 1; } /* run */ while (engine->need_to_exit == 0) { /* update zone list */ lock_basic_lock(&engine->zonelist->zl_lock); zl_changed = zonelist_update(engine->zonelist, engine->config->zonelist_filename); engine->zonelist->just_removed = 0; engine->zonelist->just_added = 0; engine->zonelist->just_updated = 0; lock_basic_unlock(&engine->zonelist->zl_lock); /* start/reload */ if (engine->need_to_reload) { ods_log_info("[%s] signer reloading", engine_str); engine->need_to_reload = 0; } else { ods_log_info("[%s] signer started (version %s), pid %u", engine_str, PACKAGE_VERSION, engine->pid); zl_changed = engine_recover(engine); } if (zl_changed == ODS_STATUS_OK || zl_changed == ODS_STATUS_UNCHANGED) { engine_update_zones(engine, zl_changed); } engine_run(engine, single_run); } /* shutdown */ ods_log_info("[%s] signer shutdown", engine_str); if (close_hsm) { ods_log_verbose("[%s] close hsm", engine_str); hsm_close(); } if (!engine->cmdhandler_done) { engine_stop_xfrhandler(engine); engine_stop_dnshandler(engine); engine_stop_cmdhandler(engine); } earlyexit: if (engine && engine->config) { if (engine->config->pid_filename) { (void)unlink(engine->config->pid_filename); } if (engine->config->clisock_filename) { (void)unlink(engine->config->clisock_filename); } } tsig_handler_cleanup(); engine_cleanup(engine); engine = NULL; ods_log_close(); xmlCleanupParser(); xmlCleanupGlobals(); xmlCleanupThreads(); return; } /** * Clean up engine. * */ void engine_cleanup(engine_type* engine) { size_t i = 0; allocator_type* allocator; cond_basic_type signal_cond; lock_basic_type signal_lock; if (!engine) { return; } allocator = engine->allocator; signal_cond = engine->signal_cond; signal_lock = engine->signal_lock; if (engine->workers && engine->config) { for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { worker_cleanup(engine->workers[i]); } allocator_deallocate(allocator, (void*) engine->workers); } if (engine->drudgers && engine->config) { for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { worker_cleanup(engine->drudgers[i]); } allocator_deallocate(allocator, (void*) engine->drudgers); } zonelist_cleanup(engine->zonelist); schedule_cleanup(engine->taskq); fifoq_cleanup(engine->signq); cmdhandler_cleanup(engine->cmdhandler); dnshandler_cleanup(engine->dnshandler); xfrhandler_cleanup(engine->xfrhandler); engine_config_cleanup(engine->config); allocator_deallocate(allocator, (void*) engine); lock_basic_destroy(&signal_lock); lock_basic_off(&signal_cond); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/daemon/dnshandler.h0000664000175000017500000000617312073770157016437 00000000000000/* * $Id: dnshandler.h 4518 2011-02-24 15:39:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * DNS handler. * */ #ifndef DAEMON_DNSHANDLER_H #define DAEMON_DNSHANDLER_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "wire/listener.h" #include "wire/netio.h" #include "wire/query.h" #include "wire/sock.h" #include #define ODS_SE_NOTIFY_CMD "NOTIFY" #define ODS_SE_MAX_HANDLERS 5 typedef struct dnshandler_struct dnshandler_type; struct dnshandler_struct { allocator_type* allocator; ods_thread_type thread_id; void* engine; listener_type* interfaces; socklist_type* socklist; netio_type* netio; query_type* query; netio_handler_type xfrhandler; unsigned need_to_exit; }; /** * Create dns handler. * \param[in] allocator memory allocator * \param[in] interfaces list of interfaces * \return dnshandler_type* created dns handler * */ dnshandler_type* dnshandler_create(allocator_type* allocator, listener_type* interfaces); /** * Start dns handler listener. * \param[in] dnshandler_type* dns handler * \return ods_status status * */ ods_status dnshandler_listen(dnshandler_type* dnshandler); /** * Start dns handler. * \param[in] dnshandler_type* dns handler * */ void dnshandler_start(dnshandler_type* dnshandler); /** * Signal dns handler. * \param[in] dnshandler_type* dns handler * */ void dnshandler_signal(dnshandler_type* dnshandler); /** * Forward notify to zone transfer handler. * \param[in] dnshandler_type* dns handler * \param[in] pkt notify packet * \param[in] len packet length * */ void dnshandler_fwd_notify(dnshandler_type* dnshandler, uint8_t* pkt, size_t len); /** * Cleanup dns handler. * \param[in] dnshandler_type* dns handler * */ void dnshandler_cleanup(dnshandler_type* dnshandler); #endif /* DAEMON_DNSHANDLER_H */ opendnssec-1.4.3/signer/src/daemon/dnshandler.c0000664000175000017500000002310012073770157016417 00000000000000/* * $Id: dnshandler.c 4518 2011-02-24 15:39:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * DNS handler. * */ #include "config.h" #include "daemon/dnshandler.h" #include "daemon/engine.h" #include "shared/status.h" #include "wire/buffer.h" #include #include static const char* dnsh_str = "dnshandler"; static void dnshandler_handle_xfr(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Create dns handler. * */ dnshandler_type* dnshandler_create(allocator_type* allocator, listener_type* interfaces) { dnshandler_type* dnsh = NULL; if (!allocator || !interfaces || interfaces->count <= 0) { return NULL; } dnsh = (dnshandler_type*) allocator_alloc(allocator, sizeof(dnshandler_type)); if (!dnsh) { ods_log_error("[%s] unable to create dnshandler: " "allocator_alloc() failed", dnsh_str); return NULL; } dnsh->allocator = allocator; dnsh->need_to_exit = 0; dnsh->engine = NULL; dnsh->interfaces = interfaces; dnsh->socklist = NULL; dnsh->netio = NULL; dnsh->query = NULL; /* setup */ dnsh->socklist = (socklist_type*) allocator_alloc(allocator, sizeof(socklist_type)); if (!dnsh->socklist) { ods_log_error("[%s] unable to create socklist: " "allocator_alloc() failed", dnsh_str); dnshandler_cleanup(dnsh); return NULL; } dnsh->netio = netio_create(allocator); if (!dnsh->netio) { ods_log_error("[%s] unable to create dnshandler: " "netio_create() failed", dnsh_str); dnshandler_cleanup(dnsh); return NULL; } dnsh->query = query_create(); if (!dnsh->query) { ods_log_error("[%s] unable to create dnshandler: " "query_create() failed", dnsh_str); dnshandler_cleanup(dnsh); return NULL; } dnsh->xfrhandler.fd = -1; dnsh->xfrhandler.user_data = (void*) dnsh; dnsh->xfrhandler.timeout = 0; dnsh->xfrhandler.event_types = NETIO_EVENT_READ; dnsh->xfrhandler.event_handler = dnshandler_handle_xfr; return dnsh; } /** * Start dns handler listener. * */ ods_status dnshandler_listen(dnshandler_type* dnshandler) { ods_status status = ODS_STATUS_OK; ods_log_assert(dnshandler); status = sock_listen(dnshandler->socklist, dnshandler->interfaces); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to start: sock_listen() " "failed (%s)", dnsh_str, ods_status2str(status)); dnshandler->thread_id = 0; } return status; } /** * Start dns handler. * */ void dnshandler_start(dnshandler_type* dnshandler) { size_t i = 0; engine_type* engine = NULL; netio_handler_type* tcp_accept_handlers = NULL; ods_log_assert(dnshandler); ods_log_assert(dnshandler->engine); ods_log_debug("[%s] start", dnsh_str); /* udp */ for (i=0; i < dnshandler->interfaces->count; i++) { struct udp_data* data = NULL; netio_handler_type* handler = NULL; data = (struct udp_data*) allocator_alloc(dnshandler->allocator, sizeof(struct udp_data)); if (!data) { ods_log_error("[%s] unable to start: allocator_alloc() " "failed", dnsh_str); dnshandler->thread_id = 0; engine->need_to_exit = 1; break; } data->query = dnshandler->query; data->engine = dnshandler->engine; data->socket = &dnshandler->socklist->udp[i]; handler = (netio_handler_type*) allocator_alloc( dnshandler->allocator, sizeof(netio_handler_type)); if (!handler) { ods_log_error("[%s] unable to start: allocator_alloc() " "failed", dnsh_str); allocator_deallocate(dnshandler->allocator, (void*)data); dnshandler->thread_id = 0; engine->need_to_exit = 1; break; } handler->fd = dnshandler->socklist->udp[i].s; handler->timeout = NULL; handler->user_data = data; handler->event_types = NETIO_EVENT_READ; handler->event_handler = sock_handle_udp; ods_log_debug("[%s] add udp network handler fd %u", dnsh_str, (unsigned) handler->fd); netio_add_handler(dnshandler->netio, handler); } /* tcp */ tcp_accept_handlers = (netio_handler_type*) allocator_alloc( dnshandler->allocator, dnshandler->interfaces->count * sizeof(netio_handler_type)); for (i=0; i < dnshandler->interfaces->count; i++) { struct tcp_accept_data* data = NULL; netio_handler_type* handler = NULL; data = (struct tcp_accept_data*) allocator_alloc( dnshandler->allocator, sizeof(struct tcp_accept_data)); if (!data) { ods_log_error("[%s] unable to start: allocator_alloc() " "failed", dnsh_str); dnshandler->thread_id = 0; engine->need_to_exit = 1; return; } data->engine = dnshandler->engine; data->socket = &dnshandler->socklist->udp[i]; data->tcp_accept_handler_count = dnshandler->interfaces->count; data->tcp_accept_handlers = tcp_accept_handlers; handler = &tcp_accept_handlers[i]; handler->fd = dnshandler->socklist->tcp[i].s; handler->timeout = NULL; handler->user_data = data; handler->event_types = NETIO_EVENT_READ; handler->event_handler = sock_handle_tcp_accept; ods_log_debug("[%s] add tcp network handler fd %u", dnsh_str, (unsigned) handler->fd); netio_add_handler(dnshandler->netio, handler); } /* service */ while (dnshandler->need_to_exit == 0) { ods_log_deeebug("[%s] netio dispatch", dnsh_str); if (netio_dispatch(dnshandler->netio, NULL, NULL) == -1) { if (errno != EINTR) { ods_log_error("[%s] unable to dispatch netio: %s", dnsh_str, strerror(errno)); break; } } } /* shutdown */ ods_log_debug("[%s] shutdown", dnsh_str); for (i=0; i < dnshandler->interfaces->count; i++) { if (dnshandler->socklist->udp[i].s != -1) { close(dnshandler->socklist->udp[i].s); freeaddrinfo((void*)dnshandler->socklist->udp[i].addr); } if (dnshandler->socklist->tcp[i].s != -1) { close(dnshandler->socklist->tcp[i].s); freeaddrinfo((void*)dnshandler->socklist->tcp[i].addr); } } return; } /** * Signal dns handler. * */ void dnshandler_signal(dnshandler_type* dnshandler) { if (dnshandler && dnshandler->thread_id) { ods_thread_kill(dnshandler->thread_id, SIGHUP); } return; } /** * Forward notify to zone transfer handler. * */ void dnshandler_fwd_notify(dnshandler_type* dnshandler, uint8_t* pkt, size_t len) { ssize_t nb = 0; ods_log_assert(dnshandler); ods_log_assert(pkt); nb = send(dnshandler->xfrhandler.fd, (const void*) pkt, len, 0); if (nb < 0) { ods_log_error("[%s] unable to forward notify: send() failed (%s)", dnsh_str, strerror(errno)); } else { ods_log_debug("[%s] forwarded notify: %u bytes sent", dnsh_str, nb); } return; } /** * Handle forwarded dns packets. * */ static void dnshandler_handle_xfr(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { dnshandler_type* dnshandler = NULL; uint8_t buf[MAX_PACKET_SIZE]; ssize_t received = 0; if (!handler) { return; } dnshandler = (dnshandler_type*) handler->user_data; ods_log_assert(event_types & NETIO_EVENT_READ); ods_log_debug("[%s] read forwarded xfr packet", dnsh_str); received = read(dnshandler->xfrhandler.fd, &buf, MAX_PACKET_SIZE); if (received == -1) { ods_log_debug("[%s] unable to forward xfr packet: %s", dnsh_str, strerror(errno)); } return; } /** * Cleanup dns handler. * */ void dnshandler_cleanup(dnshandler_type* dnshandler) { allocator_type* allocator = NULL; if (!dnshandler) { return; } allocator = dnshandler->allocator; netio_cleanup(dnshandler->netio); query_cleanup(dnshandler->query); allocator_deallocate(allocator, (void*) dnshandler->socklist); allocator_deallocate(allocator, (void*) dnshandler); return; } opendnssec-1.4.3/signer/src/daemon/xfrhandler.h0000664000175000017500000000631311750500440016431 00000000000000/* * $Id: xfrhandler.h 4518 2011-02-24 15:39:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone transfer handler. * */ #ifndef DAEMON_XFRHANDLER_H #define DAEMON_XFRHANDLER_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "wire/buffer.h" #include "wire/netio.h" #include "wire/notify.h" #include "wire/tcpset.h" #include "wire/xfrd.h" /** * Zone transfer handler. * */ typedef struct xfrhandler_struct xfrhandler_type; struct xfrhandler_struct { allocator_type* allocator; /* Engine reference */ ods_thread_type thread_id; void* engine; /* Start time */ time_t start_time; time_t current_time; /* Network support */ netio_type* netio; tcp_set_type* tcp_set; buffer_type* packet; xfrd_type* udp_waiting_first; xfrd_type* udp_waiting_last; size_t udp_use_num; notify_type* notify_waiting_first; notify_type* notify_waiting_last; int notify_udp_num; netio_handler_type dnshandler; unsigned got_time : 1; unsigned need_to_exit : 1; unsigned started : 1; }; /** * Create zone transfer handler. * \param[in] allocator memory allocator * \return xfrhandler_type* created zoned transfer handler * */ xfrhandler_type* xfrhandler_create(allocator_type* allocator); /** * Start zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * */ void xfrhandler_start(xfrhandler_type* xfrhandler); /** * Get current time from the zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * \return time_t current time * */ time_t xfrhandler_time(xfrhandler_type* xfrhandler); /** * Signal zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * */ void xfrhandler_signal(xfrhandler_type* xfrhandler); /** * Cleanup zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * */ void xfrhandler_cleanup(xfrhandler_type* xfrhandler); #endif /* DAEMON_XFRHANDLER_H */ opendnssec-1.4.3/signer/src/daemon/cfg.h0000664000175000017500000000605311665414566015056 00000000000000/* * $Id: cfg.h 5945 2011-11-30 11:54:30Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signer engine configuration. * */ #ifndef DAEMON_CONFIG_H #define DAEMON_CONFIG_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "wire/listener.h" #include /** * Engine configuration. * */ typedef struct engineconfig_struct engineconfig_type; struct engineconfig_struct { allocator_type* allocator; listener_type* interfaces; const char* cfg_filename; const char* zonelist_filename; const char* log_filename; const char* pid_filename; const char* notify_command; const char* clisock_filename; const char* working_dir; const char* username; const char* group; const char* chroot; int use_syslog; int num_worker_threads; int num_signer_threads; int verbosity; }; /** * Configure engine. * \param[in] allocator memory allocator * \param[in] cfgfile config file * \param[in] cmdline_verbosity log level * \return engineconfig_type* engine configuration * */ engineconfig_type* engine_config(allocator_type* allocator, const char* cfgfile, int cmdline_verbosity); /** * Check configuration. * \param[in] config engine configuration * \return ods_status status * ODS_STATUS_OK: configuration settings ok * else: error in configuration settings * */ ods_status engine_config_check(engineconfig_type* config); /** * Print engine configuration. * \param[in] out output file descriptor * \param[in] config engine configuration * */ void engine_config_print(FILE* out, engineconfig_type* config); /** * Clean up config. * \param[in] config engine configuration * */ void engine_config_cleanup(engineconfig_type* config); #endif /* DAEMON_CONFIG_H */ opendnssec-1.4.3/signer/src/daemon/cmdhandler.c0000664000175000017500000007661612243342572016415 00000000000000/* * $Id: cmdhandler.c 7416 2013-11-21 08:34:02Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Command handler. * */ #include "daemon/cmdhandler.h" #include "daemon/engine.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #include /* According to earlier standards: select() sys/time.h sys/types.h unistd.h */ #include #include #define SE_CMDH_CMDLEN 7 #ifndef SUN_LEN #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif static int count = 0; static char* cmdh_str = "cmdhandler"; /** * Handle the 'help' command. * */ static void cmdhandler_handle_cmd_help(int sockfd) { char buf[ODS_SE_MAXLINE]; (void) snprintf(buf, ODS_SE_MAXLINE, "Commands:\n" "zones Show the currently known zones.\n" "sign [--serial ] Read zone and schedule for immediate " "(re-)sign.\n" " If a serial is given, that serial is used " "in the output zone.\n" "sign --all Read all zones and schedule all for " "immediate (re-)sign.\n" ); ods_writen(sockfd, buf, strlen(buf)); (void) snprintf(buf, ODS_SE_MAXLINE, "clear Delete the internal storage of this " "zone.\n" " All signatures will be regenerated " "on the next re-sign.\n" "queue Show the current task queue.\n" "flush Execute all scheduled tasks " "immediately.\n" ); ods_writen(sockfd, buf, strlen(buf)); (void) snprintf(buf, ODS_SE_MAXLINE, "update Update this zone signer " "configurations.\n" "update [--all] Update zone list and all signer " "configurations.\n" "start Start the engine.\n" "running Check if the engine is running.\n" "reload Reload the engine.\n" "stop Stop the engine.\n" "verbosity Set verbosity.\n" ); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'zones' command. * */ static void cmdhandler_handle_cmd_zones(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; size_t i; ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; if (!engine->zonelist || !engine->zonelist->zones) { (void)snprintf(buf, ODS_SE_MAXLINE, "I have no zones configured\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /* how many zones */ lock_basic_lock(&engine->zonelist->zl_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "I have %i zones configured\n", (int) engine->zonelist->zones->count); ods_writen(sockfd, buf, strlen(buf)); /* list zones */ node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->data; for (i=0; i < ODS_SE_MAXLINE; i++) { buf[i] = 0; } (void)snprintf(buf, ODS_SE_MAXLINE, "- %s\n", zone->name); ods_writen(sockfd, buf, strlen(buf)); node = ldns_rbtree_next(node); } lock_basic_unlock(&engine->zonelist->zl_lock); return; } /** * Handle the 'update' command. * */ static void cmdhandler_handle_cmd_update(int sockfd, cmdhandler_type* cmdc, const char* tbd) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_status status = ODS_STATUS_OK; zone_type* zone = NULL; ods_status zl_changed = ODS_STATUS_OK; ods_log_assert(tbd); ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); if (ods_strcmp(tbd, "--all") == 0) { lock_basic_lock(&engine->zonelist->zl_lock); zl_changed = zonelist_update(engine->zonelist, engine->config->zonelist_filename); if (zl_changed == ODS_STATUS_UNCHANGED) { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone list has not changed." " Signer configurations updated.\n"); ods_writen(sockfd, buf, strlen(buf)); } else if (zl_changed == ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone list updated: %i " "removed, %i added, %i updated.\n", engine->zonelist->just_removed, engine->zonelist->just_added, engine->zonelist->just_updated); ods_writen(sockfd, buf, strlen(buf)); } else { lock_basic_unlock(&engine->zonelist->zl_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "Zone list has errors.\n"); ods_writen(sockfd, buf, strlen(buf)); } if (zl_changed == ODS_STATUS_OK || zl_changed == ODS_STATUS_UNCHANGED) { engine->zonelist->just_removed = 0; engine->zonelist->just_added = 0; engine->zonelist->just_updated = 0; lock_basic_unlock(&engine->zonelist->zl_lock); /** * Always update the signconf for zones, even if zonelist has * not changed: ODS_STATUS_OK. */ engine_update_zones(engine, ODS_STATUS_OK); } return; } else { /* look up zone */ lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); /* If this zone is just added, don't update (it might not have a * task yet) */ if (zone && zone->zl_status == ZONE_ZL_ADDED) { zone = NULL; } lock_basic_unlock(&engine->zonelist->zl_lock); if (!zone) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Zone %s not found.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); /* update all */ cmdhandler_handle_cmd_update(sockfd, cmdc, "--all"); return; } lock_basic_lock(&zone->zone_lock); status = zone_reschedule_task(zone, engine->taskq, TASK_SIGNCONF); lock_basic_unlock(&zone->zone_lock); if (status != ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to reschedule " "task for zone %s.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_crit("[%s] unable to reschedule task for zone %s: %s", cmdh_str, zone->name, ods_status2str(status)); } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s config being updated.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] zone %s scheduled for immediate update signconf", cmdh_str, tbd); engine_wakeup_workers(engine); } } return; } static uint32_t max(uint32_t a, uint32_t b) { return (aengine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); if (ods_strcmp(tbd, "--all") == 0) { lock_basic_lock(&engine->taskq->schedule_lock); schedule_flush(engine->taskq, TASK_READ); lock_basic_unlock(&engine->taskq->schedule_lock); engine_wakeup_workers(engine); (void)snprintf(buf, ODS_SE_MAXLINE, "All zones scheduled for " "immediate re-sign.\n"); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] all zones scheduled for immediate re-sign", cmdh_str); return; } else { char* delim1 = strchr(tbd, ' '); char* delim2 = NULL; int force_serial = 0; uint32_t serial = 0; if (delim1) { char* end = NULL; /** Some trailing text, could it be --serial? */ if (strncmp(delim1+1, "--serial ", 9) != 0) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Expecting " "--serial , got %s.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); return; } delim2 = strchr(delim1+1, ' '); if (!delim2) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Expecting serial.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } serial = (uint32_t) strtol(delim2+1, &end, 10); if (*end != '\0') { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Expecting serial, " "got %s.\n", delim2+1); ods_writen(sockfd, buf, strlen(buf)); return; } force_serial = 1; *delim1 = '\0'; } lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); /* If this zone is just added, don't update (it might not have a task * yet). */ if (zone && zone->zl_status == ZONE_ZL_ADDED) { zone = NULL; } lock_basic_unlock(&engine->zonelist->zl_lock); if (!zone) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Zone %s not found.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); return; } lock_basic_lock(&zone->zone_lock); if (force_serial) { ods_log_assert(zone->db); if (!util_serial_gt(serial, max(zone->db->outserial, zone->db->inbserial))) { lock_basic_unlock(&zone->zone_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to enforce " "serial %u for zone %s.\n", serial, tbd); ods_writen(sockfd, buf, strlen(buf)); return; } zone->db->altserial = serial; zone->db->force_serial = 1; } status = zone_reschedule_task(zone, engine->taskq, TASK_READ); lock_basic_unlock(&zone->zone_lock); if (status != ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to reschedule " "task for zone %s.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_crit("[%s] unable to reschedule task for zone %s: %s", cmdh_str, zone->name, ods_status2str(status)); } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s scheduled for " "immediate re-sign.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] zone %s scheduled for immediate re-sign", cmdh_str, tbd); engine_wakeup_workers(engine); } } return; } /** * Unlink backup file. * */ static void unlink_backup_file(const char* filename, const char* extension) { char* tmpname = ods_build_path(filename, extension, 0, 1); if (tmpname) { ods_log_debug("[%s] unlink file %s", cmdh_str, tmpname); unlink(tmpname); free((void*)tmpname); } return; } /** * Handle the 'clear' command. * */ static void cmdhandler_handle_cmd_clear(int sockfd, cmdhandler_type* cmdc, const char* tbd) { ods_status status = ODS_STATUS_OK; engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; zone_type* zone = NULL; task_type* task = NULL; uint32_t inbserial = 0; uint32_t intserial = 0; uint32_t outserial = 0; ods_log_assert(tbd); ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; unlink_backup_file(tbd, ".inbound"); unlink_backup_file(tbd, ".backup"); unlink_backup_file(tbd, ".axfr"); unlink_backup_file(tbd, ".ixfr"); lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); lock_basic_unlock(&engine->zonelist->zl_lock); if (zone) { lock_basic_lock(&zone->zone_lock); inbserial = zone->db->inbserial; intserial = zone->db->intserial; outserial = zone->db->outserial; namedb_cleanup(zone->db); ixfr_cleanup(zone->ixfr); signconf_cleanup(zone->signconf); zone->db = namedb_create((void*)zone); zone->ixfr = ixfr_create((void*)zone); zone->signconf = signconf_create(); if (!zone->signconf || !zone->ixfr || !zone->db) { ods_fatal_exit("[%s] unable to clear zone %s: failed to recreate" "signconf, ixfr of db structure (out of memory?)", cmdh_str, tbd); return; } /* restore serial management */ zone->db->inbserial = inbserial; zone->db->intserial = intserial; zone->db->outserial = outserial; zone->db->have_serial = 1; status = zone_reschedule_task(zone, engine->taskq, TASK_SIGNCONF); lock_basic_unlock(&zone->zone_lock); if (status != ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to reschedule " "task for zone %s.\n", tbd); ods_log_crit("[%s] unable to reschedule task for zone %s: %s", cmdh_str, zone->name, ods_status2str(status)); } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Internal zone information about " "%s cleared", tbd?tbd:"(null)"); ods_log_info("[%s] internal zone information about %s cleared", cmdh_str, tbd?tbd:"(null)"); } } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Cannot clear zone %s, zone not " "found", tbd?tbd:"(null)"); ods_log_warning("[%s] cannot clear zone %s, zone not found", cmdh_str, tbd?tbd:"(null)"); } ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'queue' command. * */ static void cmdhandler_handle_cmd_queue(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char* strtime = NULL; char buf[ODS_SE_MAXLINE]; size_t i = 0; time_t now = 0; ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* task = NULL; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; if (!engine->taskq || !engine->taskq->tasks) { (void)snprintf(buf, ODS_SE_MAXLINE, "I have no tasks scheduled.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /* current time */ now = time_now(); strtime = ctime(&now); (void)snprintf(buf, ODS_SE_MAXLINE, "It is now %s", strtime?strtime:"(null)"); ods_writen(sockfd, buf, strlen(buf)); /* current work */ lock_basic_lock(&engine->taskq->schedule_lock); for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { task = engine->workers[i]->task; if (task) { (void)snprintf(buf, ODS_SE_MAXLINE, "Working with task %s on " "zone %s\n", task_what2str(engine->workers[i]->working_with), task_who2str(task)); ods_writen(sockfd, buf, strlen(buf)); } } /* how many tasks */ (void)snprintf(buf, ODS_SE_MAXLINE, "\nI have %i tasks scheduled.\n", (int) engine->taskq->tasks->count); ods_writen(sockfd, buf, strlen(buf)); /* list tasks */ node = ldns_rbtree_first(engine->taskq->tasks); while (node && node != LDNS_RBTREE_NULL) { task = (task_type*) node->data; for (i=0; i < ODS_SE_MAXLINE; i++) { buf[i] = 0; } (void)task2str(task, (char*) &buf[0]); ods_writen(sockfd, buf, strlen(buf)); node = ldns_rbtree_next(node); } lock_basic_unlock(&engine->taskq->schedule_lock); return; } /** * Handle the 'flush' command. * */ static void cmdhandler_handle_cmd_flush(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); lock_basic_lock(&engine->taskq->schedule_lock); schedule_flush(engine->taskq, TASK_NONE); lock_basic_unlock(&engine->taskq->schedule_lock); engine_wakeup_workers(engine); (void)snprintf(buf, ODS_SE_MAXLINE, "All tasks scheduled immediately.\n"); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] all tasks scheduled immediately", cmdh_str); return; } /** * Handle the 'reload' command. * */ static void cmdhandler_handle_cmd_reload(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; engine->need_to_reload = 1; lock_basic_lock(&engine->signal_lock); lock_basic_alarm(&engine->signal_cond); lock_basic_unlock(&engine->signal_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "Reloading engine.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'stop' command. * */ static void cmdhandler_handle_cmd_stop(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; engine->need_to_exit = 1; lock_basic_lock(&engine->signal_lock); lock_basic_alarm(&engine->signal_cond); lock_basic_unlock(&engine->signal_lock); (void)snprintf(buf, ODS_SE_MAXLINE, ODS_SE_STOP_RESPONSE); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'start' command. * */ static void cmdhandler_handle_cmd_start(int sockfd) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Engine already running.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'running' command. * */ static void cmdhandler_handle_cmd_running(int sockfd) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Engine running.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'verbosity' command. * */ static void cmdhandler_handle_cmd_verbosity(int sockfd, cmdhandler_type* cmdc, int val) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->config); ods_log_init(engine->config->log_filename, engine->config->use_syslog, val); (void)snprintf(buf, ODS_SE_MAXLINE, "Verbosity level set to %i.\n", val); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle erroneous command. * */ static void cmdhandler_handle_cmd_error(int sockfd, const char* str) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Error: %s.\n", str?str:"(null)"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle unknown command. * */ static void cmdhandler_handle_cmd_unknown(int sockfd, const char* str) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Unknown command %s.\n", str?str:"(null)"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle not implemented. * static void cmdhandler_handle_cmd_notimpl(int sockfd, const char* str) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Command %s not implemented.\n", str); ods_writen(sockfd, buf, strlen(buf)); return; } */ /** * Handle client command. * */ static void cmdhandler_handle_cmd(cmdhandler_type* cmdc) { ssize_t n = 0; int sockfd = 0; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); sockfd = cmdc->client_fd; again: while ((n = read(sockfd, buf, ODS_SE_MAXLINE)) > 0) { /* what if this number is smaller than the number of bytes requested? */ buf[n-1] = '\0'; n--; ods_log_verbose("[%s] received command %s[%i]", cmdh_str, buf, n); ods_str_trim(buf); n = strlen(buf); if (n == 4 && strncmp(buf, "help", n) == 0) { ods_log_debug("[%s] help command", cmdh_str); cmdhandler_handle_cmd_help(sockfd); } else if (n == 5 && strncmp(buf, "zones", n) == 0) { ods_log_debug("[%s] list zones command", cmdh_str); cmdhandler_handle_cmd_zones(sockfd, cmdc); } else if (n >= 4 && strncmp(buf, "sign", 4) == 0) { ods_log_debug("[%s] sign zone command", cmdh_str); if (buf[4] == '\0') { /* NOTE: wouldn't it be nice that we default to --all? */ cmdhandler_handle_cmd_error(sockfd, "sign command needs " "an argument (either '--all' or a zone name)"); } else if (buf[4] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_sign(sockfd, cmdc, &buf[5]); } } else if (n >= 5 && strncmp(buf, "clear", 5) == 0) { ods_log_debug("[%s] clear zone command", cmdh_str); if (buf[5] == '\0') { cmdhandler_handle_cmd_error(sockfd, "clear command needs " "a zone name"); } else if (buf[5] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_clear(sockfd, cmdc, &buf[6]); } } else if (n == 5 && strncmp(buf, "queue", n) == 0) { ods_log_debug("[%s] list tasks command", cmdh_str); cmdhandler_handle_cmd_queue(sockfd, cmdc); } else if (n == 5 && strncmp(buf, "flush", n) == 0) { ods_log_debug("[%s] flush tasks command", cmdh_str); cmdhandler_handle_cmd_flush(sockfd, cmdc); } else if (n >= 6 && strncmp(buf, "update", 6) == 0) { ods_log_debug("[%s] update command", cmdh_str); if (buf[6] == '\0') { cmdhandler_handle_cmd_update(sockfd, cmdc, "--all"); } else if (buf[6] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_update(sockfd, cmdc, &buf[7]); } } else if (n == 4 && strncmp(buf, "stop", n) == 0) { ods_log_debug("[%s] shutdown command", cmdh_str); cmdhandler_handle_cmd_stop(sockfd, cmdc); return; } else if (n == 5 && strncmp(buf, "start", n) == 0) { ods_log_debug("[%s] start command", cmdh_str); cmdhandler_handle_cmd_start(sockfd); } else if (n == 6 && strncmp(buf, "reload", n) == 0) { ods_log_debug("[%s] reload command", cmdh_str); cmdhandler_handle_cmd_reload(sockfd, cmdc); } else if (n == 7 && strncmp(buf, "running", n) == 0) { ods_log_debug("[%s] running command", cmdh_str); cmdhandler_handle_cmd_running(sockfd); } else if (n >= 9 && strncmp(buf, "verbosity", 9) == 0) { ods_log_debug("[%s] verbosity command", cmdh_str); if (buf[9] == '\0') { cmdhandler_handle_cmd_error(sockfd, "verbosity command " "an argument (verbosity level)"); } else if (buf[9] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_verbosity(sockfd, cmdc, atoi(&buf[10])); } } else if (n > 0) { ods_log_debug("[%s] unknown command", cmdh_str); cmdhandler_handle_cmd_unknown(sockfd, buf); } ods_log_debug("[%s] done handling command %s[%i]", cmdh_str, buf, n); (void)snprintf(buf, SE_CMDH_CMDLEN, "\ncmd> "); ods_writen(sockfd, buf, strlen(buf)); } if (n < 0 && (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN) ) { goto again; } else if (n < 0 && errno == ECONNRESET) { ods_log_debug("[%s] done handling client: %s", cmdh_str, strerror(errno)); } else if (n < 0 ) { ods_log_error("[%s] read error: %s", cmdh_str, strerror(errno)); } return; } /** * Accept client. * */ static void* cmdhandler_accept_client(void* arg) { cmdhandler_type* cmdc = (cmdhandler_type*) arg; ods_thread_blocksigs(); ods_thread_detach(cmdc->thread_id); ods_log_debug("[%s] accept client %i", cmdh_str, cmdc->client_fd); cmdhandler_handle_cmd(cmdc); if (cmdc->client_fd) { shutdown(cmdc->client_fd, SHUT_RDWR); close(cmdc->client_fd); } free(cmdc); count--; return NULL; } /** * Create command handler. * */ cmdhandler_type* cmdhandler_create(allocator_type* allocator, const char* filename) { cmdhandler_type* cmdh = NULL; struct sockaddr_un servaddr; int listenfd = 0; int flags = 0; int ret = 0; if (!allocator || !filename) { return NULL; } /* new socket */ ods_log_debug("[%s] create socket %s", cmdh_str, filename); listenfd = socket(AF_UNIX, SOCK_STREAM, 0); if (listenfd < 0) { ods_log_error("[%s] unable to create cmdhandler: " "socket() failed (%s)", cmdh_str, strerror(errno)); return NULL; } /* set it to non-blocking */ flags = fcntl(listenfd, F_GETFL, 0); if (flags < 0) { ods_log_error("[%s] unable to create cmdhandler: " "fcntl(F_GETFL) failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } flags |= O_NONBLOCK; if (fcntl(listenfd, F_SETFL, flags) < 0) { ods_log_error("[%s] unable to create cmdhandler: " "fcntl(F_SETFL) failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } /* no surprises so far */ if (filename) { (void)unlink(filename); } bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_UNIX; strncpy(servaddr.sun_path, filename, sizeof(servaddr.sun_path) - 1); #ifdef HAVE_SOCKADDR_SUN_LEN servaddr.sun_len = strlen(servaddr.sun_path); #endif /* bind and listen... */ ret = bind(listenfd, (const struct sockaddr*) &servaddr, SUN_LEN(&servaddr)); if (ret != 0) { ods_log_error("[%s] unable to create cmdhandler: " "bind() failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } ret = listen(listenfd, ODS_SE_MAX_HANDLERS); if (ret != 0) { ods_log_error("[%s] unable to create cmdhandler: " "listen() failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } /* all ok */ cmdh = (cmdhandler_type*) allocator_alloc(allocator, sizeof(cmdhandler_type)); if (!cmdh) { ods_log_error("[%s] unable to create cmdhandler: " "allocator_alloc() failed", cmdh_str); close(listenfd); return NULL; } cmdh->allocator = allocator; cmdh->listen_fd = listenfd; cmdh->listen_addr = servaddr; cmdh->need_to_exit = 0; return cmdh; } /** * Start command handler. * */ void cmdhandler_start(cmdhandler_type* cmdhandler) { struct sockaddr_un cliaddr; socklen_t clilen; cmdhandler_type* cmdc = NULL; engine_type* engine = NULL; fd_set rset; int connfd = 0; int ret = 0; ods_log_assert(cmdhandler); ods_log_assert(cmdhandler->engine); ods_log_debug("[%s] start", cmdh_str); engine = (engine_type*) cmdhandler->engine; ods_thread_detach(cmdhandler->thread_id); FD_ZERO(&rset); while (cmdhandler->need_to_exit == 0) { clilen = sizeof(cliaddr); FD_SET(cmdhandler->listen_fd, &rset); ret = select(cmdhandler->listen_fd+1, &rset, NULL, NULL, NULL); if (ret < 0) { if (errno != EINTR && errno != EWOULDBLOCK) { ods_log_warning("[%s] select() error: %s", cmdh_str, strerror(errno)); } continue; } if (FD_ISSET(cmdhandler->listen_fd, &rset)) { connfd = accept(cmdhandler->listen_fd, (struct sockaddr *) &cliaddr, &clilen); if (connfd < 0) { if (errno != EINTR && errno != EWOULDBLOCK) { ods_log_warning("[%s] accept() error: %s", cmdh_str, strerror(errno)); } continue; } /* client accepted, create new thread */ cmdc = (cmdhandler_type*) malloc(sizeof(cmdhandler_type)); if (!cmdc) { ods_log_crit("[%s] unable to create thread for client: " "malloc() failed", cmdh_str); cmdhandler->need_to_exit = 1; break; } cmdc->listen_fd = cmdhandler->listen_fd; cmdc->client_fd = connfd; cmdc->listen_addr = cmdhandler->listen_addr; cmdc->engine = cmdhandler->engine; cmdc->need_to_exit = cmdhandler->need_to_exit; ods_thread_create(&cmdc->thread_id, &cmdhandler_accept_client, (void*) cmdc); count++; ods_log_debug("[%s] %i clients in progress...", cmdh_str, count); } } ods_log_debug("[%s] shutdown", cmdh_str); engine = cmdhandler->engine; engine->cmdhandler_done = 1; return; } /** * Cleanup command handler. * */ void cmdhandler_cleanup(cmdhandler_type* cmdhandler) { allocator_type* allocator = NULL; if (!cmdhandler) { return; } allocator = cmdhandler->allocator; allocator_deallocate(allocator, (void*) cmdhandler); return; } opendnssec-1.4.3/signer/src/daemon/engine.h0000664000175000017500000000660512120054051015537 00000000000000/* * $Id: engine.h 7068 2013-03-13 10:42:49Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * The engine. * */ #ifndef DAEMON_ENGINE_H #define DAEMON_ENGINE_H #include "config.h" #include "daemon/cfg.h" #include "daemon/cmdhandler.h" #include "daemon/dnshandler.h" #include "daemon/xfrhandler.h" #include "daemon/worker.h" #include "scheduler/fifoq.h" #include "scheduler/schedule.h" #include "shared/allocator.h" #include "shared/locks.h" #include "signer/zonelist.h" #include "wire/edns.h" #include /** * Engine stuff. * */ typedef struct engine_struct engine_type; struct engine_struct { allocator_type* allocator; engineconfig_type* config; worker_type** workers; worker_type** drudgers; zonelist_type* zonelist; schedule_type* taskq; fifoq_type* signq; cmdhandler_type* cmdhandler; dnshandler_type* dnshandler; xfrhandler_type* xfrhandler; edns_data_type edns; int cmdhandler_done; pid_t pid; uid_t uid; gid_t gid; int daemonize; int need_to_exit; int need_to_reload; sig_atomic_t signal; cond_basic_type signal_cond; lock_basic_type signal_lock; }; /** * Start engine. * \param[in] cfgfile configuration file * \param[in] cmdline_verbosity how many -v on the command line * \param[in] daemonize to run as daemon or not * \param[in] info print info and exit * \param[in] single_run run once * */ void engine_start(const char* cfgfile, int cmdline_verbosity, int daemonize, int info, int single_run); /** * Start drudgers. * \param[in] engine engine * */ void engine_start_drudgers(engine_type* engine); /** * Stop drudgers. * \param[in] engine engine * */ void engine_stop_drudgers(engine_type* engine); /** * Wake up workers. * \param[in] engine engine * */ void engine_wakeup_workers(engine_type* engine); /** * Update zones. * \param[in] engine engine * \param[in] zl_changed whether the zonelist has changed or not * */ void engine_update_zones(engine_type* engine, ods_status zl_changed); /** * Clean up engine. * \param[in] engine engine * */ void engine_cleanup(engine_type* engine); #endif /* DAEMON_ENGINE_H */ opendnssec-1.4.3/signer/src/daemon/signal.c0000664000175000017500000000615411631156305015554 00000000000000/* * $Id: signal.c 5548 2011-09-05 14:29:25Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signal handling. * */ #include "config.h" #include "daemon/engine.h" #include "daemon/signal.h" #include "shared/locks.h" #include "shared/log.h" #include static int signal_hup_recvd = 0; static int signal_term_recvd = 0; static engine_type* signal_engine = NULL; static const char* signal_str = "signal"; /** * Set corresponding engine. * */ void signal_set_engine(void* engine) { signal_engine = (engine_type*) engine; return; } /** * Handle signals. * */ void signal_handler(sig_atomic_t sig) { switch (sig) { case SIGHUP: ods_log_debug("[%s] SIGHUP received", signal_str); signal_hup_recvd++; if (signal_engine) { lock_basic_lock(&signal_engine->signal_lock); /* [LOCK] signal */ lock_basic_alarm(&signal_engine->signal_cond); /* [UNLOCK] signal */ lock_basic_unlock(&signal_engine->signal_lock); } break; case SIGTERM: ods_log_debug("[%s] SIGTERM received", signal_str); signal_term_recvd++; if (signal_engine) { lock_basic_lock(&signal_engine->signal_lock); /* [LOCK] signal */ lock_basic_alarm(&signal_engine->signal_cond); /* [UNLOCK] signal */ lock_basic_unlock(&signal_engine->signal_lock); } break; default: break; } return; } /** * Capture signal. * */ sig_atomic_t signal_capture(sig_atomic_t dflsig) { if (signal_term_recvd) { signal_term_recvd = 0; return SIGNAL_SHUTDOWN; } else if (signal_hup_recvd) { signal_hup_recvd = 0; return SIGNAL_RELOAD; } return dflsig; } opendnssec-1.4.3/signer/src/daemon/cmdhandler.h0000664000175000017500000000457311665414566016425 00000000000000/* * $Id: cmdhandler.h 5945 2011-11-30 11:54:30Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Command handler. * */ #ifndef DAEMON_CMDHANDLER_H #define DAEMON_CMDHANDLER_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include #define ODS_SE_MAX_HANDLERS 5 typedef struct cmdhandler_struct cmdhandler_type; struct cmdhandler_struct { allocator_type* allocator; void* engine; struct sockaddr_un listen_addr; ods_thread_type thread_id; int listen_fd; int client_fd; int need_to_exit; }; /** * Create command handler. * \param[in] allocator memory allocator * \param[in] filename socket file name * \return cmdhandler_type* created command handler * */ cmdhandler_type* cmdhandler_create(allocator_type* allocator, const char* filename); /** * Start command handler. * \param[in] cmdhandler_type* command handler * */ void cmdhandler_start(cmdhandler_type* cmdhandler); /** * Cleanup command handler. * \param[in] cmdhandler_type* command handler * */ void cmdhandler_cleanup(cmdhandler_type* cmdhandler); #endif /* DAEMON_CMDHANDLER_H */ opendnssec-1.4.3/signer/src/daemon/cfg.c0000664000175000017500000002225512127027127015036 00000000000000/* * $Id: cfg.c 7083 2013-04-03 13:27:51Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signer engine configuration. * */ #include "config.h" #include "daemon/cfg.h" #include "parser/confparser.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include #include #include static const char* conf_str = "config"; /** * Configure engine. * */ engineconfig_type* engine_config(allocator_type* allocator, const char* cfgfile, int cmdline_verbosity) { engineconfig_type* ecfg; const char* rngfile = ODS_SE_RNGDIR "/conf.rng"; FILE* cfgfd = NULL; if (!allocator || !cfgfile) { return NULL; } /* check syntax (slows down parsing configuration file) */ if (parse_file_check(cfgfile, rngfile) != ODS_STATUS_OK) { ods_log_error("[%s] unable to create config: parse error in %s", conf_str, cfgfile); return NULL; } /* open cfgfile */ cfgfd = ods_fopen(cfgfile, NULL, "r"); if (cfgfd) { ods_log_verbose("[%s] read cfgfile: %s", conf_str, cfgfile); /* create config */ ecfg = (engineconfig_type*) allocator_alloc(allocator, sizeof(engineconfig_type)); if (!ecfg) { ods_log_error("[%s] unable to create config: allocator_alloc() " "failed", conf_str); ods_fclose(cfgfd); return NULL; } ecfg->allocator = allocator; /* get values */ ecfg->cfg_filename = allocator_strdup(allocator, cfgfile); ecfg->zonelist_filename = parse_conf_zonelist_filename(allocator, cfgfile); ecfg->log_filename = parse_conf_log_filename(allocator, cfgfile); ecfg->pid_filename = parse_conf_pid_filename(allocator, cfgfile); ecfg->notify_command = parse_conf_notify_command(allocator, cfgfile); ecfg->clisock_filename = parse_conf_clisock_filename(allocator, cfgfile); ecfg->working_dir = parse_conf_working_dir(allocator, cfgfile); ecfg->username = parse_conf_username(allocator, cfgfile); ecfg->group = parse_conf_group(allocator, cfgfile); ecfg->chroot = parse_conf_chroot(allocator, cfgfile); ecfg->use_syslog = parse_conf_use_syslog(cfgfile); ecfg->num_worker_threads = parse_conf_worker_threads(cfgfile); ecfg->num_signer_threads = parse_conf_signer_threads(cfgfile); /* If any verbosity has been specified at cmd line we will use that */ if (cmdline_verbosity > 0) { ecfg->verbosity = cmdline_verbosity; } else { ecfg->verbosity = parse_conf_verbosity(cfgfile); } ecfg->interfaces = parse_conf_listener(allocator, cfgfile); /* done */ ods_fclose(cfgfd); return ecfg; } ods_log_error("[%s] unable to create config: failed to open file %s", conf_str, cfgfile); return NULL; } /** * Check configuration. * */ ods_status engine_config_check(engineconfig_type* config) { if (!config) { ods_log_error("[%s] config-check failed: no config", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->cfg_filename) { ods_log_error("[%s] config-check failed: no config filename", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->zonelist_filename) { ods_log_error("[%s] config-check failed: no zonelist filename", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->clisock_filename) { ods_log_error("[%s] config-check failed: no socket filename", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->interfaces) { ods_log_error("[%s] config-check failed: no listener", conf_str); return ODS_STATUS_CFG_ERR; } /* [TODO] room for more checks here */ return ODS_STATUS_OK; } /** * Print configuration. * */ void engine_config_print(FILE* out, engineconfig_type* config) { if (!out) { return; } fprintf(out, "\n"); if (config) { fprintf(out, "\n"); /* Common */ fprintf(out, "\t\n"); if (config->use_syslog && config->log_filename) { fprintf(out, "\t\t\n"); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\t\t%s\n", config->log_filename); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\n"); } else if (config->log_filename) { fprintf(out, "\t\t\n"); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\t\t%s\n", config->log_filename); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\n"); } fprintf(out, "\t\t%s\n", config->zonelist_filename); fprintf(out, "\t\n"); /* Signer */ fprintf(out, "\t\n"); if (config->username || config->group || config->chroot) { fprintf(out, "\t\t\n"); if (config->username) { fprintf(out, "\t\t%s\n", config->username); } if (config->group) { fprintf(out, "\t\t%s\n", config->group); } if (config->chroot) { fprintf(out, "\t\t%s\n", config->chroot); } fprintf(out, "\t\t\n"); } if (config->interfaces) { size_t i = 0; fprintf(out, "\t\t\n"); for (i=0; i < config->interfaces->count; i++) { fprintf(out, "\t\t\t"); if (config->interfaces->interfaces[i].address) { fprintf(out, "
%s
", config->interfaces->interfaces[i].address); } if (config->interfaces->interfaces[i].port) { fprintf(out, "%s", config->interfaces->interfaces[i].port); } fprintf(out, "\n"); } fprintf(out, "\t\t
\n"); } fprintf(out, "\t\t%s\n", config->working_dir); fprintf(out, "\t\t%i\n", config->num_worker_threads); fprintf(out, "\t\t%i\n", config->num_signer_threads); if (config->notify_command) { fprintf(out, "\t\t%s\n", config->notify_command); } fprintf(out, "\t
\n"); fprintf(out, "
\n"); /* make configurable: - pid_filename - clisock_filename */ } return; } /** * Clean up config. * */ void engine_config_cleanup(engineconfig_type* config) { allocator_type* allocator = NULL; if (!config) { return; } allocator = config->allocator; listener_cleanup(config->interfaces); allocator_deallocate(allocator, (void*) config->notify_command); allocator_deallocate(allocator, (void*) config->cfg_filename); allocator_deallocate(allocator, (void*) config->zonelist_filename); allocator_deallocate(allocator, (void*) config->log_filename); allocator_deallocate(allocator, (void*) config->pid_filename); allocator_deallocate(allocator, (void*) config->clisock_filename); allocator_deallocate(allocator, (void*) config->working_dir); allocator_deallocate(allocator, (void*) config->username); allocator_deallocate(allocator, (void*) config->group); allocator_deallocate(allocator, (void*) config->chroot); allocator_deallocate(allocator, (void*) config); return; } opendnssec-1.4.3/signer/src/daemon/worker.c0000664000175000017500000007056212225214721015611 00000000000000/* * $Id: worker.c 7342 2013-10-09 08:54:41Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * The hard workers. * */ #include "daemon/engine.h" #include "daemon/worker.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/hsm.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/status.h" #include "signer/tools.h" #include "signer/zone.h" #include /* time() */ ods_lookup_table worker_str[] = { { WORKER_WORKER, "worker" }, { WORKER_DRUDGER, "drudger" }, { 0, NULL } }; /** * Convert worker type to string. * */ static const char* worker2str(worker_id type) { ods_lookup_table *lt = ods_lookup_by_id(worker_str, type); if (lt) { return lt->name; } return NULL; } /** * Create worker. * */ worker_type* worker_create(allocator_type* allocator, int num, worker_id type) { worker_type* worker; if (!allocator) { return NULL; } worker = (worker_type*) allocator_alloc(allocator, sizeof(worker_type)); if (!worker) { return NULL; } ods_log_debug("[%s[%i]] create", worker2str(type), num+1); lock_basic_init(&worker->worker_lock); lock_basic_set(&worker->worker_alarm); lock_basic_lock(&worker->worker_lock); worker->allocator = allocator; worker->thread_num = num +1; worker->engine = NULL; worker->task = NULL; worker->working_with = TASK_NONE; worker->need_to_exit = 0; worker->type = type; worker->clock_in = 0; worker->jobs_appointed = 0; worker->jobs_completed = 0; worker->jobs_failed = 0; worker->sleeping = 0; worker->waiting = 0; lock_basic_unlock(&worker->worker_lock); return worker; } /** * Worker working with... * */ static void worker_working_with(worker_type* worker, task_id with, task_id next, const char* str, const char* name, task_id* what, time_t* when) { worker->working_with = with; ods_log_verbose("[%s[%i]] %s zone %s", worker2str(worker->type), worker->thread_num, str, name); *what = next; *when = time_now(); return; } /** * Has this worker measured up to all appointed jobs? * */ static int worker_fulfilled(worker_type* worker) { int ret = 0; ret = (worker->jobs_completed + worker->jobs_failed) == worker->jobs_appointed; return ret; } /** * Clear jobs. * */ static void worker_clear_jobs(worker_type* worker) { ods_log_assert(worker); lock_basic_lock(&worker->worker_lock); worker->jobs_appointed = 0; worker->jobs_completed = 0; worker->jobs_failed = 0; lock_basic_unlock(&worker->worker_lock); return; } /** * Queue RRset for signing. * */ static void worker_queue_rrset(worker_type* worker, fifoq_type* q, rrset_type* rrset) { ods_status status = ODS_STATUS_UNCHANGED; int tries = 0; ods_log_assert(worker); ods_log_assert(q); ods_log_assert(rrset); lock_basic_lock(&q->q_lock); status = fifoq_push(q, (void*) rrset, worker, &tries); while (status == ODS_STATUS_UNCHANGED) { tries++; if (worker->need_to_exit) { lock_basic_unlock(&q->q_lock); return; } /** * Apparently the queue is full. Lets take a small break to not hog CPU. * The worker will release the signq lock while sleeping and will * automatically grab the lock when the queue is nonfull. * Queue is nonfull at 10% of the queue size. */ lock_basic_sleep(&q->q_nonfull, &q->q_lock, 5); status = fifoq_push(q, (void*) rrset, worker, &tries); } lock_basic_unlock(&q->q_lock); ods_log_assert(status == ODS_STATUS_OK); lock_basic_lock(&worker->worker_lock); worker->jobs_appointed += 1; lock_basic_unlock(&worker->worker_lock); return; } /** * Queue domain for signing. * */ static void worker_queue_domain(worker_type* worker, fifoq_type* q, domain_type* domain) { rrset_type* rrset = NULL; denial_type* denial = NULL; ods_log_assert(worker); ods_log_assert(q); ods_log_assert(domain); rrset = domain->rrsets; while (rrset) { worker_queue_rrset(worker, q, rrset); rrset = rrset->next; } denial = (denial_type*) domain->denial; if (denial && denial->rrset) { worker_queue_rrset(worker, q, denial->rrset); } return; } /** * Queue zone for signing. * */ static void worker_queue_zone(worker_type* worker, fifoq_type* q, zone_type* zone) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; ods_log_assert(worker); ods_log_assert(q); ods_log_assert(zone); worker_clear_jobs(worker); if (!zone->db || !zone->db->domains) { return; } if (zone->db->domains->root != LDNS_RBTREE_NULL) { node = ldns_rbtree_first(zone->db->domains); } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; worker_queue_domain(worker, q, domain); node = ldns_rbtree_next(node); } return; } /** * Make sure that no appointed jobs have failed. * */ static ods_status worker_check_jobs(worker_type* worker, task_type* task) { ods_log_assert(worker); ods_log_assert(task); lock_basic_lock(&worker->worker_lock); if (worker->jobs_failed) { ods_log_error("[%s[%i]] sign zone %s failed: %u RRsets failed", worker2str(worker->type), worker->thread_num, task_who2str(task), worker->jobs_failed); lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_ERR; } else if (worker->jobs_completed != worker->jobs_appointed) { ods_log_error("[%s[%i]] sign zone %s failed: processed %u of %u " "RRsets", worker2str(worker->type), worker->thread_num, task_who2str(task), worker->jobs_completed, worker->jobs_appointed); lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_ERR; } else if (worker->need_to_exit) { ods_log_debug("[%s[%i]] sign zone %s failed: worker needs to exit", worker2str(worker->type), worker->thread_num, task_who2str(task)); lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_ERR; } else { ods_log_debug("[%s[%i]] sign zone %s ok: %u of %u RRsets " "succeeded", worker2str(worker->type), worker->thread_num, task_who2str(task), worker->jobs_completed, worker->jobs_appointed); ods_log_assert(worker->jobs_appointed == worker->jobs_completed); } lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_OK; } /** * Perform task. * */ static void worker_perform_task(worker_type* worker) { engine_type* engine = NULL; zone_type* zone = NULL; task_type* task = NULL; task_id what = TASK_NONE; time_t when = 0; time_t never = (3600*24*365); ods_status status = ODS_STATUS_OK; int backup = 0; time_t start = 0; time_t end = 0; if (!worker || !worker->task || !worker->task->zone || !worker->engine) { return; } engine = (engine_type*) worker->engine; task = (task_type*) worker->task; zone = (zone_type*) worker->task->zone; ods_log_debug("[%s[%i]] perform task %s for zone %s at %u", worker2str(worker->type), worker->thread_num, task_what2str(task->what), task_who2str(task), (uint32_t) worker->clock_in); /* do what you have been told to do */ switch (task->what) { case TASK_SIGNCONF: /* perform 'load signconf' task */ worker_working_with(worker, TASK_SIGNCONF, TASK_READ, "configure", task_who2str(task), &what, &when); status = tools_signconf(zone); if (status == ODS_STATUS_UNCHANGED) { if (!zone->signconf->last_modified) { ods_log_debug("[%s[%i]] no signconf.xml for zone %s yet", worker2str(worker->type), worker->thread_num, task_who2str(task)); status = ODS_STATUS_ERR; } } if (status == ODS_STATUS_UNCHANGED) { if (task->halted != TASK_NONE && task->halted != TASK_SIGNCONF) { goto task_perform_continue; } status = ODS_STATUS_OK; } else if (status == ODS_STATUS_OK) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } else { if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } /* break; */ case TASK_READ: /* perform 'read input adapter' task */ worker_working_with(worker, TASK_READ, TASK_SIGN, "read", task_who2str(task), &what, &when); task->what = TASK_READ; if (!zone->signconf->last_modified) { ods_log_debug("[%s[%i]] no signconf.xml for zone %s yet", worker2str(worker->type), worker->thread_num, task_who2str(task)); status = ODS_STATUS_ERR; } else { lhsm_check_connection((void*)engine); status = tools_input(zone); } if (status == ODS_STATUS_UNCHANGED) { ods_log_verbose("[%s[%i]] zone %s unsigned data not changed, " "continue", worker2str(worker->type), worker->thread_num, task_who2str(task)); status = ODS_STATUS_OK; } if (status == ODS_STATUS_OK) { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } else { if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } /* break; */ case TASK_SIGN: /* perform 'sign' task */ worker_working_with(worker, TASK_SIGN, TASK_WRITE, "sign", task_who2str(task), &what, &when); task->what = TASK_SIGN; status = zone_update_serial(zone); if (status == ODS_STATUS_OK) { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } else { ods_log_error("[%s[%i]] unable to sign zone %s: " "failed to increment serial", worker2str(worker->type), worker->thread_num, task_who2str(task)); if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } /* start timer */ start = time(NULL); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (!zone->stats->start_time) { zone->stats->start_time = start; } zone->stats->sig_count = 0; zone->stats->sig_soa_count = 0; zone->stats->sig_reuse = 0; zone->stats->sig_time = 0; lock_basic_unlock(&zone->stats->stats_lock); } /* check the HSM connection before queuing sign operations */ lhsm_check_connection((void*)engine); /* prepare keys */ status = zone_prepare_keys(zone); if (status == ODS_STATUS_OK) { /* queue menial, hard signing work */ worker_queue_zone(worker, engine->signq, zone); ods_log_deeebug("[%s[%i]] wait until drudgers are finished " "signing zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); /* sleep until work is done */ worker_sleep_unless(worker, 0); } /* stop timer */ end = time(NULL); /* check status and jobs */ if (status == ODS_STATUS_OK) { status = worker_check_jobs(worker, task); } worker_clear_jobs(worker); if (status == ODS_STATUS_OK && zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->sig_time = (end-start); lock_basic_unlock(&zone->stats->stats_lock); } if (status != ODS_STATUS_OK) { if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } else { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } /* break; */ case TASK_WRITE: /* perform 'write to output adapter' task */ worker_working_with(worker, TASK_WRITE, TASK_SIGN, "write", task_who2str(task), &what, &when); task->what = TASK_WRITE; status = tools_output(zone, engine); if (status == ODS_STATUS_OK) { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } else { /* clear signatures? */ if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } zone->db->is_processed = 1; if (zone->signconf && duration2time(zone->signconf->sig_resign_interval)) { what = TASK_SIGN; when = worker->clock_in + duration2time(zone->signconf->sig_resign_interval); } else { ods_log_error("[%s[%i]] unable to retrieve resign interval " "for zone %s: duration2time() failed", worker2str(worker->type), worker->thread_num, task_who2str(task)); ods_log_info("[%s[%i]] defaulting to 1H resign interval for " "zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); what = TASK_SIGN; when = worker->clock_in + 3600; } backup = 1; break; case TASK_NONE: worker->working_with = TASK_NONE; /* no task */ ods_log_warning("[%s[%i]] none task for zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); when = time_now() + never; break; default: worker->working_with = TASK_NONE; /* unknown task */ ods_log_warning("[%s[%i]] unknown task, trying full sign zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); what = TASK_SIGNCONF; when = time_now(); break; } /* no error */ task->backoff = 0; if (task->interrupt != TASK_NONE && task->interrupt != what) { ods_log_debug("[%s[%i]] interrupt task %s for zone %s", worker2str(worker->type), worker->thread_num, task_what2str(what), task_who2str(task)); task->halted = what; task->halted_when = when; task->what = task->interrupt; task->when = time_now(); } else { ods_log_debug("[%s[%i]] next task %s for zone %s", worker2str(worker->type), worker->thread_num, task_what2str(what), task_who2str(task)); task->what = what; task->when = when; task->interrupt = TASK_NONE; task->halted = TASK_NONE; task->halted_when = 0; } /* backup the last successful run */ if (backup) { status = zone_backup2(zone); if (status != ODS_STATUS_OK) { ods_log_warning("[%s[%i]] unable to backup zone %s: %s", worker2str(worker->type), worker->thread_num, task_who2str(task), ods_status2str(status)); /* just a warning */ status = ODS_STATUS_OK; } backup = 0; } return; task_perform_fail: if (status != ODS_STATUS_XFR_NOT_READY) { /* other statuses is critical, and we know it is not ODS_STATUS_OK */ ods_log_crit("[%s[%i]] CRITICAL: failed to sign zone %s: %s", worker2str(worker->type), worker->thread_num, task_who2str(task), ods_status2str(status)); } /* in case of failure, also mark zone processed (for single run usage) */ zone->db->is_processed = 1; if (task->backoff) { task->backoff *= 2; } else { task->backoff = 60; } if (task->backoff > ODS_SE_MAX_BACKOFF) { task->backoff = ODS_SE_MAX_BACKOFF; } ods_log_info("[%s[%i]] backoff task %s for zone %s with %u seconds", worker2str(worker->type), worker->thread_num, task_what2str(task->what), task_who2str(task), task->backoff); task->when = time_now() + task->backoff; return; task_perform_continue: ods_log_info("[%s[%i]] continue task %s for zone %s", worker2str(worker->type), worker->thread_num, task_what2str(task->halted), task_who2str(task)); task->what = task->halted; task->when = task->halted_when; task->interrupt = TASK_NONE; task->halted = TASK_NONE; task->halted_when = 0; return; } /** * Work. * */ static void worker_work(worker_type* worker) { time_t now = 0; time_t timeout = 1; engine_type* engine = NULL; zone_type* zone = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(worker); ods_log_assert(worker->type == WORKER_WORKER); engine = (engine_type*) worker->engine; while (worker->need_to_exit == 0) { ods_log_debug("[%s[%i]] report for duty", worker2str(worker->type), worker->thread_num); now = time_now(); lock_basic_lock(&engine->taskq->schedule_lock); worker->task = schedule_pop_task(engine->taskq); if (worker->task) { worker->working_with = worker->task->what; lock_basic_unlock(&engine->taskq->schedule_lock); zone = (zone_type*) worker->task->zone; lock_basic_lock(&zone->zone_lock); ods_log_debug("[%s[%i]] start working on zone %s", worker2str(worker->type), worker->thread_num, zone->name); worker->clock_in = time(NULL); worker_perform_task(worker); zone->task = worker->task; ods_log_debug("[%s[%i]] finished working on zone %s", worker2str(worker->type), worker->thread_num, zone->name); lock_basic_lock(&engine->taskq->schedule_lock); worker->task = NULL; worker->working_with = TASK_NONE; status = schedule_task(engine->taskq, zone->task, 1); if (status != ODS_STATUS_OK) { ods_log_error("[%s[%i]] unable to schedule task for zone %s: " "%s", worker2str(worker->type), worker->thread_num, zone->name, ods_status2str(status)); } lock_basic_unlock(&engine->taskq->schedule_lock); lock_basic_unlock(&zone->zone_lock); timeout = 1; /** Do we need to tell the engine that we require a reload? */ lock_basic_lock(&engine->signal_lock); if (engine->need_to_reload) { lock_basic_alarm(&engine->signal_cond); } lock_basic_unlock(&engine->signal_lock); } else { ods_log_debug("[%s[%i]] nothing to do", worker2str(worker->type), worker->thread_num); worker->task = schedule_get_first_task(engine->taskq); lock_basic_unlock(&engine->taskq->schedule_lock); if (worker->task && !engine->taskq->loading) { timeout = (worker->task->when - now); } else { timeout *= 2; } if (timeout > ODS_SE_MAX_BACKOFF) { timeout = ODS_SE_MAX_BACKOFF; } worker->task = NULL; worker_sleep(worker, timeout); } } return; } /** * Drudge. * */ static void worker_drudge(worker_type* worker) { engine_type* engine = NULL; zone_type* zone = NULL; task_type* task = NULL; rrset_type* rrset = NULL; ods_status status = ODS_STATUS_OK; worker_type* superior = NULL; hsm_ctx_t* ctx = NULL; ods_log_assert(worker); ods_log_assert(worker->engine); ods_log_assert(worker->type == WORKER_DRUDGER); engine = (engine_type*) worker->engine; while (worker->need_to_exit == 0) { ods_log_deeebug("[%s[%i]] report for duty", worker2str(worker->type), worker->thread_num); /* initialize */ superior = NULL; zone = NULL; task = NULL; /* get item */ lock_basic_lock(&engine->signq->q_lock); rrset = (rrset_type*) fifoq_pop(engine->signq, &superior); if (!rrset) { ods_log_deeebug("[%s[%i]] nothing to do, wait", worker2str(worker->type), worker->thread_num); /** * Apparently the queue is empty. Wait until new work is queued. * The drudger will release the signq lock while sleeping and * will automatically grab the lock when the threshold is reached. * Threshold is at 1 and MAX (after a number of tries). */ lock_basic_sleep(&engine->signq->q_threshold, &engine->signq->q_lock, 0); rrset = (rrset_type*) fifoq_pop(engine->signq, &superior); } lock_basic_unlock(&engine->signq->q_lock); /* do some work */ if (rrset) { ods_log_assert(superior); if (!ctx) { ods_log_debug("[%s[%i]] create hsm context", worker2str(worker->type), worker->thread_num); ctx = hsm_create_context(); } if (!ctx) { ods_log_crit("[%s[%i]] error creating libhsm context", worker2str(worker->type), worker->thread_num); engine->need_to_reload = 1; lock_basic_lock(&superior->worker_lock); superior->jobs_failed++; lock_basic_unlock(&superior->worker_lock); } else { ods_log_assert(ctx); lock_basic_lock(&superior->worker_lock); task = superior->task; ods_log_assert(task); zone = task->zone; lock_basic_unlock(&superior->worker_lock); ods_log_assert(zone); ods_log_assert(zone->apex); ods_log_assert(zone->signconf); worker->clock_in = time(NULL); status = rrset_sign(ctx, rrset, superior->clock_in); lock_basic_lock(&superior->worker_lock); if (status == ODS_STATUS_OK) { superior->jobs_completed++; } else { superior->jobs_failed++; } lock_basic_unlock(&superior->worker_lock); } if (worker_fulfilled(superior) && superior->sleeping) { ods_log_deeebug("[%s[%i]] wake up superior[%u], work is " "done", worker2str(worker->type), worker->thread_num, superior->thread_num); worker_wakeup(superior); } superior = NULL; rrset = NULL; } /* done work */ } /* wake up superior */ if (superior && superior->sleeping) { ods_log_deeebug("[%s[%i]] wake up superior[%u], i am exiting", worker2str(worker->type), worker->thread_num, superior->thread_num); worker_wakeup(superior); } /* cleanup open HSM sessions */ if (ctx) { hsm_destroy_context(ctx); } return; } /** * Start worker. * */ void worker_start(worker_type* worker) { ods_log_assert(worker); switch (worker->type) { case WORKER_DRUDGER: worker_drudge(worker); break; case WORKER_WORKER: worker_work(worker); break; default: ods_log_error("[worker] illegal worker (id=%i)", worker->type); break; } return; } /** * Put worker to sleep. * */ void worker_sleep(worker_type* worker, time_t timeout) { ods_log_assert(worker); lock_basic_lock(&worker->worker_lock); worker->sleeping = 1; lock_basic_sleep(&worker->worker_alarm, &worker->worker_lock, timeout); lock_basic_unlock(&worker->worker_lock); return; } /** * Put worker to sleep unless worker has measured up to all appointed jobs. * */ void worker_sleep_unless(worker_type* worker, time_t timeout) { ods_log_assert(worker); lock_basic_lock(&worker->worker_lock); while (!worker->need_to_exit && !worker_fulfilled(worker)) { worker->sleeping = 1; lock_basic_sleep(&worker->worker_alarm, &worker->worker_lock, timeout); ods_log_debug("[%s[%i]] somebody poked me, check completed jobs %u " "appointed, %u completed, %u failed", worker2str(worker->type), worker->thread_num, worker->jobs_appointed, worker->jobs_completed, worker->jobs_failed); } lock_basic_unlock(&worker->worker_lock); return; } /** * Wake up worker. * */ void worker_wakeup(worker_type* worker) { ods_log_assert(worker); if (worker && worker->sleeping && !worker->waiting) { ods_log_debug("[%s[%i]] wake up", worker2str(worker->type), worker->thread_num); lock_basic_lock(&worker->worker_lock); lock_basic_alarm(&worker->worker_alarm); worker->sleeping = 0; lock_basic_unlock(&worker->worker_lock); } return; } /** * Worker waiting. * */ void worker_wait_timeout(lock_basic_type* lock, cond_basic_type* condition, time_t timeout) { lock_basic_lock(lock); lock_basic_sleep(condition, lock, timeout); lock_basic_unlock(lock); return; } /** * Worker waiting. * */ void worker_wait(lock_basic_type* lock, cond_basic_type* condition) { worker_wait_timeout(lock, condition, 0); return; } /** * Notify a worker. * */ void worker_notify(lock_basic_type* lock, cond_basic_type* condition) { lock_basic_lock(lock); lock_basic_alarm(condition); lock_basic_unlock(lock); return; } /** * Notify all workers. * */ void worker_notify_all(lock_basic_type* lock, cond_basic_type* condition) { lock_basic_lock(lock); lock_basic_broadcast(condition); lock_basic_unlock(lock); return; } /** * Clean up worker. * */ void worker_cleanup(worker_type* worker) { allocator_type* allocator; cond_basic_type worker_cond; lock_basic_type worker_lock; if (!worker) { return; } allocator = worker->allocator; worker_cond = worker->worker_alarm; worker_lock = worker->worker_lock; allocator_deallocate(allocator, (void*) worker); lock_basic_destroy(&worker_lock); lock_basic_off(&worker_cond); return; } opendnssec-1.4.3/signer/src/daemon/signal.h0000664000175000017500000000372511631156305015562 00000000000000/* * $Id: signal.h 5548 2011-09-05 14:29:25Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signal handling. * */ #ifndef DAEMON_SIGNAL_H #define DAEMON_SIGNAL_H #include "config.h" #include #define SIGNAL_RUN 0 #define SIGNAL_INIT 1 #define SIGNAL_RELOAD 2 #define SIGNAL_SHUTDOWN 3 /** * Set corresponding engine. * \param[in] engine corresponding engine * */ void signal_set_engine(void* engine); /** * Handle signals. * \param[in] sig signal to handle * */ void signal_handler(sig_atomic_t sig); /** * Capture signal. * \param[in] dflsig default signal * \return sig_atomic_t captured signal * */ sig_atomic_t signal_capture(sig_atomic_t dflsig); #endif /* DAEMON_SIGNAL_H */ opendnssec-1.4.3/signer/src/daemon/worker.h0000664000175000017500000001002012062112715015574 00000000000000/* * $Id: worker.h 6890 2012-12-12 14:33:49Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * The hard workers. * */ #ifndef DAEMON_WORKER_H #define DAEMON_WORKER_H #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/locks.h" #include enum worker_enum { WORKER_NONE = 0, WORKER_WORKER = 1, WORKER_DRUDGER }; typedef enum worker_enum worker_id; typedef struct worker_struct worker_type; struct worker_struct { allocator_type* allocator; int thread_num; ods_thread_type thread_id; void* engine; task_type* task; task_id working_with; worker_id type; time_t clock_in; size_t jobs_appointed; size_t jobs_completed; size_t jobs_failed; cond_basic_type worker_alarm; lock_basic_type worker_lock; unsigned sleeping : 1; unsigned waiting : 1; unsigned need_to_exit : 1; }; /** * Create worker. * \param[in] allocator memory allocator * \param[in] num thread number * \param[in] type type of worker * \return worker_type* created worker * */ worker_type* worker_create(allocator_type* allocator, int num, worker_id type); /** * Start working. * \param[in] worker worker to start working * */ void worker_start(worker_type* worker); /** * Put worker to sleep. * \param[in] worker put this worker to sleep * \param[in] timeout time before alarm clock is going off, * 0 means no alarm clock is set. * */ void worker_sleep(worker_type* worker, time_t timeout); /** * Put worker to sleep unless the worker has measured up to all * appointed jobs. * \param[in] worker put this worker to sleep * \param[in] timeout time before alarm clock is going off, * 0 means no alarm clock is set. * */ void worker_sleep_unless(worker_type* worker, time_t timeout); /** * Wake up worker. * \param[in] worker wake up this worker * */ void worker_wakeup(worker_type* worker); /** * Let worker wait. * \param[in] lock lock to use * \param[in] condition condition to be met * */ void worker_wait(lock_basic_type* lock, cond_basic_type* condition); /** * Let worker wait. * \param[in] lock lock to use * \param[in] condition condition to be met * */ void worker_wait_timeout(lock_basic_type* lock, cond_basic_type* condition, time_t timeout); /** * Notify a worker. * \param[in] lock lock to use * \param[in] condition condition that has been met * */ void worker_notify(lock_basic_type* lock, cond_basic_type* condition); /** * Notify all workers. * \param[in] lock lock to use * \param[in] condition condition that has been met * */ void worker_notify_all(lock_basic_type* lock, cond_basic_type* condition); /** * Clean up worker. * \param[in] worker worker to clean up * */ void worker_cleanup(worker_type* worker); #endif /* DAEMON_WORKER_H */ opendnssec-1.4.3/signer/src/daemon/xfrhandler.c0000664000175000017500000001433312040226115016422 00000000000000/* * $Id: xfrhandler.c 4518 2011-02-24 15:39:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone transfer handler. * */ #include "config.h" #include "daemon/engine.h" #include "daemon/xfrhandler.h" #include "shared/duration.h" #include "shared/status.h" #include #include static const char* xfrh_str = "xfrhandler"; static void xfrhandler_handle_dns(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Create zone transfer handler. * */ xfrhandler_type* xfrhandler_create(allocator_type* allocator) { xfrhandler_type* xfrh = NULL; if (!allocator) { return NULL; } xfrh = (xfrhandler_type*) allocator_alloc(allocator, sizeof(xfrhandler_type)); if (!xfrh) { ods_log_error("[%s] unable to create xfrhandler: " "allocator_alloc() failed", xfrh_str); return NULL; } xfrh->allocator = allocator; xfrh->engine = NULL; xfrh->packet = NULL; xfrh->netio = NULL; xfrh->tcp_set = NULL; xfrh->udp_waiting_first = NULL; xfrh->udp_waiting_last = NULL; xfrh->udp_use_num = 0; xfrh->start_time = 0; xfrh->current_time = 0; xfrh->got_time = 0; xfrh->need_to_exit = 0; xfrh->started = 0; /* notify */ xfrh->notify_waiting_first = NULL; xfrh->notify_waiting_last = NULL; xfrh->notify_udp_num = 0; /* setup */ xfrh->netio = netio_create(allocator); if (!xfrh->netio) { ods_log_error("[%s] unable to create xfrhandler: " "netio_create() failed", xfrh_str); xfrhandler_cleanup(xfrh); return NULL; } xfrh->packet = buffer_create(allocator, PACKET_BUFFER_SIZE); if (!xfrh->packet) { ods_log_error("[%s] unable to create xfrhandler: " "buffer_create() failed", xfrh_str); xfrhandler_cleanup(xfrh); return NULL; } xfrh->tcp_set = tcp_set_create(allocator); if (!xfrh->tcp_set) { ods_log_error("[%s] unable to create xfrhandler: " "tcp_set_create() failed", xfrh_str); xfrhandler_cleanup(xfrh); return NULL; } xfrh->dnshandler.fd = -1; xfrh->dnshandler.user_data = (void*) xfrh; xfrh->dnshandler.timeout = 0; xfrh->dnshandler.event_types = NETIO_EVENT_READ; xfrh->dnshandler.event_handler = xfrhandler_handle_dns; return xfrh; } /** * Start zone transfer handler. * */ void xfrhandler_start(xfrhandler_type* xfrhandler) { ods_log_assert(xfrhandler); ods_log_assert(xfrhandler->engine); ods_log_debug("[%s] start", xfrh_str); /* setup */ xfrhandler->start_time = time_now(); /* handlers */ netio_add_handler(xfrhandler->netio, &xfrhandler->dnshandler); /* service */ while (xfrhandler->need_to_exit == 0) { /* dispatch may block for a longer period, so current is gone */ xfrhandler->got_time = 0; ods_log_deeebug("[%s] netio dispatch", xfrh_str); if (netio_dispatch(xfrhandler->netio, NULL, NULL) == -1) { if (errno != EINTR) { ods_log_error("[%s] unable to dispatch netio: %s", xfrh_str, strerror(errno)); } } } /* shutdown */ ods_log_debug("[%s] shutdown", xfrh_str); return; /* xfrd_write_state(xfrd); */ /* close tcp sockets */ /* close udp sockets */ } /** * Get current time from zone transfer handler. * */ time_t xfrhandler_time(xfrhandler_type* xfrhandler) { if (!xfrhandler) { return 0; } if (!xfrhandler->got_time) { xfrhandler->current_time = time_now(); xfrhandler->got_time = 1; } return xfrhandler->current_time; } /** * Signal zone transfer handler. * */ void xfrhandler_signal(xfrhandler_type* xfrhandler) { if (xfrhandler && xfrhandler->started) { ods_thread_kill(xfrhandler->thread_id, SIGHUP); } return; } /** * Handle forwarded dns packets. * */ static void xfrhandler_handle_dns(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { xfrhandler_type* xfrhandler = NULL; uint8_t buf[MAX_PACKET_SIZE]; ssize_t received = 0; if (!handler) { return; } xfrhandler = (xfrhandler_type*) handler->user_data; ods_log_assert(event_types & NETIO_EVENT_READ); ods_log_debug("[%s] read forwarded dns packet", xfrh_str); received = read(xfrhandler->dnshandler.fd, &buf, MAX_PACKET_SIZE); if (received == -1) { ods_log_error("[%s] unable to forward dns packet: %s", xfrh_str, strerror(errno)); } return; } /** * Cleanup zone transfer handler. * */ void xfrhandler_cleanup(xfrhandler_type* xfrhandler) { allocator_type* allocator = NULL; if (!xfrhandler) { return; } allocator = xfrhandler->allocator; netio_cleanup(xfrhandler->netio); buffer_cleanup(xfrhandler->packet, allocator); tcp_set_cleanup(xfrhandler->tcp_set, allocator); allocator_deallocate(allocator, (void*) xfrhandler); return; } opendnssec-1.4.3/signer/src/ods-signer.c0000664000175000017500000002706112210147232015077 00000000000000/* * $Id: ods-signer.c 7254 2013-08-30 16:55:54Z sara $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * OpenDNSSEC signer engine client. * */ #include "config.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include #include /* fcntl() */ #include /* fprintf() */ #include /* strerror(), strncmp(), strlen(), strcpy(), strncat() */ #include /* bzero() */ #include /* select(), FD_ZERO(), FD_SET(), FD_ISSET(), FD_CLR() */ #include /* socket(), connect(), shutdown() */ #include #include /* exit(), read(), write() */ /* According to earlier standards, we need sys/time.h, sys/types.h, unistd.h for select() */ #include #include #define SE_CLI_CMDLEN 6 static const char* cli_str = "client"; /** * Prints usage. * */ static void usage(FILE* out) { fprintf(out, "Usage: %s []\n", "ods-signer"); fprintf(out, "Simple command line interface to control the signer " "engine daemon.\nIf no cmd is given, the tool is going " "into interactive mode.\n"); fprintf(out, "\nBSD licensed, see LICENSE in source package for " "details.\n"); fprintf(out, "Version %s. Report bugs to <%s>.\n", PACKAGE_VERSION, PACKAGE_BUGREPORT); } /** * Return largest value. * */ static int max(int a, int b) { return a= SE_CLI_CMDLEN : and so it is safe to do buffer manipulations below. */ if (strncmp(buf+n-SE_CLI_CMDLEN,"\ncmd> ",SE_CLI_CMDLEN) == 0) { /* we have the full response */ n -= SE_CLI_CMDLEN; buf[n] = '\0'; cmd_response = 1; } } else { /* always null terminate string */ buf[n] = '\0'; } /* n > 0 : when we get to this line... */ for (written=0; written < n; written += ret) { /* write what we got to stdout */ ret = (int) write(fileno(stdout), &buf[written], n-written); /* error and shutdown handling */ if (ret == 0) { fprintf(stderr, "no write\n"); break; } if (ret < 0) { if (errno == EINTR || errno == EWOULDBLOCK) { ret = 0; continue; /* try again... */ } fprintf(stderr, "\n\nwrite error: %s\n", strerror(errno)); break; } /* ret > 0 : when we get here... */ if (written+ret > n) { fprintf(stderr, "\n\nwrite error: more bytes (%d) written " "than required (%d)\n", written+ret, n); break; } /* written+ret < n : means partial write, requires us to loop... */ } if (ods_strcmp(buf, ODS_SE_STOP_RESPONSE) == 0 || cmd_response) { fprintf(stdout, "\n"); return 0; } } if (FD_ISSET(fileno(fp), &rset)) { /* input is readable */ if (cmd && cmd_written) { /* passive mode */ stdineof = 1; ret = shutdown(sockfd, SHUT_WR); if (ret != 0) { fprintf(stderr, "shutdown failed: %s\n", strerror(errno)); return 1; } FD_CLR(fileno(fp), &rset); continue; } /* clear buffer */ for (i=0; i< ODS_SE_MAXLINE; i++) { buf[i] = 0; } /* interactive mode */ if ((n = read(fileno(fp), buf, ODS_SE_MAXLINE)) == 0) { stdineof = 1; ret = shutdown(sockfd, SHUT_WR); if (ret != 0) { fprintf(stderr, "shutdown failed: %s\n", strerror(errno)); return 1; } FD_CLR(fileno(fp), &rset); continue; } buf[ODS_SE_MAXLINE-1] = '\0'; if (strncmp(buf, "exit", 4) == 0 || strncmp(buf, "quit", 4) == 0) { return 0; } ods_str_trim(buf); n = strlen(buf); ods_writen(sockfd, buf, n); } } return 0; } /** * Start interface. * */ static int interface_start(char* cmd) { int sockfd, ret, flags; struct sockaddr_un servaddr; const char* servsock_filename = ODS_SE_SOCKFILE; ods_log_init(NULL, 0, 0); /* new socket */ sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd < 0) { fprintf(stderr, "Unable to connect to engine. " "socket() failed: %s\n", strerror(errno)); return 1; } /* no suprises */ bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_UNIX; strncpy(servaddr.sun_path, servsock_filename, sizeof(servaddr.sun_path) - 1); /* connect */ ret = connect(sockfd, (const struct sockaddr*) &servaddr, sizeof(servaddr)); if (ret != 0) { if (cmd && ods_strcmp(cmd, "start\n") == 0) { return system(ODS_SE_ENGINE); } if (cmd && ods_strcmp(cmd, "running\n") == 0) { fprintf(stderr, "Engine not running.\n"); } else { fprintf(stderr, "Unable to connect to engine: " "connect() failed: %s\n", strerror(errno)); } close(sockfd); return 1; } /* set socket to non-blocking */ flags = fcntl(sockfd, F_GETFL, 0); if (flags < 0) { ods_log_error("[%s] unable to start interface, fcntl(F_GETFL) " "failed: %s", cli_str, strerror(errno)); close(sockfd); return 1; } flags |= O_NONBLOCK; if (fcntl(sockfd, F_SETFL, flags) < 0) { ods_log_error("[%s] unable to start interface, fcntl(F_SETFL) " "failed: %s", cli_str, strerror(errno)); close(sockfd); return 1; } /* some sort of interface */ if (!cmd) { fprintf(stderr, "cmd> "); } /* run */ ret = interface_run(stdin, sockfd, cmd); close(sockfd); return ret; } /** * Main. start interface tool. * */ int main(int argc, char* argv[]) { int c; int options_size = 0; const char* options[5]; char* cmd = NULL; int ret = 0; allocator_type* clialloc = allocator_create(malloc, free); if (!clialloc) { fprintf(stderr,"error, malloc failed for client\n"); exit(1); } if (argc > 5) { fprintf(stderr,"error, too many arguments (%d)\n", argc); exit(1); } /* command line options */ for (c = 0; c < argc; c++) { options[c] = argv[c]; if (c > 0) { options_size += strlen(argv[c]) + 1; } } if (argc > 1) { cmd = (char*) allocator_alloc(clialloc, (options_size+2)*sizeof(char)); if (!cmd) { fprintf(stderr, "memory allocation failed\n"); exit(1); } (void)strncpy(cmd, "", 1); for (c = 1; c < argc; c++) { (void)strncat(cmd, options[c], strlen(options[c])); (void)strncat(cmd, " ", 1); } cmd[options_size-1] = '\n'; } /* main stuff */ if (cmd && ods_strcmp(cmd, "-h\n") == 0) { usage(stdout); ret = 1; } else if (cmd && ods_strcmp(cmd, "--help\n") == 0) { usage(stdout); ret = 1; } else { ret = interface_start(cmd); } /* done */ allocator_deallocate(clialloc, (void*) cmd); allocator_cleanup(clialloc); return ret; } opendnssec-1.4.3/signer/src/shared/0000775000175000017500000000000012247571206014215 500000000000000opendnssec-1.4.3/signer/src/shared/duration.h0000664000175000017500000000744311521551545016141 00000000000000/* * $Id: duration.h 4341 2011-01-31 15:21:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * Durations. */ #ifndef UTIL_DURATION_H #define UTIL_DURATION_H #include "config.h" #include "shared/allocator.h" #include #include /** * Duration. * */ typedef struct duration_struct duration_type; struct duration_struct { allocator_type* allocator; time_t years; time_t months; time_t weeks; time_t days; time_t hours; time_t minutes; time_t seconds; }; /** * Create a new 'instant' duration. * \return duration_type* created duration * */ duration_type* duration_create(void); /** * Compare durations. * \param[in] d1 one duration * \param[in] d2 another duration * \return int 0 if equal, -1 if d1 < d2, 1 if d2 < d1 * */ int duration_compare(duration_type* d1, duration_type* d2); /** * Create a duration from string. * \param[in] str string-format duration * \return duration_type* created duration * */ duration_type* duration_create_from_string(const char* str); /** * Convert a duration to a string. * \param[in] duration duration to be converted * \return char* string-format duration * */ char* duration2string(duration_type* duration); /** * Convert a duration to a time. * \param[in] duration duration to be converted * \return time_t time-format duration * */ time_t duration2time(duration_type* duration); /** * Return a random time. * \param[in] mod modulo * \return time_t random time * */ time_t ods_rand(time_t mod); /** * Return the shortest time. * \param[in] a one time * \param[in] b another time * \return time_t the shortest time * */ time_t time_minimum(time_t a, time_t b); /** * Return the longest time. * \param[in] a one time * \param[in] b another time * \return time_t the shortest time * */ time_t time_maximum(time_t a, time_t b); /** * Convert time into string. * \param[in] n time * \param[in] s string * */ void time_itoa(time_t n, char* s); /** * Return time in datestamp. * \param[in] tt time * \param[in] format stamp format * \param[out] str store string * \return uint32_t integer based datestamp. * */ uint32_t time_datestamp(time_t tt, const char* format, char** str); /** * Return the time since Epoch, measured in seconds. * If the timeshift is enabled, return the environment variable. * \return time_t now (or timeshift). * */ time_t time_now(void); /** * Clean up duration. * \param[in] duration duration to be cleaned up * */ void duration_cleanup(duration_type* duration); #endif /* UTIL_DURATION_H */ opendnssec-1.4.3/signer/src/shared/file.c0000664000175000017500000003270612164766744015243 00000000000000/* * $Id: file.c 7180 2013-07-03 09:24:52Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * File access. */ #include "config.h" #include "shared/file.h" #include "shared/log.h" #include #include #include #include #include #include #include #include #include #define BUFFER_SIZE (16 * 1024) /* use 16K buffers */ static const char* file_str = "file"; static unsigned int file_count = 0; /** * Convert file mode to readable string. * */ const char* ods_file_mode2str(const char* mode) { if (!mode) { return "no mode"; } if (ods_strcmp(mode, "a") == 0) { return "appending"; } else if (ods_strcmp(mode, "r") == 0) { return "reading"; } else if (ods_strcmp(mode, "w") == 0) { return "writing"; } return "unknown mode"; } /** * Get next char. * */ int ods_fgetc(FILE* fd, unsigned int* line_nr) { int c; ods_log_assert(fd); ods_log_assert(line_nr); c = fgetc(fd); if (c == '\n') { (*line_nr)++; } if (c == EOF && errno != 0) { ods_log_crit("[%s] fgetc() failed, enough memory? (%s)", file_str, strerror(errno)); } return c; } /** * Skip white space. * */ int ods_skip_whitespace(FILE* fd, unsigned int* line_nr) { int c; ods_log_assert(fd); ods_log_assert(line_nr); while ((c=ods_fgetc(fd, line_nr)) != EOF) { if (c == ' ' || c == '\t' || c == '\r') { continue; } return c; } return EOF; } /** * Construct file name. (StrAppend?, snprintf?) * */ char* ods_build_path(const char* file, const char* suffix, int dir, int no_slash) { size_t len_file = 0; size_t len_suffix = 0; size_t len_total = 0; char* openf = NULL; if (file) { len_file = strlen(file); if (suffix) { len_suffix = strlen(suffix); } len_total = len_suffix + len_file; if (dir) { len_total++; } if (len_total > 0) { openf = (char*) malloc(sizeof(char)*(len_total + 1)); if (!openf) { ods_log_crit("[%s] build path failed: malloc failed", file_str); return NULL; } strncpy(openf, file, len_file); openf[len_file] = '\0'; if (no_slash) { size_t i = 0; for (i=0; i 0) { openf = (char*) malloc(sizeof(char)*(len_total + 1)); if (!openf) { ods_log_error("[%s] unable to open file %s%s%s for %s: malloc() " "failed", file_str, (dir?dir:""), (dir?"/":""), (file?file:"(null)"), ods_file_mode2str(mode)); return NULL; } if (dir) { strncpy(openf, dir, len_dir); openf[len_dir] = '\0'; if (file) { strncat(openf, file, len_file); } } else if (file) { strncpy(openf, file, len_file); } openf[len_total] = '\0'; if (len_file) { fd = fopen(openf, mode); if (!fd) { ods_log_debug("[%s] unable to open file %s for %s: %s", file_str, openf?openf:"(null)", ods_file_mode2str(mode), strerror(errno)); } else { file_count++; ods_log_debug("[%s] openfile %s count %u", file_str, openf?openf:"(null)", file_count); } } free((void*) openf); } return fd; } /** * Close a file. * */ void ods_fclose(FILE* fd) { if (fd) { file_count--; fclose(fd); } return; } /** * Write to file descriptor. * */ ssize_t ods_writen(int fd, const void* vptr, size_t n) { size_t nleft; ssize_t nwritten; const char* ptr; ptr = vptr; nleft = n; while (nleft > 0) { if ((nwritten = write(fd, ptr, nleft)) <= 0) { if (nwritten < 0 && errno == EINTR) { nwritten = 0; /* and call write again */ } else { return -1; /* error */ } } nleft -= nwritten; ptr += nwritten; } return n; } /** * Get file last modified. * */ time_t ods_file_lastmodified(const char* file) { int ret; struct stat buf; FILE* fd; ods_log_assert(file); if ((fd = ods_fopen(file, NULL, "r")) != NULL) { ret = stat(file, &buf); if (ret == -1) { ods_log_error("[%s] unable to stat file %s: %s", file_str, file, strerror(errno)); } ods_fclose(fd); return buf.st_mtime; } else { ods_log_error("[%s] unable to stat file %s: ods_fopen() failed", file_str, file); } return 0; } /** * Compare strings. * */ int ods_strcmp(const char* s1, const char* s2) { if (!s1 && !s2) { return 0; } else if (!s1) { return -1; } else if (!s2) { return -1; } else if (strlen(s1) != strlen(s2)) { if (strncmp(s1, s2, strlen(s1)) == 0) { return strlen(s1) - strlen(s2); } } return strncmp(s1, s2, strlen(s1)); } /** * Compare a string lowercased * */ int ods_strlowercmp(const char* str1, const char* str2) { while (str1 && str2 && *str1 != '\0' && *str2 != '\0') { if (tolower((int)*str1) != tolower((int)*str2)) { if (tolower((int)*str1) < tolower((int)*str2)) { return -1; } return 1; } str1++; str2++; } if (str1 && str2) { if (*str1 == *str2) { return 0; } else if (*str1 == '\0') { return -1; } } else if (!str1 && !str2) { return 0; } else if (!str1 && str2) { return -1; } return 1; } /** * Replace a substring in string. * */ const char* ods_replace(const char *str, const char *oldstr, const char *newstr) { char* buffer = NULL; char* ch = NULL; size_t part1_len = 0; size_t part2_len = 0; size_t part3_len = 0; if (!str) { return NULL; } if (!oldstr || !newstr) { return str; } if (!(ch = strstr(str, oldstr))) { buffer = strdup(str); return buffer; } part1_len = ch-str; part2_len = strlen(newstr); part3_len = strlen(ch+strlen(oldstr)); buffer = calloc(part1_len+part2_len+part3_len+1, sizeof(char)); if (!buffer) { return NULL; } if (part1_len) { strncpy(buffer, str, part1_len); buffer[part1_len] = '\0'; if (part2_len) { strncat(buffer, str, part2_len); buffer[part1_len+part2_len] = '\0'; } } else { strncpy(buffer, newstr, part2_len); buffer[part2_len] = '\0'; } if (part3_len) { strncat(buffer, ch+strlen(oldstr), part3_len); buffer[part1_len+part2_len+part3_len] = '\0'; } buffer[ch-str] = '\0'; snprintf(buffer+(ch-str), SYSTEM_MAXLEN, "%s%s", newstr, ch+strlen(oldstr)); return buffer; } /** * File copy. * */ ods_status ods_file_copy(const char* file1, const char* file2) { char buf[BUFFER_SIZE]; int fin = 0; int fout = 0; int read_size = 0; if (!file1 || !file2) { return ODS_STATUS_ASSERT_ERR; } if ((fin = open(file1, O_RDONLY|O_NONBLOCK)) < 0) { return ODS_STATUS_FOPEN_ERR; } if ((fout = open(file2, O_WRONLY|O_TRUNC|O_CREAT, 0666)) < 0) { close(fin); return ODS_STATUS_FOPEN_ERR; } while (1) { read_size = read(fin, buf, sizeof(buf)); if (read_size == 0) { break; } if (read_size < 0) { close(fin); close(fout); return ODS_STATUS_FREAD_ERR; } if (write(fout, buf, (unsigned int) read_size) < 0) { close(fin); close(fout); return ODS_STATUS_FWRITE_ERR; } } close(fin); close(fout); return ODS_STATUS_OK; } /** * Get directory part of filename. * */ char* ods_dir_name(const char* file) { int l = strlen(file); char* dir = NULL; ods_log_assert(file); /* find seperator */ while (l>0 && strncmp(file + (l-1), "/", 1) != 0) { l--; } /* now strip off (multiple seperators) */ while (l>0 && strncmp(file + (l-1), "/", 1) == 0) { l--; } if (l) { dir = (char*) calloc(l+1, sizeof(char)); if (dir) { dir = strncpy(dir, file, l); } return dir; } return NULL; } /** * (Create) and change ownership of directories * */ void ods_chown(const char* file, uid_t uid, gid_t gid, int getdir) { char* dir = NULL; if (!file) { ods_log_warning("[%s] no filename given for chown()", file_str); return; } if (!getdir) { ods_log_debug("[%s] create and chown %s with user=%ld group=%ld", file_str, file, (signed long) uid, (signed long) gid); if (chown(file, uid, gid) != 0) { ods_log_error("[%s] chown() %s failed: %s", file_str, file, strerror(errno)); } } else if ((dir = ods_dir_name(file)) != NULL) { ods_log_debug("[%s] create and chown %s with user=%ld group=%ld", file_str, dir, (signed long) uid, (signed long) gid); if (chown(dir, uid, gid) != 0) { ods_log_error("[%s] chown() %s failed: %s", file_str, dir, strerror(errno)); } free((void*) dir); } else { ods_log_warning("[%s] use of relative path: %s", file_str, file); } return; } /** * Remove leading and trailing whitespace. * */ void ods_str_trim(char* str) { int i = strlen(str), nl = 0; /* trailing */ while (i>0) { --i; if (str[i] == '\n') { nl = 1; } if (str[i] == ' ' || str[i] == '\t' || str[i] == '\n') { str[i] = '\0'; } else { break; } } if (nl) { str[++i] = '\n'; } /* leading */ i = 0; while (str[i] == ' ' || str[i] == '\t') { i++; } while (*(str+i) != '\0') { *str = *(str+i); str++; } *str = '\0'; return; } /** * Add a string to a list of strings. Taken from ods-enforcer. * */ void ods_str_list_add(char*** list, char* str) { char** old = NULL; size_t count = 0; if (*list) { for (count=0; (*list)[count]; ++count) { ; } old = *list; *list = (char**) calloc(sizeof(char*), count+2); if (!*list) { ods_fatal_exit("[%s] fatal ods_str_list_add(): calloc() failed", file_str); } if (old) { memcpy(*list, old, count * sizeof(char*)); } free(old); (*list)[count] = str; (*list)[count+1] = NULL; } else { /** List is NULL, allocate new */ *list = calloc(sizeof(char*), 2); if (!*list) { ods_fatal_exit("[%s] fatal ods_str_list_add(): calloc() failed", file_str); } (*list)[0] = str; } return; } opendnssec-1.4.3/signer/src/shared/file.h0000664000175000017500000001126712007720723015226 00000000000000/* * $Id: file.h 6501 2012-08-06 10:52:03Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * File access wrapper. */ #ifndef SHARED_FILE_H #define SHARED_FILE_H #include "config.h" #include "shared/status.h" #include #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #define SYSTEM_MAXLEN 1024 /** * Convert file mode to readable string. * \param[in] mode file mode * \return const char* string * */ const char* ods_file_mode2str(const char* mode); /** * Get next character. * \param[in] fd file descriptor * \param[in] line_nr line number * \return int next character. * */ int ods_fgetc(FILE* fd, unsigned int* line_nr); /** * Skip white space. * \param[in] fd file descriptor * \param[in] line_nr line number * \return int first encountered non-whitespace character * */ int ods_skip_whitespace(FILE* fd, unsigned int* line_nr); /** * Construct file or directory name. * \param[in] file filename without extension * \param[in] suffix extension. * \param[in] dir directory or not * \param[in] no_slash no forward slashes and such characters allowed * \return char* concatenation of file and suffix * */ char* ods_build_path(const char* file, const char* suffix, int dir, int no_slash); /** * Open a file. * \param[in] file filename. * \param[in] dir directory. * \param[in] mode file mode * \return FILE* file descriptor * */ FILE* ods_fopen(const char* file, const char* dir, const char* mode); /** * Close a file. * \param[in] fd the file descriptor * */ void ods_fclose(FILE* fd); /** * Write to file descriptor. * \param[in] fd file descriptor * \param[in] vptr pointer to data * \param[in] n size of data * */ ssize_t ods_writen(int fd, const void* vptr, size_t n); /** * Get file status. * \param[in] file file name * \return time_t last modified * */ time_t ods_file_lastmodified(const char* file); /** * Compare strings. * \param[in] s1 one string * \param[in] s2 another string * \return -1, 0 or 1 * */ int ods_strcmp(const char* s1, const char* s2); /** * Compare strings lowercased. * \param[in] s1 one string * \param[in] s2 another string * \return -1, 0 or 1 * */ int ods_strlowercmp(const char* s1, const char* s2); /** * Replace a substring in string. * \param[in] str The string * \param[in] oldstr old substring * \param[in] newstr new substring * \return char* the substituted string. * */ const char* ods_replace(const char *str, const char *oldstr, const char *newstr); /** * Get directory part of filename. * \param[in] file file name * \return char* directory part * */ char* ods_dir_name(const char* file); /** * Copy file. * \param[in] file1 from file name * \param[in] file2 to file name * \return ods_status * */ ods_status ods_file_copy(const char* file1, const char* file2); /** * (Create) and change ownership of directories. * \param[in] file file name * \param[in] uid user id * \param[in] gid group id * \param[in] getdir fetch directory part * */ void ods_chown(const char* file, uid_t uid, gid_t gid, int getdir); /** * Remove leading and trailing whitespace. * \param[in] str string to trim * */ void ods_str_trim(char* str); /** * Add a string to a list of strings. Taken from ods-enforcer. * \param[out] list string list * \param[in] str string to add * */ void ods_str_list_add(char*** list, char* str); #endif /* SHARED_FILE_H */ opendnssec-1.4.3/signer/src/shared/locks.c0000664000175000017500000001144712107366547015430 00000000000000/* * $Id: locks.c 7039 2013-02-15 08:10:15Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Threading and locking. * */ #include "config.h" #include "shared/locks.h" #include "shared/log.h" #include #include /* sigfillset(), sigprocmask() */ #include /* strerror() */ #ifdef HAVE_SYS_TIME_H #include /* gettimeofday() */ #endif #ifdef HAVE_TIME_H #include /* gettimeofday() */ #endif static const char* lock_str = "lock"; #if !defined(HAVE_PTHREAD) #include /* waitpid() */ #include /* getpid(), waitpid() */ #include /* fork(), getpid() */ /** * No threading available: fork a new process. * This means no shared data structure, and no locking. * Only the main thread ever returns. Exits on errors. * @param thr: the location where to store the thread-id. * @param func: function body of the thread. Return value of func is lost. * @param arg: user argument to func. */ void ods_thr_fork_create(ods_thread_type* thr, void* (*func)(void*), void* arg) { pid_t pid = fork(); switch (pid) { case 0: /* child */ *thr = (ods_thread_type)getpid(); (void)(*func)(arg); exit(0); case -1: /* error */ ods_fatal_exit("[%s] unable to fork thread: %s", lock_str, strerror(errno)); default: /* main */ *thr = (ods_thread_type)pid; return; } return; } /** * There is no threading. Wait for a process to terminate. * Note that ub_thread_t is defined as pid_t. * @param thread: the process id to wait for. */ void ods_thr_fork_wait(ods_thread_type thread) { int status = 0; if (waitpid((pid_t)thread, &status, 0) == -1) { ods_log_error("[%s] waitpid(%d): %s", lock_str, (int)thread, strerror(errno)); } if (status != 0) { ods_log_warning("[%s] process %d abnormal exit with status %d", lock_str, (int)thread, status); } return; } #else /* defined(HAVE_PTHREAD) */ int ods_thread_wait(cond_basic_type* cond, lock_basic_type* lock, time_t wait) { struct timespec ts; int ret = 0; /* If timeshift is enabled, we don't care about threads. No need * to take the timeshift into account here */ #ifndef HAVE_CLOCK_GETTIME struct timeval tv; if (gettimeofday(&tv, NULL) != 0) { ods_log_error("[%s] clock_gettime() error: %s", lock_str, strerror(errno)); return 1; } ts.tv_sec = tv.tv_sec; ts.tv_nsec = (tv.tv_usec/1000); #else /* HAVE_CLOCK_GETTIME */ if (clock_gettime(CLOCK_REALTIME, &ts) < 0) { ods_log_error("[%s] clock_gettime() error: %s", lock_str, strerror(errno)); return 1; } #endif /* !HAVE_CLOCK_GETTIME */ if (wait > 0) { ts.tv_sec = ts.tv_sec + wait; ret = pthread_cond_timedwait(cond, lock, &ts); } else { ret = pthread_cond_wait(cond, lock); } if (ret == ETIMEDOUT) { return 0; } return ret; } #endif /* defined(HAVE_PTHREAD) */ void ods_thread_blocksigs(void) { #ifndef HAVE_PTHREAD int err = 0; #endif sigset_t sigset; sigfillset(&sigset); #ifndef HAVE_PTHREAD if((err=pthread_sigmask(SIG_SETMASK, &sigset, NULL))) ods_fatal_exit("[%s] pthread_sigmask: %s", lock_str, strerror(err)); #else /* !HAVE_PTHREAD */ /* have nothing, do single process signal mask */ if(sigprocmask(SIG_SETMASK, &sigset, NULL) != 0) ods_fatal_exit("[%s] sigprocmask: %s", lock_str, strerror(errno)); #endif /* HAVE_PTHREAD */ } opendnssec-1.4.3/signer/src/shared/util.c0000664000175000017500000002546712024053460015262 00000000000000/* * $Id: util.c 6660 2012-09-12 09:34:40Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * Utility tools. */ #include "config.h" #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #include #include #include #include #include #include #include static const char* util_str = "util"; /** * Check if a RR is a DNSSEC RR (RRSIG, NSEC, NSEC3 or NSEC3PARAMS). * */ int util_is_dnssec_rr(ldns_rr* rr) { ldns_rr_type type = 0; if (!rr) { return 0; } type = ldns_rr_get_type(rr); return (type == LDNS_RR_TYPE_RRSIG || type == LDNS_RR_TYPE_NSEC || type == LDNS_RR_TYPE_NSEC3 || type == LDNS_RR_TYPE_NSEC3PARAMS); } /** * Compare SERIALs. * */ int util_serial_gt(uint32_t serial_new, uint32_t serial_old) { return DNS_SERIAL_GT(serial_new, serial_old); } /** * Compare SOA RDATAs. * */ int util_soa_compare_rdata(ldns_rr* rr1, ldns_rr* rr2) { size_t i = 0; size_t rdata_count = SE_SOA_RDATA_MINIMUM; for (i = 0; i <= rdata_count; i++) { if (i != SE_SOA_RDATA_SERIAL && ldns_rdf_compare(ldns_rr_rdf(rr1, i), ldns_rr_rdf(rr2, i)) != 0) { return 1; } } return 0; } /** * Compare SOA RRs. * */ int util_soa_compare(ldns_rr* rr1, ldns_rr* rr2) { size_t rr1_len = 0; size_t rr2_len = 0; size_t offset = 0; if (!rr1 || !rr2) { return 1; } rr1_len = ldns_rr_uncompressed_size(rr1); rr2_len = ldns_rr_uncompressed_size(rr2); if (ldns_dname_compare(ldns_rr_owner(rr1), ldns_rr_owner(rr2)) != 0) { return 1; } if (ldns_rr_get_class(rr1) != ldns_rr_get_class(rr2)) { return 1; } if (ldns_rr_get_type(rr1) != LDNS_RR_TYPE_SOA) { return 1; } if (ldns_rr_get_type(rr1) != ldns_rr_get_type(rr2)) { return 1; } if (offset > rr1_len || offset > rr2_len) { if (rr1_len == rr2_len) { return util_soa_compare_rdata(rr1, rr2); } return 1; } return util_soa_compare_rdata(rr1, rr2); } /** * Compare RRs only on RDATA. * */ ldns_status util_dnssec_rrs_compare(ldns_rr* rr1, ldns_rr* rr2, int* cmp) { ldns_status status = LDNS_STATUS_OK; size_t rr1_len; size_t rr2_len; ldns_buffer* rr1_buf; ldns_buffer* rr2_buf; if (!rr1 || !rr2) { return LDNS_STATUS_ERR; } rr1_len = ldns_rr_uncompressed_size(rr1); rr2_len = ldns_rr_uncompressed_size(rr2); rr1_buf = ldns_buffer_new(rr1_len); rr2_buf = ldns_buffer_new(rr2_len); /* name, class and type should already be equal */ status = ldns_rr2buffer_wire_canonical(rr1_buf, rr1, LDNS_SECTION_ANY); if (status != LDNS_STATUS_OK) { ldns_buffer_free(rr1_buf); ldns_buffer_free(rr2_buf); /* critical */ return status; } status = ldns_rr2buffer_wire_canonical(rr2_buf, rr2, LDNS_SECTION_ANY); if (status != LDNS_STATUS_OK) { ldns_buffer_free(rr1_buf); ldns_buffer_free(rr2_buf); /* critical */ return status; } *cmp = ldns_rr_compare_wire(rr1_buf, rr2_buf); ldns_buffer_free(rr1_buf); ldns_buffer_free(rr2_buf); return LDNS_STATUS_OK; } /** * A more efficient ldns_dnssec_rrs_add_rr(), get rid of ldns_rr_compare(). * */ ldns_status util_dnssec_rrs_add_rr(ldns_dnssec_rrs *rrs, ldns_rr *rr) { int cmp = 0; ldns_dnssec_rrs *new_rrs = NULL; ldns_status status = LDNS_STATUS_OK; uint32_t rr_ttl = 0; uint32_t default_ttl = 0; if (!rrs || !rrs->rr || !rr) { return LDNS_STATUS_ERR; } rr_ttl = ldns_rr_ttl(rr); status = util_dnssec_rrs_compare(rrs->rr, rr, &cmp); if (status != LDNS_STATUS_OK) { /* critical */ return status; } if (cmp < 0) { if (rrs->next) { return util_dnssec_rrs_add_rr(rrs->next, rr); } else { new_rrs = ldns_dnssec_rrs_new(); new_rrs->rr = rr; rrs->next = new_rrs; default_ttl = ldns_rr_ttl(rrs->rr); if (rr_ttl < default_ttl) { ldns_rr_set_ttl(rrs->rr, rr_ttl); } else { ldns_rr_set_ttl(new_rrs->rr, default_ttl); } return LDNS_STATUS_OK; } } else if (cmp > 0) { /* put the current old rr in the new next, put the new rr in the current container */ new_rrs = ldns_dnssec_rrs_new(); new_rrs->rr = rrs->rr; new_rrs->next = rrs->next; rrs->rr = rr; rrs->next = new_rrs; default_ttl = ldns_rr_ttl(new_rrs->rr); if (rr_ttl < default_ttl) { ldns_rr_set_ttl(new_rrs->rr, rr_ttl); } else { ldns_rr_set_ttl(rrs->rr, default_ttl); } return LDNS_STATUS_OK; } else { /* should we error on equal? or free memory of rr */ ods_log_warning("[%s] adding duplicate RR?", util_str); return LDNS_STATUS_NO_DATA; } return LDNS_STATUS_OK; } /** * Read process id from file. * */ static pid_t util_read_pidfile(const char* file) { int fd; pid_t pid; char pidbuf[32]; char *t; int l; if ((fd = open(file, O_RDONLY)) == -1) { return -1; } if (((l = read(fd, pidbuf, sizeof(pidbuf)))) == -1) { close(fd); return -1; } close(fd); /* Empty pidfile means no pidfile... */ if (l == 0) { errno = ENOENT; return -1; } pid = (pid_t) strtol(pidbuf, &t, 10); if (*t && *t != '\n') { return -1; } return pid; } /** * Check process id file. * */ int util_check_pidfile(const char* pidfile) { pid_t oldpid; struct stat stat_ret; /** * If the file exists then either we didn't shutdown cleanly or * a signer daemon is already running: in either case shutdown. */ if (stat(pidfile, &stat_ret) != 0) { if (errno != ENOENT) { ods_log_error("[%s] cannot stat pidfile %s: %s", util_str, pidfile, strerror(errno)); } /* else: file does not exist: carry on */ } else { if (S_ISREG(stat_ret.st_mode)) { /** The pidfile exists already */ if ((oldpid = util_read_pidfile(pidfile)) == -1) { /** Consider stale pidfile */ if (errno != ENOENT) { ods_log_error("[%s] cannot read pidfile %s: %s", util_str, pidfile, strerror(errno)); } } else { if (kill(oldpid, 0) == 0 || errno == EPERM) { ods_log_crit("[%s] pidfile %s already exists, " "a process with pid %u is already running. " "If no ods-signerd process is running, a previous " "instance didn't shutdown cleanly, please remove this " "file and try again.", util_str, pidfile, oldpid); return 0; } else { /** Consider state pidfile */ ods_log_warning("[%s] pidfile %s already exists, " "but no process with pid %u is running. " "A previous instance didn't shutdown cleanly, this " "pidfile is stale.", util_str, pidfile, oldpid); } } } } /** All good, carry on */ return 1; } /** * Write process id to file. * */ int util_write_pidfile(const char* pidfile, pid_t pid) { FILE* fd; char pidbuf[32]; size_t result = 0, size = 0; ods_log_assert(pidfile); ods_log_assert(pid); ods_log_debug("[%s] writing pid %lu to pidfile %s", util_str, (unsigned long) pid, pidfile); snprintf(pidbuf, sizeof(pidbuf), "%lu\n", (unsigned long) pid); fd = ods_fopen(pidfile, NULL, "w"); if (!fd) { return -1; } size = strlen(pidbuf); if (size == 0) { result = 1; } else { result = fwrite((const void*) pidbuf, 1, size, fd); } if (result == 0) { ods_log_error("[%s] write to pidfile %s failed: %s", util_str, pidfile, strerror(errno)); } else if (result < size) { ods_log_error("[%s] short write to pidfile %s: disk full?", util_str, pidfile); result = 0; } else { result = 1; } ods_fclose(fd); if (!result) { return -1; } return 0; } /** * Print an LDNS RR, check status. * */ ods_status util_rr_print(FILE* fd, const ldns_rr* rr) { char* result = NULL; ldns_buffer* tmp_buffer = NULL; ods_status status = ODS_STATUS_OK; if (!fd || !rr) { return ODS_STATUS_ASSERT_ERR; } tmp_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN); if (!tmp_buffer) { return ODS_STATUS_MALLOC_ERR; } if (ldns_rr2buffer_str_fmt(tmp_buffer, NULL, rr) == LDNS_STATUS_OK) { /* export and return string, destroy rest */ result = ldns_buffer2str(tmp_buffer); if (result) { fprintf(fd, "%s", result); status = ODS_STATUS_OK; LDNS_FREE(result); } else { fprintf(fd, "; Unable to convert rr to string\n"); status = ODS_STATUS_FWRITE_ERR; } } else { status = ODS_STATUS_FWRITE_ERR; } ldns_buffer_free(tmp_buffer); return status; } /** * Calculates the size needed to store the result of b64_pton. * */ size_t util_b64_pton_calculate_size(size_t srcsize) { return (((((srcsize + 3) / 4) * 3)) + 1); } opendnssec-1.4.3/signer/src/shared/status.h0000664000175000017500000000633612205607427015640 00000000000000/* * $Id$ * * Copyright (c) 2010-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * * Status. */ #ifndef UTIL_STATUS_H #define UTIL_STATUS_H #include "config.h" enum ods_enum_status { ODS_STATUS_OK, ODS_STATUS_EOF, ODS_STATUS_NOTIMPL, ODS_STATUS_UPTODATE, ODS_STATUS_ASSERT_ERR, ODS_STATUS_CFG_ERR, ODS_STATUS_CHDIR_ERR, ODS_STATUS_CHROOT_ERR, ODS_STATUS_CMDHANDLER_ERR, ODS_STATUS_XFRHANDLER_ERR, ODS_STATUS_CONFLICT_ERR, ODS_STATUS_ERR, ODS_STATUS_FOPEN_ERR, ODS_STATUS_FORK_ERR, ODS_STATUS_FREAD_ERR, ODS_STATUS_FWRITE_ERR, ODS_STATUS_HSM_ERR, ODS_STATUS_INSECURE, ODS_STATUS_MALLOC_ERR, ODS_STATUS_RENAME_ERR, ODS_STATUS_UNLINK_ERR, ODS_STATUS_SOCK_BIND, ODS_STATUS_SOCK_FCNTL_NONBLOCK, ODS_STATUS_SOCK_GETADDRINFO, ODS_STATUS_SOCK_LISTEN, ODS_STATUS_SOCK_SETSOCKOPT_V6ONLY, ODS_STATUS_SOCK_SOCKET_UDP, ODS_STATUS_SOCK_SOCKET_TCP, ODS_STATUS_ACL_SUBNET_BAD_RANGE, ODS_STATUS_ACL_SUBNET_OUT_RANGE, ODS_STATUS_PARSE_ERR, ODS_STATUS_PRIVDROP_ERR, ODS_STATUS_RNG_ERR, ODS_STATUS_SETSID_ERR, ODS_STATUS_UNCHANGED, ODS_STATUS_WRITE_PIDFILE_ERR, ODS_STATUS_XML_ERR, ODS_STATUS_XFR_NOT_READY, ODS_STATUS_SKIPDNAME, ODS_STATUS_BUFAVAIL, ODS_STATUS_PARSESOA, ODS_STATUS_REQAXFR, ODS_STATUS_INSERIAL, ODS_STATUS_XFRBADFORM, ODS_STATUS_XFRINCOMPLETE }; typedef enum ods_enum_status ods_status; typedef struct ods_struct_lookup_table ods_lookup_table; struct ods_struct_lookup_table { int id; const char* name; }; extern ods_lookup_table ods_status_str[]; /** * Look up item in table. * \param[in] table table * \param[in] id identifier * */ ods_lookup_table* ods_lookup_by_id(ods_lookup_table *table, int id); /** * Look up a descriptive text by each status. * \param[in] status status identifierr * \return const char* corresponding descriptive text * */ const char *ods_status2str(ods_status status); #endif /* UTIL_STATUS_H */ opendnssec-1.4.3/signer/src/shared/locks.h0000664000175000017500000001031111665414630015415 00000000000000/* * $Id: locks.h 5946 2011-11-30 11:55:04Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Threading and locking. * */ #ifndef SCHEDULER_LOCKS_H #define SCHEDULER_LOCKS_H #include "config.h" #include "shared/log.h" #include #include #define LOCKRET(func) do { \ int err; \ if ( (err=(func)) != 0) \ ods_log_error("%s at %d could not " #func ": %s", \ __FILE__, __LINE__, strerror(err)); \ } while(0) #if defined(HAVE_PTHREAD) #include /** use pthread mutex for basic lock */ typedef pthread_mutex_t lock_basic_type; /** use pthread cond for basic condition */ typedef pthread_cond_t cond_basic_type; /** small front for pthread init func, NULL is default attrs. */ #define lock_basic_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) #define lock_basic_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) #define lock_basic_lock(lock) LOCKRET(pthread_mutex_lock(lock)) #define lock_basic_unlock(lock) LOCKRET(pthread_mutex_unlock(lock)) /** our own alarm clock */ #define lock_basic_set(cond) LOCKRET(pthread_cond_init(cond, NULL)) #define lock_basic_sleep(cond, lock, sleep) LOCKRET(ods_thread_wait(cond, lock, sleep)) #define lock_basic_alarm(cond) LOCKRET(pthread_cond_signal(cond)) #define lock_basic_broadcast(cond) LOCKRET(pthread_cond_broadcast(cond)) #define lock_basic_off(cond) LOCKRET(pthread_cond_destroy(cond)) int ods_thread_wait(cond_basic_type* cond, lock_basic_type* lock, time_t wait); /** thread creation */ typedef pthread_t ods_thread_type; /** Pass where to store tread_t in thr. Use default NULL attributes. */ #define ods_thread_create(thr, func, arg) LOCKRET(pthread_create(thr, NULL, func, arg)) #define ods_thread_detach(thr) LOCKRET(pthread_detach(thr)) #define ods_thread_self() pthread_self() #define ods_thread_join(thr) LOCKRET(pthread_join(thr, NULL)) #define ods_thread_kill(thr, sig) LOCKRET(pthread_kill(thr, sig)) int ods_thread_wait(cond_basic_type* cond, lock_basic_type* lock, time_t wait); void ods_thread_blocksigs(void); #else /* !HAVE_PTHREAD */ /* we do not have PTHREADS */ #define PTHREADS_DISABLED 1 typedef int lock_basic_type; #define lock_basic_init(lock) /* nop */ #define lock_basic_destroy(lock) /* nop */ #define lock_basic_lock(lock) /* nop */ #define lock_basic_unlock(lock) /* nop */ #define lock_basic_set(cond) /* nop */ #define lock_basic_sleep(cond, lock, sleep) /* nop */ #define lock_basic_alarm(cond) /* nop */ #define lock_basic_broadcast(cond) /* nop */ #define lock_basic_off(cond) /* nop */ typedef pid_t ods_thread_type; #define ods_thread_create(thr, func, arg) ods_thr_fork_create(thr, func, arg) #define ods_thread_detach(thr) /* nop */ #define ods_thread_self() getpid() #define ods_thread_join(thr) ods_thr_fork_wait(thr) void ods_thr_fork_create(ods_thread_type* thr, void* (*func)(void*), void* arg); void ods_thr_fork_wait(ods_thread_type thread); #endif /* HAVE_PTHREAD */ void ods_thread_blocksigs(void); #endif /* SHARED_LOCKS_H */ opendnssec-1.4.3/signer/src/shared/util.h0000664000175000017500000000711412022131710015245 00000000000000/* * $Id: util.h 6638 2012-09-06 14:31:36Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * Utility tools. */ #ifndef UTIL_UTIL_H #define UTIL_UTIL_H #include "config.h" #include "shared/status.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #define SE_SOA_RDATA_SERIAL 2 #define SE_SOA_RDATA_EXPIRE 5 #define SE_SOA_RDATA_MINIMUM 6 /* copycode: This define is taken from BIND9 */ #define DNS_SERIAL_GT(a, b) ((int)(((a) - (b)) & 0xFFFFFFFF) > 0) /** * Check if a RR is a DNSSEC RR (RRSIG, NSEC, NSEC3 or NSEC3PARAMS). * \param[in] rr RR * \return int 1 on true, 0 on false * */ int util_is_dnssec_rr(ldns_rr* rr); /** * Compare SERIALs. * \param serial_new new SERIAL value * \param serial_old old SERIAL value * \return int 0 if the new SERIAL <= old SERIAL, non-zero otherwise * */ int util_serial_gt(uint32_t serial_new, uint32_t serial_old); /** * Compare RRs, ignore SOA SERIAL. * \param[in] rr1 RR * \param[in] rr2 another RR * \return int 0 if equal SOA RRs, 1 otherwise * */ int util_soa_compare(ldns_rr* rr1, ldns_rr* rr2); /** * Compare RRs only on RDATA. * \param[in] rr1 RR * \param[in] rr2 another RR * \param[out] cmp compare value * \return status compare status * */ ldns_status util_dnssec_rrs_compare(ldns_rr* rr1, ldns_rr* rr2, int* cmp); /** * A more efficient ldns_dnssec_rrs_add_rr(), get rid of ldns_rr_compare(). * \param[in] rrs RRset * \param[in] rr to add * \return ldns_status status * */ ldns_status util_dnssec_rrs_add_rr(ldns_dnssec_rrs *rrs, ldns_rr *rr); /** * Check process id file. * \param[in] pidfile pid filename * \return int status (0 if process id in pidfile is running) * */ int util_check_pidfile(const char* pidfile); /** * Write process id to file. * \param[in] pidfile pid filename * \param[in] pid process id * \return int status * */ int util_write_pidfile(const char* pidfile, pid_t pid); /** * Print an LDNS RR, check status. * \param[in] fd file descriptor * \param[in] rr RR * \return ods_status status * */ ods_status util_rr_print(FILE* fd, const ldns_rr* rr); /** * Calculates the size needed to store the result of b64_pton. * \param[in] len strlen * \return size of b64_pton * */ size_t util_b64_pton_calculate_size(size_t srcsize); #endif /* UTIL_UTIL_H */ opendnssec-1.4.3/signer/src/shared/status.c0000664000175000017500000001050712205607427015626 00000000000000/* * $Id$ * * Copyright (c) 2009-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * * Status. */ #include "config.h" #include "shared/status.h" #include ods_lookup_table ods_status_str[] = { { ODS_STATUS_OK, "All OK" }, { ODS_STATUS_EOF, "End of file" }, { ODS_STATUS_NOTIMPL, "Not implemented"}, { ODS_STATUS_UPTODATE, "Up to date"}, { ODS_STATUS_ASSERT_ERR, "Assertion error"}, { ODS_STATUS_CFG_ERR, "Configuration error"}, { ODS_STATUS_CHDIR_ERR, "Change directory failed"}, { ODS_STATUS_CHROOT_ERR, "Change root failed"}, { ODS_STATUS_CMDHANDLER_ERR, "Command handler error"}, { ODS_STATUS_XFRHANDLER_ERR, "XFR handler error"}, { ODS_STATUS_CONFLICT_ERR, "Conflict detected"}, { ODS_STATUS_ERR, "General error"}, { ODS_STATUS_FOPEN_ERR, "Unable to open file"}, { ODS_STATUS_FORK_ERR, "fork() failed"}, { ODS_STATUS_FREAD_ERR, "Unable to read file"}, { ODS_STATUS_FWRITE_ERR, "Unable to write file"}, { ODS_STATUS_HSM_ERR, "HSM error"}, { ODS_STATUS_INSECURE, "Insecure"}, { ODS_STATUS_MALLOC_ERR, "Memory allocation error"}, { ODS_STATUS_RENAME_ERR, "Unable to rename file"}, { ODS_STATUS_UNLINK_ERR, "Unable to unlink file"}, { ODS_STATUS_SOCK_BIND, "Unable to bind socket"}, { ODS_STATUS_SOCK_FCNTL_NONBLOCK, "Unable to set socket to nonblocking"}, { ODS_STATUS_SOCK_GETADDRINFO, "Unable to retrieve address information"}, { ODS_STATUS_SOCK_LISTEN, "Unable to listen on socket"}, { ODS_STATUS_SOCK_SETSOCKOPT_V6ONLY, "Unable to set socket to v6only"}, { ODS_STATUS_SOCK_SOCKET_UDP, "Unable to create udp socket"}, { ODS_STATUS_SOCK_SOCKET_TCP, "Unable to create tcp socket"}, { ODS_STATUS_ACL_SUBNET_BAD_RANGE, "Bad subnet range"}, { ODS_STATUS_ACL_SUBNET_OUT_RANGE, "Subnet out of range"}, { ODS_STATUS_PARSE_ERR, "Parse error"}, { ODS_STATUS_PRIVDROP_ERR, "Unable to drop privileges"}, { ODS_STATUS_RNG_ERR, "RelaxNG error"}, { ODS_STATUS_SETSID_ERR, "setsid() failed"}, { ODS_STATUS_UNCHANGED, "Status unchanged"}, { ODS_STATUS_WRITE_PIDFILE_ERR, "Unable to write process id to pidfile"}, { ODS_STATUS_XML_ERR, "XML error"}, { ODS_STATUS_XFR_NOT_READY, "Incoming zone transfer not ready"}, { ODS_STATUS_SKIPDNAME, "Failed to skip domain name"}, { ODS_STATUS_BUFAVAIL, "Insufficient space available in buffer"}, { ODS_STATUS_PARSESOA, "Failed to parse SOA RR"}, { ODS_STATUS_REQAXFR, "Got IXFR, but AXFR required"}, { ODS_STATUS_INSERIAL, "Serial mismatch"}, { ODS_STATUS_XFRBADFORM, "XFR bad format"}, { ODS_STATUS_XFRINCOMPLETE, "XFR on disk incomplete (in progress?)"}, { 0, NULL } }; ods_lookup_table* ods_lookup_by_id(ods_lookup_table *table, int id) { while (table->name != NULL) { if (table->id == id) { return table; } table++; } return NULL; } /** * Look up a descriptive text by each status. * */ const char* ods_status2str(ods_status status) { ods_lookup_table *lt; lt = ods_lookup_by_id(ods_status_str, status); if (lt) { return lt->name; } return NULL; } opendnssec-1.4.3/signer/src/shared/hsm.h0000664000175000017500000000545111712463740015101 00000000000000/* * $Id: hsm.h 6128 2012-02-02 10:39:28Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Hardware Security Module support. * */ #ifndef SHARED_HSM_H #define SHARED_HSM_H #include "config.h" #include "shared/status.h" #include "signer/keys.h" #include #include #include #include #include /** * Open HSM. * \param[in] filename the configuration filename * \return int hsm status * */ int lhsm_open(const char* filename); /** * Reopen HSM. * \param[in] filename the configuration filename * \return int hsm status * */ int lhsm_reopen(const char* filename); /** * Check the HSM connection, reload engine if necessary. * \param[in] engine signer engine. * */ void lhsm_check_connection(void* engine); /** * Get key from one of the HSMs, store the DNSKEY and HSM key. * \param[in] ctx HSM context * \param[in] owner the zone owner name * \param[in] key_id key credentials * \return ods_status status * */ ods_status lhsm_get_key(hsm_ctx_t* ctx, ldns_rdf* owner, key_type* key_id); /** * Get RRSIG from one of the HSMs, given a RRset and a key. * \param[in] ctx HSM context * \param[in] rrset RRset to be signed * \param[in] key_id key credentials * \param[in] owner owner of the keys * \param[in] inception signature inception * \param[in] expiration signature expiration * \return ldns_rr* RRSIG record * */ ldns_rr* lhsm_sign(hsm_ctx_t* ctx, ldns_rr_list* rrset, key_type* key_id, ldns_rdf* owner, time_t inception, time_t expiration); #endif /* SHARED_HSM_H */ opendnssec-1.4.3/signer/src/shared/log.c0000664000175000017500000002164011770075476015075 00000000000000/* * $Id: log.c 3845 2010-08-31 14:19:24Z matthijs $ * * Copyright (c) 2009 NLnet Labs. 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, 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 ``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 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. * */ /** * Logging. * */ #include "config.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #ifdef HAVE_SYSLOG_H static int logging_to_syslog = 0; #endif /* !HAVE_SYSLOG_H */ #include /* va_start(), va_end() */ #include /* fflush, fprintf(), vsnprintf() */ #include /* exit() */ #include /* strlen() */ static FILE* logfile = NULL; static int log_level = LOG_CRIT; #define CTIME_LENGTH 26 /** * Use _r() functions on platforms that have. They are thread safe versions of * the normal syslog functions. Platforms without _r() usually have thread safe * normal functions. */ #if defined(HAVE_SYSLOG_R) && defined(HAVE_OPENLOG_R) && defined(HAVE_CLOSELOG_R) struct syslog_data sdata = SYSLOG_DATA_INIT; #else #undef HAVE_SYSLOG_R #undef HAVE_OPENLOG_R #undef HAVE_CLOSELOG_R #endif /* TODO: - log_init should have program_name variable - wrap special case logging onto generic one - check if xml-specific logging functions are still neeeded (enforcer) - */ #define MY_PACKAGE_TARNAME "ods-signerd" static const char* log_str = "log"; /** * Initialize logging. * */ void ods_log_init(const char *filename, int use_syslog, int verbosity) { #ifdef HAVE_SYSLOG_H int facility; #endif /* HAVE_SYSLOG_H */ ods_log_verbose("[%s] switching log to %s verbosity %i (log level %i)", log_str, use_syslog?"syslog":(filename&&filename[0]?filename:"stderr"), verbosity, verbosity+2); if (logfile && logfile != stderr) { ods_fclose(logfile); } log_level = verbosity + 2; #ifdef HAVE_SYSLOG_H if(logging_to_syslog) { #ifdef HAVE_CLOSELOG_R closelog_r(&sdata); #else closelog(); #endif logging_to_syslog = 0; } if(use_syslog) { facility = ods_log_get_facility(filename); #ifdef HAVE_OPENLOG_R openlog_r(MY_PACKAGE_TARNAME, LOG_NDELAY, facility, &sdata); #else openlog(MY_PACKAGE_TARNAME, LOG_NDELAY, facility); #endif logging_to_syslog = 1; return; } #endif /* HAVE_SYSLOG_H */ if(filename && filename[0]) { logfile = ods_fopen(filename, NULL, "a"); if (logfile) { ods_log_debug("[%s] new logfile %s", log_str, filename); return; } logfile = stderr; ods_log_warning("[%s] cannot open %s for appending, logging to " "stderr", log_str, filename); } else { logfile = stderr; } return; } /** * Close logging. * */ void ods_log_close(void) { ods_log_debug("[%s] close log", log_str); ods_log_init(NULL, 0, 0); } /** * Get facility by string. * ods_log_get_user * ods_log_get_facility * return error, LOG_*** as a parameter * */ #ifdef HAVE_SYSLOG_H int ods_log_get_facility(const char* facility) { int length; if (!facility) { return LOG_DAEMON; } length = strlen(facility); if (length == 4 && strncasecmp(facility, "KERN", 4) == 0) return LOG_KERN; else if (length == 4 && strncasecmp(facility, "USER", 4) == 0) return LOG_USER; else if (length == 4 && strncasecmp(facility, "MAIL", 4) == 0) return LOG_MAIL; else if (length == 6 && strncasecmp(facility, "DAEMON", 6) == 0) return LOG_DAEMON; else if (length == 4 && strncasecmp(facility, "AUTH", 4) == 0) return LOG_AUTH; else if (length == 3 && strncasecmp(facility, "LPR", 3) == 0) return LOG_LPR; else if (length == 4 && strncasecmp(facility, "NEWS", 4) == 0) return LOG_NEWS; else if (length == 4 && strncasecmp(facility, "UUCP", 4) == 0) return LOG_UUCP; else if (length == 4 && strncasecmp(facility, "CRON", 4) == 0) return LOG_CRON; else if (length == 6 && strncasecmp(facility, "LOCAL0", 6) == 0) return LOG_LOCAL0; else if (length == 6 && strncasecmp(facility, "LOCAL1", 6) == 0) return LOG_LOCAL1; else if (length == 6 && strncasecmp(facility, "LOCAL2", 6) == 0) return LOG_LOCAL2; else if (length == 6 && strncasecmp(facility, "LOCAL3", 6) == 0) return LOG_LOCAL3; else if (length == 6 && strncasecmp(facility, "LOCAL4", 6) == 0) return LOG_LOCAL4; else if (length == 6 && strncasecmp(facility, "LOCAL5", 6) == 0) return LOG_LOCAL5; else if (length == 6 && strncasecmp(facility, "LOCAL6", 6) == 0) return LOG_LOCAL6; else if (length == 6 && strncasecmp(facility, "LOCAL7", 6) == 0) return LOG_LOCAL7; ods_log_warning("[%s] syslog facility %s not supported, logging to " "log_daemon", log_str, facility); return LOG_DAEMON; } #endif /* HAVE_SYSLOG_H */ /** * Get the log level. * */ int ods_log_get_level() { return log_level; } /** * Log message wrapper. * */ static void ods_log_vmsg(int priority, const char* t, const char* s, va_list args) { char message[ODS_SE_MAXLINE]; static char nowstr[CTIME_LENGTH]; time_t now = time_now(); vsnprintf(message, sizeof(message), s, args); #ifdef HAVE_SYSLOG_H if (logging_to_syslog) { #ifdef HAVE_SYSLOG_R syslog_r(priority, &sdata, "%s", message); #else syslog(priority, "%s", message); #endif return; } #endif /* HAVE_SYSLOG_H */ if (!logfile) { return; } (void) ctime_r(&now, nowstr); nowstr[CTIME_LENGTH-2] = '\0'; /* remove trailing linefeed */ fprintf(logfile, "[%s] %s[%i] %s: %s\n", nowstr, MY_PACKAGE_TARNAME, priority, t, message); fflush(logfile); } /** * Heavy debug logging. * */ void ods_log_deeebug(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_DEEEBUG) { ods_log_vmsg(LOG_DEBUG, "debug ", format, args); } va_end(args); } /** * Log debug. * */ void ods_log_debug(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_DEBUG) { ods_log_vmsg(LOG_DEBUG, "debug ", format, args); } va_end(args); } /** * Log verbose. * */ void ods_log_verbose(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_INFO) { ods_log_vmsg(LOG_INFO, "verbose", format, args); } va_end(args); } /** * Log info. * */ void ods_log_info(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_NOTICE) { ods_log_vmsg(LOG_NOTICE, "msg ", format, args); } va_end(args); } /** * Log warning. * */ void ods_log_warning(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_WARNING) { ods_log_vmsg(LOG_WARNING, "warning", format, args); } va_end(args); } /** * Log error. * */ void ods_log_error(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_ERR) { ods_log_vmsg(LOG_ERR, "error ", format, args); } va_end(args); } /** * Log critical. * */ void ods_log_crit(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_CRIT) { ods_log_vmsg(LOG_CRIT, "crit ", format, args); } va_end(args); } /** * Log alert. * */ void ods_log_alert(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_ALERT) { ods_log_vmsg(LOG_ALERT, "alert ", format, args); } va_end(args); } /** * Log emergency and exit. * */ void ods_fatal_exit(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_CRIT) { ods_log_vmsg(LOG_CRIT, "fatal ", format, args); } va_end(args); abort(); } opendnssec-1.4.3/signer/src/shared/allocator.c0000664000175000017500000000715311665414630016267 00000000000000/* * $Id: allocator.c 3817 2010-08-27 08:43:00Z matthijs $ * * Copyright (c) 2010-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Memory management. * */ #include "config.h" #include "shared/allocator.h" #include "shared/log.h" #include #include static const char* allocator_str = "allocator"; /** * Create allocator. * */ allocator_type* allocator_create(void *(*allocator)(size_t size), void (*deallocator)(void *)) { allocator_type* result = (allocator_type*) allocator(sizeof(allocator_type)); if (!result) { ods_log_error("[%s] failed to create allocator", allocator_str); return NULL; } result->allocator = allocator; result->deallocator = deallocator; return result; } /** * Allocate memory. * */ void* allocator_alloc(allocator_type* allocator, size_t size) { void* result; ods_log_assert(allocator); /* align size */ if (size == 0) { size = 1; } result = allocator->allocator(size); if (!result) { ods_fatal_exit("[%s] allocator failed: out of memory", allocator_str); return NULL; } return result; } /** * Allocate memory and initialize to zero. * */ void* allocator_alloc_zero(allocator_type *allocator, size_t size) { void *result = allocator_alloc(allocator, size); if (!result) { return NULL; } memset(result, 0, size); return result; } /** * Allocate memory and initialize with data. * */ void* allocator_alloc_init(allocator_type *allocator, size_t size, const void *init) { void *result = allocator_alloc(allocator, size); if (!result) { return NULL; } memcpy(result, init, size); return result; } /** * Duplicate string. * */ char* allocator_strdup(allocator_type *allocator, const char *string) { if (!string) { return NULL; } return (char*) allocator_alloc_init(allocator, strlen(string) + 1, string); } /** * Deallocate memory. * */ void allocator_deallocate(allocator_type *allocator, void* data) { ods_log_assert(allocator); if (!data) { return; } allocator->deallocator(data); return; } /** * Cleanup allocator. * */ void allocator_cleanup(allocator_type *allocator) { void (*deallocator)(void *); if (!allocator) { return; } deallocator = allocator->deallocator; deallocator(allocator); return; } opendnssec-1.4.3/signer/src/shared/log.h0000664000175000017500000001014611631153611015061 00000000000000/* * $Id: log.h 3845 2010-08-31 14:19:24Z matthijs $ * * Copyright (c) 2009 NLnet Labs. 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, 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 ``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 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. * */ /** * Log wrapper. * */ #ifndef SHARED_LOG_H #define SHARED_LOG_H #include "config.h" #include #include #ifdef HAVE_SYSLOG_H #include /* strncasecmp() */ #include /* openlog(), closelog(), syslog() */ #else /* !HAVE_SYSLOG_H */ #define LOG_EMERG 0 /* ods_fatal_exit */ #define LOG_ALERT 1 /* ods_log_alert */ #define LOG_CRIT 2 /* ods_log_crit */ #define LOG_ERR 3 /* ods_log_error */ #define LOG_WARNING 4 /* ods_log_warning */ #define LOG_NOTICE 5 /* ods_log_info */ #define LOG_INFO 6 /* ods_log_verbose */ #define LOG_DEBUG 7 /* ods_log_debug */ #endif /* HAVE_SYSLOG_H */ #define LOG_DEEEBUG 8 /* ods_log_deeebug */ /** * Initialize logging. * \param[in] filename logfile, stderr if NULL. * \param[in] use_syslog: use syslog(3) and ingore filename * \param[in] verbosity: log level * */ void ods_log_init(const char *filename, int use_syslog, int verbosity); /** * Close logging. * */ void ods_log_close(void); /** * Get the facility by string. * \param[in] facility string based facility * \return int facility * */ int ods_log_get_facility(const char* facility); /** * Get the log level. * \return int log_level * */ int ods_log_get_level(); /** * Heavy debug loggin. * \param[in] format printf-style format string, arguments follow * */ void ods_log_deeebug(const char *format, ...); /** * Log debug. * \param[in] format printf-style format string, arguments follow * */ void ods_log_debug(const char *format, ...); /** * Log verbose. * \param[in] format printf-style format string, arguments follow * */ void ods_log_verbose(const char *format, ...); /** * Log informational messages. * \param[in] format printf-style format string, arguments follow * */ void ods_log_info(const char *format, ...); /** * Log warnings. * \param[in] format printf-style format string, arguments follow * */ void ods_log_warning(const char *format, ...); /** * Log errors. * \param[in] format printf-style format string, arguments follow * */ void ods_log_error(const char *format, ...); /** * Log criticals. * \param[in] format printf-style format string, arguments follow * */ void ods_log_crit(const char *format, ...); /** * Log alerts. * \param[in] format printf-style format string, arguments follow * */ void ods_log_alert(const char *format, ...); /** * Log critical errors and exit. * \param[in] format printf-style format string, arguments follow * */ void ods_fatal_exit(const char *format, ...); /** * Log assertion. * */ #define ODS_LOG_DEBUG 1 #ifdef ODS_LOG_DEBUG #define ods_log_assert(x) \ do { if(!(x)) \ ods_fatal_exit("%s:%d: %s: assertion %s failed", \ __FILE__, __LINE__, __func__, #x); \ } while(0); #else #define ods_log_assert(x) #endif #endif /* SHARED_LOG_H */ opendnssec-1.4.3/signer/src/shared/allocator.h0000664000175000017500000000620611665414630016272 00000000000000/* * $Id: allocator.h 3695 2010-08-10 09:00:55Z jakob $ * * Copyright (c) 2010-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Memory management. * */ #ifndef SHARED_ALLOCATOR_H #define SHARED_ALLOCATOR_H #include "config.h" #include typedef struct allocator_struct allocator_type; struct allocator_struct { void* (*allocator)(size_t); void (*deallocator)(void *); }; /** * Create allocator. * \param[in] allocator function for allocating * \param[in] deallocator function for deallocating * \return allocator_type* allocator */ allocator_type* allocator_create(void *(*allocator)(size_t size), void (*deallocator)(void *)); /** * Allocate memory. * \param[in] allocator the allocator * \param[in] size size to allocate * \return void* pointer to allocated memory */ void* allocator_alloc(allocator_type* allocator, size_t size); /** * Allocate memory and initialize to zero. * \param[in] allocator the allocator * \param[in] size size to allocate * \return void* pointer to allocated memory */ void* allocator_alloc_zero(allocator_type* allocator, size_t size); /** * Allocate memory and initialize with data. * \param[in] allocator the allocator * \param[in] size size to allocate * \param[in] init initialized data * \return void* pointer to allocated memory * */ void* allocator_alloc_init(allocator_type *allocator, size_t size, const void* init); /** * Duplicate string. * \param[in] allocator the allocator * \param[in] string * \return char* duplicated string * */ char* allocator_strdup(allocator_type *allocator, const char *string); /** * Deallocate memory. * \param[in] allocator the allocator * \param[in] data memory to deallocate * */ void allocator_deallocate(allocator_type* allocator, void* data); /** * Cleanup allocator. * \param[in] allocator the allocator * */ void allocator_cleanup(allocator_type* allocator); #endif /* SHARED_ALLOCATOR_H */ opendnssec-1.4.3/signer/src/shared/hsm.c0000664000175000017500000001640512204642554015074 00000000000000/* * $Id: hsm.c 7223 2013-08-20 10:31:08Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Hardware Security Module support. * */ #include "daemon/engine.h" #include "shared/hsm.h" #include "shared/log.h" static const char* hsm_str = "hsm"; /** * Open HSM. * */ int lhsm_open(const char* filename) { int result = hsm_open(filename, hsm_check_pin); if (result != HSM_OK) { char* error = hsm_get_error(NULL); if (error != NULL) { ods_log_error("[%s] %s", hsm_str, error); free(error); } else { ods_log_crit("[%s] error opening libhsm (errno %i)", hsm_str, result); } /* exit? */ } else { ods_log_info("[%s] libhsm connection opened succesfully", hsm_str); } return result; } /** * Reopen HSM. * */ int lhsm_reopen(const char* filename) { if (hsm_check_context(NULL) != HSM_OK) { ods_log_warning("[%s] idle libhsm connection, trying to reopen", hsm_str); hsm_close(); return lhsm_open(filename); } return HSM_OK; } /** * Clear key cache. * */ static void lhsm_clear_key_cache(key_type* key) { if (!key) { return; } if (key->dnskey) { /* DNSKEY still exists in zone */ key->dnskey = NULL; } if (key->hsmkey) { hsm_key_free(key->hsmkey); key->hsmkey = NULL; } if (key->params) { hsm_sign_params_free(key->params); key->params = NULL; } return; } /** * Check the HSM connection, reload engine if necessary. * */ void lhsm_check_connection(void* engine) { engine_type* e = (engine_type*) engine; if (hsm_check_context(NULL) != HSM_OK) { ods_log_warning("[%s] idle libhsm connection, trying to reopen", hsm_str); engine_stop_drudgers(e); hsm_close(); (void)lhsm_open(e->config->cfg_filename); engine_start_drudgers((engine_type*) engine); } else { ods_log_debug("[%s] libhsm connection ok", hsm_str); } return; } /** * Get key from one of the HSMs. * */ ods_status lhsm_get_key(hsm_ctx_t* ctx, ldns_rdf* owner, key_type* key_id) { char *error = NULL; int retries = 0; if (!owner || !key_id) { ods_log_error("[%s] unable to get key: missing required elements", hsm_str); return ODS_STATUS_ASSERT_ERR; } lhsm_key_start: /* set parameters */ if (!key_id->params) { key_id->params = hsm_sign_params_new(); if (key_id->params) { key_id->params->owner = ldns_rdf_clone(owner); key_id->params->algorithm = key_id->algorithm; key_id->params->flags = key_id->flags; } else { /* could not create params */ error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } else if (!retries) { lhsm_clear_key_cache(key_id); retries++; goto lhsm_key_start; } ods_log_error("[%s] unable to get key: create params for key %s " "failed", hsm_str, key_id->locator?key_id->locator:"(null)"); return ODS_STATUS_ERR; } } /* lookup key */ if (!key_id->hsmkey) { key_id->hsmkey = hsm_find_key_by_id(ctx, key_id->locator); } if (!key_id->hsmkey) { error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } else if (!retries) { lhsm_clear_key_cache(key_id); retries++; goto lhsm_key_start; } /* could not find key */ ods_log_error("[%s] unable to get key: key %s not found", hsm_str, key_id->locator?key_id->locator:"(null)"); return ODS_STATUS_ERR; } /* get dnskey */ if (!key_id->dnskey) { key_id->dnskey = hsm_get_dnskey(ctx, key_id->hsmkey, key_id->params); } if (!key_id->dnskey) { error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } else if (!retries) { lhsm_clear_key_cache(key_id); retries++; goto lhsm_key_start; } ods_log_error("[%s] unable to get key: hsm failed to create dnskey", hsm_str); return ODS_STATUS_ERR; } key_id->params->keytag = ldns_calc_keytag(key_id->dnskey); return ODS_STATUS_OK; } /** * Get RRSIG from one of the HSMs, given a RRset and a key. * */ ldns_rr* lhsm_sign(hsm_ctx_t* ctx, ldns_rr_list* rrset, key_type* key_id, ldns_rdf* owner, time_t inception, time_t expiration) { ods_status status = ODS_STATUS_OK; char* error = NULL; ldns_rr* result = NULL; hsm_sign_params_t* params = NULL; int retries = 0; if (!owner || !key_id || !rrset || !inception || !expiration) { ods_log_error("[%s] unable to sign: missing required elements", hsm_str); return NULL; } ods_log_assert(key_id->dnskey); ods_log_assert(key_id->hsmkey); ods_log_assert(key_id->params); /* adjust parameters */ params = hsm_sign_params_new(); params->owner = ldns_rdf_clone(key_id->params->owner); params->algorithm = key_id->algorithm; params->flags = key_id->flags; params->inception = inception; params->expiration = expiration; params->keytag = key_id->params->keytag; ods_log_deeebug("[%s] sign RRset[%i] with key %s tag %u", hsm_str, ldns_rr_get_type(ldns_rr_list_rr(rrset, 0)), key_id->locator?key_id->locator:"(null)", params->keytag); result = hsm_sign_rrset(ctx, rrset, key_id->hsmkey, params); hsm_sign_params_free(params); if (!result) { error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } ods_log_crit("[%s] error signing rrset with libhsm", hsm_str); } return result; } opendnssec-1.4.3/signer/src/shared/duration.c0000664000175000017500000003375412225246405016136 00000000000000/* * $Id: duration.c 7352 2013-10-09 12:33:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * Durations. */ #include "shared/allocator.h" #include "shared/duration.h" #include "shared/log.h" #include #include #include #include static const char* duration_str = "duration"; /** * Create a new 'instant' duration. * */ duration_type* duration_create(void) { duration_type* duration; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] cannot create: no allocator available", duration_str); return NULL; } duration = (duration_type*) allocator_alloc(allocator, sizeof(duration_type)); if (!duration) { ods_log_error("[%s] cannot create: allocator failed", duration_str); allocator_cleanup(allocator); return NULL; } duration->allocator = allocator; duration->years = 0; duration->months = 0; duration->weeks = 0; duration->days = 0; duration->hours = 0; duration->minutes = 0; duration->seconds = 0; return duration; } /** * Compare durations. * */ int duration_compare(duration_type* d1, duration_type* d2) { if (!d1 && !d2) { return 0; } if (!d1 || !d2) { return d1?-1:1; } if (d1->years != d2->years) { return d1->years - d2->years; } if (d1->months != d2->months) { return d1->months - d2->months; } if (d1->weeks != d2->weeks) { return d1->weeks - d2->weeks; } if (d1->days != d2->days) { return d1->days - d2->days; } if (d1->hours != d2->hours) { return d1->hours - d2->hours; } if (d1->minutes != d2->minutes) { return d1->minutes - d2->minutes; } if (d1->seconds != d2->seconds) { return d1->seconds - d2->seconds; } return 0; } /** * Create a duration from string. * */ duration_type* duration_create_from_string(const char* str) { duration_type* duration = duration_create(); char* P, *X, *T, *W; int not_weeks = 0; if (!duration) { ods_log_error("[%s] cannot create from string %s: create failed", duration_str, str); return NULL; } if (!str) { return duration; } P = strchr(str, 'P'); if (!P) { ods_log_error("[%s] cannot create from string %s: P not found", duration_str, str); duration_cleanup(duration); return NULL; } T = strchr(str, 'T'); X = strchr(str, 'Y'); if (X) { duration->years = atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'M'); if (X && (!T || (size_t) (X-P) < (size_t) (T-P))) { duration->months = atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'D'); if (X) { duration->days = atoi(str+1); str = X; not_weeks = 1; } if (T) { str = T; not_weeks = 1; } X = strchr(str, 'H'); if (X && T) { duration->hours = atoi(str+1); str = X; not_weeks = 1; } X = strrchr(str, 'M'); if (X && T && (size_t) (X-P) > (size_t) (T-P)) { duration->minutes = atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'S'); if (X && T) { duration->seconds = atoi(str+1); str = X; not_weeks = 1; } W = strchr(str, 'W'); if (W) { if (not_weeks) { ods_log_error("[%s] cannot create from string: parse error", duration_str, P); duration_cleanup(duration); return NULL; } else { duration->weeks = atoi(str+1); str = W; } } return duration; } /** * Get the number of digits in a number. * */ static size_t digits_in_number(time_t duration) { uint32_t period = (uint32_t) duration; size_t count = 0; if (!period) { return 1; } while (period > 0) { count++; period /= 10; } return count; } /** * Convert a duration to a string. * */ char* duration2string(duration_type* duration) { char* str = NULL, *num = NULL; size_t count = 2; int T = 0, D = 0; if (!duration) { return NULL; } if (duration->years > 0) { count = count + 1 + digits_in_number(duration->years); D = 1; } if (duration->months > 0) { count = count + 1 + digits_in_number(duration->months); D = 1; } if (duration->weeks > 0) { count = count + 1 + digits_in_number(duration->weeks); D = 1; } if (duration->days > 0) { count = count + 1 + digits_in_number(duration->days); D = 1; } if (duration->hours > 0) { count = count + 1 + digits_in_number(duration->hours); T = 1; } if (duration->minutes > 0) { count = count + 1 + digits_in_number(duration->minutes); T = 1; } if (duration->seconds > 0 || (!D && !duration->hours && !duration->minutes)) { count = count + 1 + digits_in_number(duration->seconds); T = 1; } if (T) { count++; } str = (char*) calloc(count, sizeof(char)); str[0] = 'P'; str[1] = '\0'; if (duration->years > 0) { count = digits_in_number(duration->years); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uY", (uint32_t) duration->years); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->months > 0) { count = digits_in_number(duration->months); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uM", (uint32_t) duration->months); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->weeks > 0) { count = digits_in_number(duration->weeks); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uW", (uint32_t) duration->weeks); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->days > 0) { count = digits_in_number(duration->days); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uD", (uint32_t) duration->days); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (T) { str = strncat(str, "T", 1); } if (duration->hours > 0) { count = digits_in_number(duration->hours); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uH", (uint32_t) duration->hours); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->minutes > 0) { count = digits_in_number(duration->minutes); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uM", (uint32_t) duration->minutes); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->seconds > 0 || (!D && !duration->hours && !duration->minutes)) { count = digits_in_number(duration->seconds); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uS", (uint32_t) duration->seconds); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } return str; duration2string_num_calloc_failed: ods_log_error("[%s] cannot create string: malloc error", duration_str); free((void*) str); return NULL; } /** * Convert a duration to a time. * */ time_t duration2time(duration_type* duration) { time_t period = 0; char* dstr = NULL; if (duration) { period += (duration->seconds); period += (duration->minutes)*60; period += (duration->hours)*3600; period += (duration->days)*86400; period += (duration->weeks)*86400*7; period += (duration->months)*86400*31; period += (duration->years)*86400*365; if (duration->months || duration->years) { /* [TODO] calculate correct number of days in this month/year */ dstr = duration2string(duration); ods_log_warning("[%s] converting duration %s to approximate value", duration_str, dstr?dstr:"(null)"); free((void*) dstr); } } return period; } /** * Return the shortest time. * */ time_t time_minimum(time_t a, time_t b) { return (a < b ? a : b); } /** * Return the longest time. * */ time_t time_maximum(time_t a, time_t b) { return (a > b ? a : b); } /** * Return a random time. * */ time_t ods_rand(time_t mod) { #ifdef HAVE_ARC4RANDOM_UNIFORM return (time_t) (arc4random_uniform((uint32_t) mod+1)); #elif HAVE_ARC4RANDOM return (time_t) (arc4random() % (unsigned) mod+1); #else return (time_t) (random() % (unsigned) mod+1); #endif } /* Number of days per month (except for February in leap years). */ static const int mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int is_leap_year(int year) { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); } static int leap_days(int y1, int y2) { --y1; --y2; return (y2/4 - y1/4) - (y2/100 - y1/100) + (y2/400 - y1/400); } #ifdef ENFORCER_TIMESHIFT /* * Code taken from NSD 3.2.5, which is * code adapted from Python 2.4.1 sources (Lib/calendar.py). */ static time_t mktime_from_utc(const struct tm *tm) { int year = 1900 + tm->tm_year; time_t days = 365 * ((time_t) (year - 1970)) + ((time_t) leap_days(1970, year)); time_t hours; time_t minutes; time_t seconds; int i; for (i = 0; i < tm->tm_mon; ++i) { days += mdays[i]; } if (tm->tm_mon > 1 && is_leap_year(year)) { ++days; } days += tm->tm_mday - 1; hours = days * 24 + tm->tm_hour; minutes = hours * 60 + tm->tm_min; seconds = minutes * 60 + tm->tm_sec; return seconds; } /** * Convert time in string format into seconds. * */ static time_t timeshift2time(const char *time) { /* convert a string in format YYMMDDHHMMSS to time_t */ struct tm tm; time_t timeshift = 0; /* Try to scan the time... */ if (strptime(time, "%Y%m%d%H%M%S", &tm)) { timeshift = mktime_from_utc(&tm); } return timeshift; } #endif /** * Return the time since Epoch, measured in seconds. * */ time_t time_now(void) { #ifdef ENFORCER_TIMESHIFT const char* env = getenv("ENFORCER_TIMESHIFT"); if (env) { return timeshift2time(env); } else #endif /* ENFORCER_TIMESHIFT */ return time(NULL); } /** * copycode: This code is based on the EXAMPLE in the strftime manual. * */ uint32_t time_datestamp(time_t tt, const char* format, char** str) { time_t t; struct tm *tmp; uint32_t ut = 0; char outstr[32]; if (tt) { t = tt; } else { t = time_now(); } tmp = localtime(&t); if (tmp == NULL) { ods_log_error("[%s] time_datestamp: localtime() failed", duration_str); return 0; } if (strftime(outstr, sizeof(outstr), format, tmp) == 0) { ods_log_error("[%s] time_datestamp: strftime() failed", duration_str); return 0; } ut = (uint32_t) strtoul(outstr, NULL, 10); if (str) { *str = strdup(outstr); } return ut; } static void time_itoa_reverse(char* s) { int i, j; char c; for (i = 0, j = strlen(s)-1; i 0); /* delete it */ s[i] = '\0'; time_itoa_reverse(s); return; } /** * Clean up duration. * */ void duration_cleanup(duration_type* duration) { allocator_type* allocator; if (!duration) { return; } allocator = duration->allocator; allocator_deallocate(allocator, (void*) duration); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/shared/privdrop.c0000664000175000017500000002160112107366547016153 00000000000000/* * $Id: privdrop.c 7039 2013-02-15 08:10:15Z matthijs $ * * Copyright (c) 2009 Nominet UK. All rights reserved. * * Based heavily on uidswap.c from openssh-5.2p1 * * 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, 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 ``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 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. * */ /** * * Privileges. */ #define _GNU_SOURCE /* defines for setres{g|u}id */ #include "config.h" #include "shared/log.h" #include "shared/privdrop.h" #include "shared/status.h" #include #include #include #include #include #include #include #include #include #include #include #ifndef _SC_GETPW_R_SIZE_MAX #define _SC_GETPW_R_SIZE_MAX 16384 #endif /* _SC_GETPW_R_SIZE_MAX */ #ifndef _SC_GETGR_R_SIZE_MAX #define _SC_GETGR_R_SIZE_MAX 16384 #endif /* _SC_GETGR_R_SIZE_MAX */ static const char* privdrop_str = "privdrop"; /** * Get the user identifier from the username. * */ uid_t privuid(const char* username) { struct passwd pwd; struct passwd* result; long bufsize; char* buf; uid_t uid; int s; uid = geteuid(); if (username) { bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == -1) { bufsize = 16384; /* should be more than enough */ } buf = (char*) calloc(bufsize, sizeof(char)); if (!buf) { ods_log_error("[%s] calloc failed: out of memory?", privdrop_str); return -1; } /* Lookup the user id in /etc/passwd */ s = getpwnam_r(username, &pwd, buf, bufsize, &result); /* LEAK */ if (s) { ods_log_error("[%s] unable to get user id for %s: %s", privdrop_str, username, strerror(s)); } if (result != NULL) { uid = pwd.pw_uid; } free((void*) buf); } else { uid = -1; } return uid; } /** * Get the group identifier from the group name. * */ gid_t privgid(const char *groupname) { struct group grp; struct group* result; long bufsize; char* buf; gid_t gid; int s; gid = getegid(); if (groupname) { bufsize = sysconf(_SC_GETGR_R_SIZE_MAX); if (bufsize == -1) { bufsize = 16384; /* should be more than enough */ } buf = (char*) calloc(bufsize, sizeof(char)); if (!buf) { ods_log_error("[%s] calloc failed: out of memory?", privdrop_str); return -1; } /* Lookup the group id in /etc/group */ s = getgrnam_r(groupname, &grp, buf, bufsize, &result); /* LEAK */ if (s) { ods_log_error("[%s] unable to get group id for %s: %s", privdrop_str, groupname, strerror(s)); } if (result != NULL) { gid = grp.gr_gid; } free((void*) buf); } else { gid = -1; } return gid; } /** * Drop privileges. * */ ods_status privdrop(const char *username, const char *groupname, const char *newroot, uid_t* puid, gid_t* pgid) { int status; uid_t uid, olduid; gid_t gid; long ngroups_max; gid_t *final_groups; int final_group_len = -1; /* Save effective uid/gid */ uid = olduid = geteuid(); gid = getegid(); /* Check if we're going to drop uid */ if (username) { uid = privuid(username); if (uid == (uid_t)-1) { ods_log_error("[%s] user %s does not exist", privdrop_str, username); return ODS_STATUS_PRIVDROP_ERR; } } /* Check if we're going to drop gid */ if (groupname) { gid = privgid(groupname); if (gid == (gid_t)-1) { ods_log_error("[%s] group %s does not exist", privdrop_str, groupname); return ODS_STATUS_PRIVDROP_ERR; } } /* Change root if requested */ if (newroot) { #ifdef HAVE_CHROOT status = chroot(newroot); if (status != 0 || chdir("/") != 0) { ods_log_error("[%s] chroot to %s failed: %.100s", privdrop_str, newroot, strerror(errno)); return ODS_STATUS_CHROOT_ERR; } #else ods_log_error("[%s] chroot to %s failed: !HAVE_CHROOT", privdrop_str, newroot); return ODS_STATUS_CHROOT_ERR; #endif /* HAVE_CHROOT */ } /* Do additional groups first */ if (username != NULL && !olduid) { #ifdef HAVE_INITGROUPS if (initgroups(username, gid) < 0) { ods_log_error("[%s] initgroups failed: %s: %.100s", privdrop_str, username, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } #else ods_log_error("initgroups failed: %s: !HAVE_INITGROUPS", username); return ODS_STATUS_PRIVDROP_ERR; #endif /* HAVE_INITGROUPS */ ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; final_groups = (gid_t *)malloc(ngroups_max *sizeof(gid_t)); if (!final_groups) { return ODS_STATUS_MALLOC_ERR; } #if defined(HAVE_GETGROUPS) && defined(HAVE_SETGROUPS) final_group_len = getgroups(ngroups_max, final_groups); /* If we are root then drop all groups other than the final one */ if (!olduid) { setgroups(final_group_len, final_groups); } #endif /* defined(HAVE_GETGROUPS) && defined(HAVE_SETGROUPS) */ free((void*)final_groups); } else { /* If we are root then drop all groups other than the final one */ #if defined(HAVE_SETGROUPS) if (!olduid) setgroups(1, &(gid)); #endif /* defined(HAVE_SETGROUPS) */ } /* Drop gid? */ if (groupname) { #if defined(HAVE_SETRESGID) && !defined(BROKEN_SETRESGID) status = setresgid(gid, gid, gid); #elif defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID) status = setregid(gid, gid); #else # ifndef SETEUID_BREAKS_SETUID status = setegid(gid); if (status != 0) { ods_log_error("[%s] setegid() for %s (%lu) failed: %s", privdrop_str, groupname, (unsigned long) gid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } # endif /* SETEUID_BREAKS_SETUID */ status = setgid(gid); #endif if (status != 0) { ods_log_error("[%s] setgid() for %s (%lu) failed: %s", privdrop_str, groupname, (unsigned long) gid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } else { ods_log_debug("[%s] group set to %s (%lu)", privdrop_str, groupname, (unsigned long) gid); } } /* Drop uid? */ if (username) { /* Set the user to drop to if specified; else just set the uid as the real one */ #if defined(HAVE_SETRESUID) && !defined(BROKEN_SETRESUID) status = setresuid(uid, uid, uid); #elif defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID) status = setreuid(uid, uid); #else # ifndef SETEUID_BREAKS_SETUID status = seteuid(uid); if (status != 0) { ods_log_error("[%s] seteuid() for %s (%lu) failed: %s", privdrop_str, username, (unsigned long) uid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } # endif /* SETEUID_BREAKS_SETUID */ status = setuid(uid); #endif if (status != 0) { ods_log_error("[%s] setuid() for %s (%lu) failed: %s", privdrop_str, username, (unsigned long) uid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } else { ods_log_debug("[%s] user set to %s (%lu)", privdrop_str, username, (unsigned long) uid); } } *puid = uid; *pgid = gid; return ODS_STATUS_OK; } /** * Close privdrop. * */ void privclose(const char* username, const char* groupname) { if (username) { endpwent(); } if (groupname) { endgrent(); } return; } opendnssec-1.4.3/signer/src/shared/privdrop.h0000664000175000017500000000457311526714704016165 00000000000000/* * $Id: privdrop.h 4466 2011-02-16 09:32:52Z rb $ * * Copyright (c) 2009 Nominet UK. 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, 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 ``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 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. * */ /** * * Privileges. */ #ifndef SHARED_PRIVDROP_H #define SHARED_PRIVDROP_H #include #include #include "shared/status.h" /** * Get the group identifier from a group name. * \param[in] groupname group name * \return gid_t group identifier * */ gid_t privgid(const char* groupname); /** * Get the user identifier from a username. * \param[in] username username * \return uid_t user identifier * */ uid_t privuid(const char* username); /** * Drop privileges. * \param[in] username drop priviliges to this user * \param[in] groupname drop priviliges to this group * \param[in] newroot make this the new root directory * \param[out] puid user id * \param[out] pgid group id * \return ods_status status. * */ ods_status privdrop(const char *username, const char *groupname, const char *newroot, uid_t* puid, gid_t* pgid); /** * Close privdrop. * \param[in] username username * \param[in] groupname group name * */ void privclose(const char* username, const char* groupname); #endif /* SHARED_PRIVDROP_H */ opendnssec-1.4.3/signer/src/signer/0000775000175000017500000000000012247571206014236 500000000000000opendnssec-1.4.3/signer/src/signer/tools.h0000664000175000017500000000400411665414722015467 00000000000000/* * $Id: tools.h 5948 2011-11-30 11:56:02Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone signing tools. * */ #ifndef SIGNER_TOOLS_H #define SIGNER_TOOLS_H #include "config.h" #include "daemon/engine.h" #include "shared/status.h" #include "signer/zone.h" /** * Load zone signconf. * \param[in] zone zone * \return ods_status status * */ ods_status tools_signconf(zone_type* zone); /** * Read zone from input adapter. * \param[in] zone zone * \return ods_status status * */ ods_status tools_input(zone_type* zone); /** * Write zone to output adapter. * \param[in] zone zone * \param[in] engine signer engine * \return ods_status status * */ ods_status tools_output(zone_type* zone, engine_type* engine); #endif /* SIGNER_TOOLS_H */ opendnssec-1.4.3/signer/src/signer/rrset.c0000664000175000017500000006420612241152613015460 00000000000000/* * $Id: rrset.c 7400 2013-11-14 13:52:11Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * RRset. * */ #include "config.h" #include "shared/file.h" #include "shared/hsm.h" #include "shared/log.h" #include "shared/util.h" #include "signer/rrset.h" #include "signer/zone.h" static const char* rrset_str = "rrset"; /** * Log RR. * */ void log_rr(ldns_rr* rr, const char* pre, int level) { char* str = NULL; size_t i = 0; if (ods_log_get_level() < level) { return; } str = ldns_rr2str(rr); if (!str) { ods_log_error("[%s] %s: Error converting RR to string", rrset_str, pre?pre:""); return; } str[(strlen(str))-1] = '\0'; /* replace tabs with white space */ for (i=0; i < strlen(str); i++) { if (str[i] == '\t') { str[i] = ' '; } } if (level == LOG_EMERG) { ods_fatal_exit("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_ALERT) { ods_log_alert("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_CRIT) { ods_log_crit("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_ERR) { ods_log_error("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_WARNING) { ods_log_warning("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_NOTICE) { ods_log_info("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_INFO) { ods_log_verbose("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_DEBUG) { ods_log_debug("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_DEEEBUG) { ods_log_deeebug("[%s] %s: %s", rrset_str, pre?pre:"", str); } else { ods_log_deeebug("[%s] %s: %s", rrset_str, pre?pre:"", str); } free((void*)str); return; } /** * Log RRset. * */ void log_rrset(ldns_rdf* dname, ldns_rr_type type, const char* pre, int level) { char* str = NULL; size_t i = 0; if (ods_log_get_level() < level) { return; } str = ldns_rdf2str(dname); if (!str) { return; } str[(strlen(str))-1] = '\0'; /* replace tabs with white space */ for (i=0; i < strlen(str); i++) { if (str[i] == '\t') { str[i] = ' '; } } if (level == LOG_EMERG) { ods_fatal_exit("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_ALERT) { ods_log_alert("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_CRIT) { ods_log_crit("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_ERR) { ods_log_error("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_WARNING) { ods_log_warning("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_NOTICE) { ods_log_info("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_INFO) { ods_log_verbose("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_DEBUG) { ods_log_debug("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_DEEEBUG) { ods_log_deeebug("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else { ods_log_deeebug("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } free((void*)str); return; } /** * Get the string-format of RRtype. * */ const char* rrset_type2str(ldns_rr_type type) { if (type == LDNS_RR_TYPE_IXFR) { return "IXFR"; } else if (type == LDNS_RR_TYPE_AXFR) { return "AXFR"; } else if (type == LDNS_RR_TYPE_MAILB) { return "MAILB"; } else if (type == LDNS_RR_TYPE_MAILA) { return "MAILA"; } else if (type == LDNS_RR_TYPE_ANY) { return "ANY"; } else { const ldns_rr_descriptor* descriptor = ldns_rr_descript(type); if (descriptor && descriptor->_name) { return descriptor->_name; } } return "TYPE???"; } /** * Create RRset. * */ rrset_type* rrset_create(void* zoneptr, ldns_rr_type type) { zone_type* zone = (zone_type*) zoneptr; rrset_type* rrset = NULL; if (!type || !zoneptr) { return NULL; } rrset = (rrset_type*) allocator_alloc( zone->allocator, sizeof(rrset_type)); if (!rrset) { ods_log_error("[%s] unable to create RRset %u: allocator_alloc() " "failed", rrset_str, (unsigned) type); return NULL; } rrset->next = NULL; rrset->rrs = NULL; rrset->rrsigs = NULL; rrset->domain = NULL; rrset->zone = zoneptr; rrset->rrtype = type; rrset->rr_count = 0; rrset->rrsig_count = 0; rrset->needs_signing = 0; return rrset; } /** * Lookup RR in RRset. * */ rr_type* rrset_lookup_rr(rrset_type* rrset, ldns_rr* rr) { ldns_status lstatus = LDNS_STATUS_OK; int cmp = 0; size_t i = 0; if (!rrset || !rr || rrset->rr_count <= 0) { return NULL; } for (i=0; i < rrset->rr_count; i++) { lstatus = util_dnssec_rrs_compare(rrset->rrs[i].rr, rr, &cmp); if (lstatus != LDNS_STATUS_OK) { ods_log_error("[%s] unable to lookup RR: compare failed (%s)", rrset_str, ldns_get_errorstr_by_id(lstatus)); return NULL; } if (!cmp) { /* equal */ return &rrset->rrs[i]; } } return NULL; } /** * Count the number of RRs in this RRset that have is_added. * */ size_t rrset_count_rr_is_added(rrset_type* rrset) { size_t i = 0; size_t count = 0; if (!rrset) { return 0; } for (i=0; i < rrset->rr_count; i++) { if (rrset->rrs[i].is_added) { count++; } } return count; } /** * Add RR to RRset. * */ rr_type* rrset_add_rr(rrset_type* rrset, ldns_rr* rr) { rr_type* rrs_old = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rr); ods_log_assert(rrset->rrtype == ldns_rr_get_type(rr)); zone = (zone_type*) rrset->zone; rrs_old = rrset->rrs; rrset->rrs = (rr_type*) allocator_alloc(zone->allocator, (rrset->rr_count + 1) * sizeof(rr_type)); if (!rrset->rrs) { ods_fatal_exit("[%s] fatal unable to add RR: allocator_alloc() failed", rrset_str); } if (rrs_old) { memcpy(rrset->rrs, rrs_old, (rrset->rr_count) * sizeof(rr_type)); } allocator_deallocate(zone->allocator, (void*) rrs_old); rrset->rr_count++; rrset->rrs[rrset->rr_count - 1].owner = rrset->domain; rrset->rrs[rrset->rr_count - 1].rr = rr; rrset->rrs[rrset->rr_count - 1].exists = 0; rrset->rrs[rrset->rr_count - 1].is_added = 1; rrset->rrs[rrset->rr_count - 1].is_removed = 0; rrset->needs_signing = 1; log_rr(rr, "+RR", LOG_DEEEBUG); return &rrset->rrs[rrset->rr_count -1]; } /** * Delete RR from RRset. * */ void rrset_del_rr(rrset_type* rrset, uint16_t rrnum) { rr_type* rrs_orig = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rrnum < rrset->rr_count); zone = (zone_type*) rrset->zone; log_rr(rrset->rrs[rrnum].rr, "-RR", LOG_DEEEBUG); rrset->rrs[rrnum].owner = NULL; rrset->rrs[rrnum].rr = NULL; while (rrnum < rrset->rr_count-1) { rrset->rrs[rrnum] = rrset->rrs[rrnum+1]; rrnum++; } memset(&rrset->rrs[rrset->rr_count-1], 0, sizeof(rr_type)); rrs_orig = rrset->rrs; rrset->rrs = (rr_type*) allocator_alloc(zone->allocator, (rrset->rr_count - 1) * sizeof(rr_type)); if(!rrset->rrs) { ods_fatal_exit("[%s] fatal unable to delete RR: allocator_alloc() failed", rrset_str); } memcpy(rrset->rrs, rrs_orig, (rrset->rr_count -1) * sizeof(rr_type)); allocator_deallocate(zone->allocator, (void*) rrs_orig); rrset->rr_count--; rrset->needs_signing = 1; return; } /** * Apply differences at RRset. * */ void rrset_diff(rrset_type* rrset, unsigned is_ixfr, unsigned more_coming) { zone_type* zone = NULL; uint16_t i = 0; uint8_t del_sigs = 0; if (!rrset) { return; } zone = (zone_type*) rrset->zone; for (i=0; i < rrset->rr_count; i++) { if (rrset->rrs[i].is_added) { if (!rrset->rrs[i].exists) { /* ixfr +RR */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_add_rr(zone->ixfr, rrset->rrs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); del_sigs = 1; } rrset->rrs[i].exists = 1; if ((rrset->rrtype == LDNS_RR_TYPE_DNSKEY || rrset->rrtype == LDNS_RR_TYPE_NSEC3PARAMS) && more_coming) { continue; } rrset->rrs[i].is_added = 0; } else if (!is_ixfr || rrset->rrs[i].is_removed) { if (rrset->rrs[i].exists) { /* ixfr -RR */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, rrset->rrs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); } rrset->rrs[i].exists = 0; rrset_del_rr(rrset, i); del_sigs = 1; i--; } } if (del_sigs) { for (i=0; i < rrset->rrsig_count; i++) { /* ixfr -RRSIG */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, rrset->rrsigs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_del_rrsig(rrset, i); i--; } } return; } /** * Add RRSIG to RRset. * */ rrsig_type* rrset_add_rrsig(rrset_type* rrset, ldns_rr* rr, const char* locator, uint32_t flags) { rrsig_type* rrsigs_old = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rr); ods_log_assert(ldns_rr_get_type(rr) == LDNS_RR_TYPE_RRSIG); zone = (zone_type*) rrset->zone; rrsigs_old = rrset->rrsigs; rrset->rrsigs = (rrsig_type*) allocator_alloc(zone->allocator, (rrset->rrsig_count + 1) * sizeof(rrsig_type)); if (!rrset->rrsigs) { ods_fatal_exit("[%s] fatal unable to add RRSIG: allocator_alloc() failed", rrset_str); } if (rrsigs_old) { memcpy(rrset->rrsigs, rrsigs_old, (rrset->rrsig_count) * sizeof(rrsig_type)); } allocator_deallocate(zone->allocator, (void*) rrsigs_old); rrset->rrsig_count++; rrset->rrsigs[rrset->rrsig_count - 1].owner = rrset->domain; rrset->rrsigs[rrset->rrsig_count - 1].rr = rr; rrset->rrsigs[rrset->rrsig_count - 1].key_locator = locator; rrset->rrsigs[rrset->rrsig_count - 1].key_flags = flags; log_rr(rr, "+RRSIG", LOG_DEEEBUG); return &rrset->rrsigs[rrset->rrsig_count -1]; } /** * Delete RRSIG from RRset. * */ void rrset_del_rrsig(rrset_type* rrset, uint16_t rrnum) { rrsig_type* rrsigs_orig = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rrnum < rrset->rrsig_count); zone = (zone_type*) rrset->zone; log_rr(rrset->rrsigs[rrnum].rr, "-RRSIG", LOG_DEEEBUG); rrset->rrsigs[rrnum].owner = NULL; rrset->rrsigs[rrnum].rr = NULL; allocator_deallocate(zone->allocator, (void*)rrset->rrsigs[rrnum].key_locator); rrset->rrsigs[rrnum].key_locator = NULL; while (rrnum < rrset->rrsig_count-1) { rrset->rrsigs[rrnum] = rrset->rrsigs[rrnum+1]; rrnum++; } memset(&rrset->rrsigs[rrset->rrsig_count-1], 0, sizeof(rrsig_type)); rrsigs_orig = rrset->rrsigs; rrset->rrsigs = (rrsig_type*) allocator_alloc(zone->allocator, (rrset->rrsig_count - 1) * sizeof(rrsig_type)); if(!rrset->rrsigs) { ods_fatal_exit("[%s] fatal unable to delete RRSIG: allocator_alloc() failed", rrset_str); } memcpy(rrset->rrsigs, rrsigs_orig, (rrset->rrsig_count -1) * sizeof(rrsig_type)); allocator_deallocate(zone->allocator, (void*) rrsigs_orig); rrset->rrsig_count--; return; } /** * Recycle signatures from RRset and drop unreusable signatures. * */ static uint32_t rrset_recycle(rrset_type* rrset, time_t signtime, ldns_rr_type dstatus, ldns_rr_type delegpt) { uint32_t refresh = 0; uint32_t expiration = 0; uint32_t inception = 0; uint32_t reusedsigs = 0; unsigned drop_sig = 0; size_t i = 0; key_type* key = NULL; zone_type* zone = NULL; if (!rrset) { return 0; } zone = (zone_type*) rrset->zone; /* Calculate the Refresh Window = Signing time + Refresh */ if (zone->signconf && zone->signconf->sig_refresh_interval) { refresh = (uint32_t) (signtime + duration2time(zone->signconf->sig_refresh_interval)); } /* Check every signature if it matches the recycling logic. */ for (i=0; i < rrset->rrsig_count; i++) { drop_sig = 0; /* 0. Skip delegation, glue and occluded RRsets */ if (dstatus != LDNS_RR_TYPE_SOA || (delegpt != LDNS_RR_TYPE_SOA && rrset->rrtype != LDNS_RR_TYPE_DS)) { drop_sig = 1; goto recycle_drop_sig; } ods_log_assert(dstatus == LDNS_RR_TYPE_SOA || (delegpt == LDNS_RR_TYPE_SOA || rrset->rrtype == LDNS_RR_TYPE_DS)); /* 1. If the RRset has changed, drop all signatures */ /* 2. If Refresh is disabled, drop all signatures */ if (rrset->needs_signing || refresh <= (uint32_t) signtime) { drop_sig = 1; goto recycle_drop_sig; } /* 3. Expiration - Refresh has passed */ expiration = ldns_rdf2native_int32( ldns_rr_rrsig_expiration(rrset->rrsigs[i].rr)); if (expiration < refresh) { drop_sig = 1; goto recycle_drop_sig; } /* 4. Inception has not yet passed */ inception = ldns_rdf2native_int32( ldns_rr_rrsig_inception(rrset->rrsigs[i].rr)); if (inception > (uint32_t) signtime) { drop_sig = 1; goto recycle_drop_sig; } /* 5. Corresponding key is dead (key is locator+flags) */ key = keylist_lookup_by_locator(zone->signconf->keys, rrset->rrsigs[i].key_locator); if (!key || key->flags != rrset->rrsigs[i].key_flags) { drop_sig = 1; } recycle_drop_sig: if (drop_sig) { /* A rule mismatched, refresh signature */ /* ixfr -RRSIG */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, rrset->rrsigs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_del_rrsig(rrset, i); i--; } else { /* All rules ok, recycle signature */ reusedsigs += 1; } } return reusedsigs; } /** * Is the RRset signed with this algorithm? * */ static int rrset_sigalgo(rrset_type* rrset, uint8_t algorithm) { size_t i = 0; if (!rrset) { return 0; } for (i=0; i < rrset->rrsig_count; i++) { if (algorithm == ldns_rdf2native_int8( ldns_rr_rrsig_algorithm(rrset->rrsigs[i].rr))) { return 1; } } return 0; } /** * Is the RRset signed with this locator? * */ static int rrset_siglocator(rrset_type* rrset, const char* locator) { size_t i = 0; if (!rrset) { return 0; } for (i=0; i < rrset->rrsig_count; i++) { if (!ods_strcmp(locator, rrset->rrsigs[i].key_locator)) { return 1; } } return 0; } /** * Transmogrify the RRset to a RRlist. * */ static ldns_rr_list* rrset2rrlist(rrset_type* rrset) { ldns_rr_list* rr_list = NULL; int ret = 0; size_t i = 0; rr_list = ldns_rr_list_new(); for (i=0; i < rrset->rr_count; i++) { if (!rrset->rrs[i].exists) { log_rr(rrset->rrs[i].rr, "RR does not exist", LOG_WARNING); continue; } /* clone if you want to keep the original format in the signed zone */ ldns_rr2canonical(rrset->rrs[i].rr); ret = (int) ldns_rr_list_push_rr(rr_list, rrset->rrs[i].rr); if (!ret) { ldns_rr_list_free(rr_list); return NULL; } if (rrset->rrtype == LDNS_RR_TYPE_CNAME || rrset->rrtype == LDNS_RR_TYPE_DNAME) { /* singleton types */ return rr_list; } } ldns_rr_list_sort(rr_list); return rr_list; } /** * Calculate the signature validation period. * */ static void rrset_sigvalid_period(signconf_type* sc, ldns_rr_type rrtype, time_t signtime, time_t* inception, time_t* expiration) { time_t jitter = 0; time_t offset = 0; time_t validity = 0; time_t random_jitter = 0; if (!sc || !rrtype || !signtime) { return; } jitter = duration2time(sc->sig_jitter); if (jitter) { random_jitter = ods_rand(jitter*2); } offset = duration2time(sc->sig_inception_offset); if (rrtype == LDNS_RR_TYPE_NSEC || rrtype == LDNS_RR_TYPE_NSEC3) { validity = duration2time(sc->sig_validity_denial); } else { validity = duration2time(sc->sig_validity_default); } *inception = signtime - offset; *expiration = (signtime + validity + random_jitter) - jitter; return; } /** * Sign RRset. * */ ods_status rrset_sign(hsm_ctx_t* ctx, rrset_type* rrset, time_t signtime) { zone_type* zone = NULL; uint32_t newsigs = 0; uint32_t reusedsigs = 0; ldns_rr* rrsig = NULL; ldns_rr_list* rr_list = NULL; rrsig_type* signature = NULL; const char* locator = NULL; time_t inception = 0; time_t expiration = 0; size_t i = 0; domain_type* domain = NULL; ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; ldns_rr_type delegpt = LDNS_RR_TYPE_FIRST; ods_log_assert(ctx); ods_log_assert(rrset); zone = (zone_type*) rrset->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); /* Recycle signatures */ if (rrset->rrtype == LDNS_RR_TYPE_NSEC || rrset->rrtype == LDNS_RR_TYPE_NSEC3) { dstatus = LDNS_RR_TYPE_SOA; delegpt = LDNS_RR_TYPE_SOA; } else { domain = (domain_type*) rrset->domain; dstatus = domain_is_occluded(domain); delegpt = domain_is_delegpt(domain); } reusedsigs = rrset_recycle(rrset, signtime, dstatus, delegpt); rrset->needs_signing = 0; ods_log_assert(rrset->rrs); ods_log_assert(rrset->rrs[0].rr); /* Skip delegation, glue and occluded RRsets */ if (dstatus != LDNS_RR_TYPE_SOA) { log_rrset(ldns_rr_owner(rrset->rrs[0].rr), rrset->rrtype, "skip signing occluded RRset", LOG_DEEEBUG); return ODS_STATUS_OK; } if (delegpt != LDNS_RR_TYPE_SOA && rrset->rrtype != LDNS_RR_TYPE_DS) { log_rrset(ldns_rr_owner(rrset->rrs[0].rr), rrset->rrtype, "skip signing delegation RRset", LOG_DEEEBUG); return ODS_STATUS_OK; } log_rrset(ldns_rr_owner(rrset->rrs[0].rr), rrset->rrtype, "sign RRset", LOG_DEEEBUG); ods_log_assert(dstatus == LDNS_RR_TYPE_SOA || (delegpt == LDNS_RR_TYPE_SOA || rrset->rrtype == LDNS_RR_TYPE_DS)); /* Transmogrify rrset */ rr_list = rrset2rrlist(rrset); if (!rr_list) { ods_log_error("[%s] unable to sign RRset[%i]: rrset2rrlist() failed", rrset_str, rrset->rrtype); return ODS_STATUS_MALLOC_ERR; } if (ldns_rr_list_rr_count(rr_list) <= 0) { /* Empty RRset, no signatures needed */ ldns_rr_list_free(rr_list); return ODS_STATUS_OK; } /* Calculate signature validity */ rrset_sigvalid_period(zone->signconf, rrset->rrtype, signtime, &inception, &expiration); /* Walk keys */ for (i=0; i < zone->signconf->keys->count; i++) { /* If not ZSK don't sign other RRsets */ if (!zone->signconf->keys->keys[i].zsk && rrset->rrtype != LDNS_RR_TYPE_DNSKEY) { continue; } /* If not KSK don't sign DNSKEY RRset */ if (!zone->signconf->keys->keys[i].ksk && rrset->rrtype == LDNS_RR_TYPE_DNSKEY) { continue; } /* Additional rules for signatures */ if (rrset_siglocator(rrset, zone->signconf->keys->keys[i].locator)) { continue; } if (rrset->rrtype != LDNS_RR_TYPE_DNSKEY && rrset_sigalgo(rrset, zone->signconf->keys->keys[i].algorithm)) { continue; } /** * currently, there is no rule that the number of signatures * over this RRset equals the number of active keys. */ /* Sign the RRset with this key */ ods_log_deeebug("[%s] signing RRset[%i] with key %s", rrset_str, rrset->rrtype, zone->signconf->keys->keys[i].locator); rrsig = lhsm_sign(ctx, rr_list, &zone->signconf->keys->keys[i], zone->apex, inception, expiration); if (!rrsig) { ods_log_crit("[%s] unable to sign RRset[%i]: lhsm_sign() failed", rrset_str, rrset->rrtype); ldns_rr_list_free(rr_list); return ODS_STATUS_HSM_ERR; } /* Add signature */ locator = allocator_strdup(zone->allocator, zone->signconf->keys->keys[i].locator); signature = rrset_add_rrsig(rrset, rrsig, locator, zone->signconf->keys->keys[i].flags); newsigs++; /* ixfr +RRSIG */ ods_log_assert(signature->rr); lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_add_rr(zone->ixfr, signature->rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); } /* RRset signing completed */ ldns_rr_list_free(rr_list); lock_basic_lock(&zone->stats->stats_lock); if (rrset->rrtype == LDNS_RR_TYPE_SOA) { zone->stats->sig_soa_count += newsigs; } zone->stats->sig_count += newsigs; zone->stats->sig_reuse += reusedsigs; lock_basic_unlock(&zone->stats->stats_lock); return ODS_STATUS_OK; } /** * Print RRset. * */ void rrset_print(FILE* fd, rrset_type* rrset, int skip_rrsigs, ods_status* status) { uint16_t i = 0; ods_status result = ODS_STATUS_OK; if (!rrset || !fd) { ods_log_crit("[%s] unable to print RRset: rrset or fd missing", rrset_str); if (status) { *status = ODS_STATUS_ASSERT_ERR; } return; } for (i=0; i < rrset->rr_count; i++) { if (rrset->rrs[i].exists) { result = util_rr_print(fd, rrset->rrs[i].rr); if (rrset->rrtype == LDNS_RR_TYPE_CNAME || rrset->rrtype == LDNS_RR_TYPE_DNAME) { /* singleton types */ break; } if (result != ODS_STATUS_OK) { zone_type* zone = (zone_type*) rrset->zone; log_rrset(ldns_rr_owner(rrset->rrs[i].rr), rrset->rrtype, "error printing RRset", LOG_CRIT); zone->adoutbound->error = 1; break; } } } if (! (skip_rrsigs || !rrset->rrsig_count)) { for (i=0; i < rrset->rrsig_count; i++) { result = util_rr_print(fd, rrset->rrsigs[i].rr); if (result != ODS_STATUS_OK) { zone_type* zone = (zone_type*) rrset->zone; log_rrset(ldns_rr_owner(rrset->rrs[i].rr), rrset->rrtype, "error printing RRset", LOG_CRIT); zone->adoutbound->error = 1; break; } } } if (status) { *status = result; } return; } /** * Clean up RRset. * */ void rrset_cleanup(rrset_type* rrset) { uint16_t i = 0; zone_type* zone = NULL; if (!rrset) { return; } rrset_cleanup(rrset->next); rrset->next = NULL; rrset->domain = NULL; zone = (zone_type*) rrset->zone; for (i=0; i < rrset->rr_count; i++) { ldns_rr_free(rrset->rrs[i].rr); rrset->rrs[i].owner = NULL; } for (i=0; i < rrset->rrsig_count; i++) { allocator_deallocate(zone->allocator, (void*)rrset->rrsigs[i].key_locator); ldns_rr_free(rrset->rrsigs[i].rr); rrset->rrsigs[i].owner = NULL; } allocator_deallocate(zone->allocator, (void*) rrset->rrs); allocator_deallocate(zone->allocator, (void*) rrset->rrsigs); allocator_deallocate(zone->allocator, (void*) rrset); return; } /** * Backup RRset. * */ void rrset_backup2(FILE* fd, rrset_type* rrset) { char* str = NULL; uint16_t i = 0; if (!rrset || !fd) { return; } for (i=0; i < rrset->rrsig_count; i++) { str = ldns_rr2str(rrset->rrsigs[i].rr); if (!str) { continue; } str[(strlen(str))-1] = '\0'; fprintf(fd, "%s; {locator %s flags %u}\n", str, rrset->rrsigs[i].key_locator, rrset->rrsigs[i].key_flags); free((void*)str); } return; } opendnssec-1.4.3/signer/src/signer/zonelist.c0000664000175000017500000003061511716477614016206 00000000000000/* * $Id: zonelist.c 6166 2012-02-14 15:36:44Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * The zonelist and all. */ #include "config.h" #include "parser/confparser.h" #include "parser/zonelistparser.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/zone.h" #include "signer/zonelist.h" #include #include static const char* zl_str = "zonelist"; /** * Compare two zones. * */ static int zone_compare(const void* a, const void* b) { zone_type* x = (zone_type*)a; zone_type* y = (zone_type*)b; ods_log_assert(x); ods_log_assert(y); if (x->klass != y->klass) { if (x->klass < y->klass) { return -1; } return 1; } return ldns_dname_compare(x->apex, y->apex); } /** * Create a new zone list. * */ zonelist_type* zonelist_create(allocator_type* allocator) { zonelist_type* zlist = NULL; if (allocator) { zlist = (zonelist_type*) allocator_alloc(allocator, sizeof(zonelist_type)); } if (!zlist) { ods_log_error("[%s] unable to create zonelist: allocator_alloc() " "failed", zl_str); return NULL; } zlist->allocator = allocator; zlist->zones = ldns_rbtree_create(zone_compare); if (!zlist->zones) { ods_log_error("[%s] unable to create zonelist: ldns_rbtree_create() " "failed", zl_str); allocator_deallocate(allocator, (void*) zlist); return NULL; } zlist->last_modified = 0; lock_basic_init(&zlist->zl_lock); return zlist; } /** * Read a zonelist file. * */ static ods_status zonelist_read(zonelist_type* zl, const char* zlfile) { const char* rngfile = ODS_SE_RNGDIR "/zonelist.rng"; ods_status status = ODS_STATUS_OK; ods_log_assert(zlfile); ods_log_verbose("[%s] read file %s", zl_str, zlfile); status = parse_file_check(zlfile, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read file: parse error in %s", zl_str, zlfile); return status; } return parse_zonelist_zones((struct zonelist_struct*) zl, zlfile); } /** * Convert a zone to a tree node. * */ static ldns_rbnode_t* zone2node(zone_type* zone) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (!node) { return NULL; } node->key = zone; node->data = zone; return node; } /** * Lookup zone. * */ static zone_type* zonelist_lookup_zone(zonelist_type* zonelist, zone_type* zone) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; if (zonelist && zonelist->zones && zone) { node = ldns_rbtree_search(zonelist->zones, zone); if (node) { return (zone_type*) node->data; } } return NULL; } /** * Lookup zone by name. * */ zone_type* zonelist_lookup_zone_by_name(zonelist_type* zonelist, const char* name, ldns_rr_class klass) { zone_type* zone = NULL; zone_type* result = NULL; if (zonelist && zonelist->zones && name && klass) { zone = zone_create((char*) name, klass); if (!zone) { ods_log_error("[%s] unable to lookup zone %s: " "zone_create() failed", zl_str, name); /* result stays NULL */ } else { result = zonelist_lookup_zone(zonelist, zone); zone_cleanup(zone); } } return result; } /** * Lookup zone by dname. * */ zone_type* zonelist_lookup_zone_by_dname(zonelist_type* zonelist, ldns_rdf* dname, ldns_rr_class klass) { char* name = NULL; zone_type* result = NULL; if (zonelist && zonelist->zones && dname && klass) { name = ldns_rdf2str(dname); result = zonelist_lookup_zone_by_name(zonelist, name, klass); free((void*)name); } return result; } /** * Add zone. * */ zone_type* zonelist_add_zone(zonelist_type* zlist, zone_type* zone) { ldns_rbnode_t* new_node = NULL; if (!zone) { return NULL; } if (!zlist || !zlist->zones) { zone_cleanup(zone); return NULL; } /* look up */ if (zonelist_lookup_zone(zlist, zone) != NULL) { ods_log_warning("[%s] unable to add zone %s: already present", zl_str, zone->name); zone_cleanup(zone); return NULL; } /* add */ new_node = zone2node(zone); if (ldns_rbtree_insert(zlist->zones, new_node) == NULL) { ods_log_error("[%s] unable to add zone %s: ldns_rbtree_insert() " "failed", zl_str, zone->name); free((void*) new_node); zone_cleanup(zone); return NULL; } zone->zl_status = ZONE_ZL_ADDED; zlist->just_added++; return zone; } /** * Delete zone. * */ zone_type* zonelist_del_zone(zonelist_type* zlist, zone_type* zone) { ldns_rbnode_t* old_node = LDNS_RBTREE_NULL; if (!zone) { return NULL; } if (!zlist || !zlist->zones) { goto zone_not_present; } old_node = ldns_rbtree_delete(zlist->zones, zone); if (!old_node) { goto zone_not_present; } free((void*) old_node); return zone; zone_not_present: ods_log_warning("[%s] unable to delete zone %s: not present", zl_str, zone->name); return zone; } /** * Merge zone lists. * */ static void zonelist_merge(zonelist_type* zl1, zonelist_type* zl2) { zone_type* z1 = NULL; zone_type* z2 = NULL; ldns_rbnode_t* n1 = LDNS_RBTREE_NULL; ldns_rbnode_t* n2 = LDNS_RBTREE_NULL; int ret = 0; ods_log_assert(zl1); ods_log_assert(zl2); ods_log_assert(zl1->zones); ods_log_assert(zl2->zones); ods_log_debug("[%s] merge two zone lists", zl_str); n1 = ldns_rbtree_first(zl1->zones); n2 = ldns_rbtree_first(zl2->zones); while (n2 && n2 != LDNS_RBTREE_NULL) { z2 = (zone_type*) n2->data; if (n1 && n1 != LDNS_RBTREE_NULL) { z1 = (zone_type*) n1->data; } else { z1 = NULL; } if (!z2) { /* no more zones to merge into zl1 */ return; } else if (!z1) { /* just add remaining zones from zl2 */ z2 = zonelist_add_zone(zl1, z2); if (!z2) { ods_log_crit("[%s] merge failed: z2 not added", zl_str); return; } n2 = ldns_rbtree_next(n2); } else { /* compare the zones z1 and z2 */ ret = zone_compare(z1, z2); if (ret < 0) { /* remove zone z1, it is not present in the new list zl2 */ z1->zl_status = ZONE_ZL_REMOVED; zl1->just_removed++; n1 = ldns_rbtree_next(n1); } else if (ret > 0) { /* add the new zone z2 */ z2 = zonelist_add_zone(zl1, z2); if (!z2) { ods_log_crit("[%s] merge failed: z2 not added", zl_str); return; } n2 = ldns_rbtree_next(n2); } else { /* just update zone z1 */ n1 = ldns_rbtree_next(n1); n2 = ldns_rbtree_next(n2); zone_merge(z1, z2); zone_cleanup(z2); if (z1->zl_status == ZONE_ZL_UPDATED) { zl1->just_updated++; } z1->zl_status = ZONE_ZL_UPDATED; } } } /* remove remaining zones from z1 */ while (n1 && n1 != LDNS_RBTREE_NULL) { z1 = (zone_type*) n1->data; z1->zl_status = ZONE_ZL_REMOVED; zl1->just_removed++; n1 = ldns_rbtree_next(n1); } zl1->last_modified = zl2->last_modified; return; } /** * Update zone list. * */ ods_status zonelist_update(zonelist_type* zl, const char* zlfile) { zonelist_type* new_zlist = NULL; allocator_type* tmp_alloc = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; char* datestamp = NULL; ods_log_debug("[%s] update zone list", zl_str); if (!zl|| !zl->zones || !zlfile) { return ODS_STATUS_ASSERT_ERR; } /* is the file updated? */ st_mtime = ods_file_lastmodified(zlfile); if (st_mtime <= zl->last_modified) { (void)time_datestamp(zl->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_debug("[%s] zonelist file %s is unchanged since %s", zl_str, zlfile, datestamp?datestamp:"Unknown"); free((void*)datestamp); return ODS_STATUS_UNCHANGED; } /* create new zonelist */ tmp_alloc = allocator_create(malloc, free); if (!tmp_alloc) { return ODS_STATUS_MALLOC_ERR; } new_zlist = zonelist_create(tmp_alloc); if (!new_zlist) { ods_log_error("[%s] unable to update zonelist: zonelist_create() " "failed", zl_str); allocator_cleanup(tmp_alloc); return ODS_STATUS_ERR; } /* read zonelist */ status = zonelist_read(new_zlist, zlfile); if (status == ODS_STATUS_OK) { zl->just_removed = 0; zl->just_added = 0; zl->just_updated = 0; new_zlist->last_modified = st_mtime; zonelist_merge(zl, new_zlist); (void)time_datestamp(zl->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_debug("[%s] file %s is modified since %s", zl_str, zlfile, datestamp?datestamp:"Unknown"); free((void*)datestamp); } else { ods_log_error("[%s] unable to update zonelist: read file %s failed " "(%s)", zl_str, zlfile, ods_status2str(status)); } zonelist_free(new_zlist); allocator_cleanup(tmp_alloc); return status; } /** * Internal zone cleanup function. * */ static void zone_delfunc(ldns_rbnode_t* elem) { zone_type* zone; if (elem && elem != LDNS_RBTREE_NULL) { zone = (zone_type*) elem->data; zone_delfunc(elem->left); zone_delfunc(elem->right); ods_log_deeebug("[%s] cleanup zone %s", zl_str, zone->name); zone_cleanup(zone); free((void*)elem); } return; } /** * Internal node cleanup function. * */ static void node_delfunc(ldns_rbnode_t* elem) { if (elem && elem != LDNS_RBTREE_NULL) { node_delfunc(elem->left); node_delfunc(elem->right); free((void*)elem); } return; } /** * Clean up a zonelist. * */ void zonelist_cleanup(zonelist_type* zl) { allocator_type* allocator; lock_basic_type zl_lock; if (!zl) { return; } ods_log_debug("[%s] cleanup zonelist", zl_str); if (zl->zones) { zone_delfunc(zl->zones->root); ldns_rbtree_free(zl->zones); zl->zones = NULL; } allocator = zl->allocator; zl_lock = zl->zl_lock; allocator_deallocate(allocator, (void*) zl); lock_basic_destroy(&zl_lock); return; } /** * Free zonelist. * */ void zonelist_free(zonelist_type* zl) { allocator_type* allocator; lock_basic_type zl_lock; if (!zl) { return; } if (zl->zones) { node_delfunc(zl->zones->root); ldns_rbtree_free(zl->zones); zl->zones = NULL; } allocator = zl->allocator; zl_lock = zl->zl_lock; allocator_deallocate(allocator, (void*) zl); lock_basic_destroy(&zl_lock); return; } opendnssec-1.4.3/signer/src/signer/domain.c0000664000175000017500000003772512101725407015600 00000000000000/* * $Id: domain.c 6988 2013-01-29 10:57:11Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Domain. * */ #include "config.h" #include "shared/log.h" #include "signer/backup.h" #include "signer/denial.h" #include "signer/domain.h" #include "signer/ixfr.h" #include "signer/zone.h" static const char* dname_str = "domain"; /** * Log domain name. * */ void log_dname(ldns_rdf *rdf, const char* pre, int level) { char* str = NULL; if (ods_log_get_level() < level) { return; } str = ldns_rdf2str(rdf); if (!str) { return; } if (level == LOG_EMERG) { ods_fatal_exit("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_ALERT) { ods_log_alert("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_CRIT) { ods_log_crit("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_ERR) { ods_log_error("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_WARNING) { ods_log_warning("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_NOTICE) { ods_log_info("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_INFO) { ods_log_verbose("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_DEBUG) { ods_log_debug("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_DEEEBUG) { ods_log_deeebug("[%s] %s: %s", dname_str, pre?pre:"", str); } else { ods_log_deeebug("[%s] %s: %s", dname_str, pre?pre:"", str); } free((void*)str); return; } /** * Create domain. * */ domain_type* domain_create(void* zoneptr, ldns_rdf* dname) { domain_type* domain = NULL; zone_type* zone = (zone_type*) zoneptr; if (!dname || !zoneptr) { return NULL; } domain = (domain_type*) allocator_alloc( zone->allocator, sizeof(domain_type)); if (!domain) { ods_log_error("[%s] unable to create domain: allocator_alloc() " "failed", dname_str); return NULL; } domain->dname = ldns_rdf_clone(dname); if (!domain->dname) { ods_log_error("[%s] unable to create domain: ldns_rdf_clone() " "failed", dname_str); allocator_deallocate(zone->allocator, domain); return NULL; } domain->zone = zoneptr; domain->denial = NULL; /* no reference yet */ domain->node = NULL; /* not in db yet */ domain->rrsets = NULL; domain->parent = NULL; domain->is_apex = 0; domain->is_new = 0; return domain; } /** * Count the number of RRsets at this domain. * */ size_t domain_count_rrset(domain_type* domain) { rrset_type* rrset = NULL; size_t count = 0; if (!domain) { return 0; } rrset = domain->rrsets; while (rrset) { count++; /* rr_count may be zero */ rrset = rrset->next; } return count; } /** * Count the number of RRsets at this domain with RRs that have is_added. * */ size_t domain_count_rrset_is_added(domain_type* domain) { rrset_type* rrset = NULL; size_t count = 0; if (!domain) { return 0; } rrset = domain->rrsets; while (rrset) { if (rrset_count_rr_is_added(rrset)) { count++; } rrset = rrset->next; } return count; } /** * Look up RRset at this domain. * */ rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype) { rrset_type* rrset = NULL; if (!domain || !domain->rrsets || !rrtype) { return NULL; } rrset = domain->rrsets; while (rrset && rrset->rrtype != rrtype) { rrset = rrset->next; } return rrset; } /** * Add RRset to domain. * */ void domain_add_rrset(domain_type* domain, rrset_type* rrset) { rrset_type** p = NULL; denial_type* denial = NULL; ods_log_assert(domain); ods_log_assert(rrset); if (!domain->rrsets) { domain->rrsets = rrset; } else { p = &domain->rrsets; while(*p) { p = &((*p)->next); } *p = rrset; rrset->next = NULL; } log_rrset(domain->dname, rrset->rrtype, "+RRSET", LOG_DEEEBUG); rrset->domain = (void*) domain; if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } return; } /** * Delete RRset from domain. * */ rrset_type* domain_del_rrset(domain_type* domain, ldns_rr_type rrtype) { rrset_type* cur = NULL; denial_type* denial = NULL; if (!domain || !rrtype) { return NULL; } if (!domain->rrsets) { ods_log_error("[%s] unable to delete RRset: RRset with RRtype %s " "does not exist", dname_str, rrset_type2str(rrtype)); return NULL; } if (domain->rrsets->rrtype == rrtype) { cur = domain->rrsets; domain->rrsets = cur->next; cur->domain = NULL; cur->next = NULL; log_rrset(domain->dname, rrtype, "-RRSET", LOG_DEEEBUG); if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } return cur; } cur = domain->rrsets; while (cur) { if (!cur->next) { ods_log_error("[%s] unable to delete RRset: RRset with RRtype %s " "does not exist", dname_str, rrset_type2str(rrtype)); return NULL; } ods_log_assert(cur->next); if (cur->next->rrtype != rrtype) { cur = cur->next; } else { ods_log_assert(cur->next->rrtype == rrtype); cur->next = cur->next->next; cur = cur->next; cur->domain = NULL; cur->next = NULL; log_rrset(domain->dname, rrtype, "-RRSET", LOG_DEEEBUG); if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } return cur; } } ods_log_error("[%s] unable to delete RRset: RRset with RRtype %s " "does not exist", dname_str, rrset_type2str(rrtype)); return NULL; } /** * Apply differences at domain. * */ void domain_diff(domain_type* domain, unsigned is_ixfr, unsigned more_coming) { denial_type* denial = NULL; rrset_type* rrset = NULL; rrset_type* prev_rrset = NULL; if (!domain) { return; } rrset = domain->rrsets; while (rrset) { if (rrset->rrtype == LDNS_RR_TYPE_NSEC3PARAMS || rrset->rrtype == LDNS_RR_TYPE_DNSKEY) { /* always do full diff on NSEC3PARAMS | DNSKEY RRset */ rrset_diff(rrset, 0, more_coming); } else { rrset_diff(rrset, is_ixfr, more_coming); } if (rrset->rr_count <= 0) { /* delete entire rrset */ if (!prev_rrset) { domain->rrsets = rrset->next; } else { prev_rrset->next = rrset->next; } rrset->next = NULL; log_rrset(domain->dname, rrset->rrtype, "-RRSET", LOG_DEEEBUG); rrset_cleanup(rrset); if (!prev_rrset) { rrset = domain->rrsets; } else { rrset = prev_rrset->next; } if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } } else { /* just go to next rrset */ prev_rrset = rrset; rrset = rrset->next; } } return; } /** * Rollback differences at domain. * */ void domain_rollback(domain_type* domain, int keepsc) { denial_type* denial = NULL; rrset_type* rrset = NULL; rrset_type* prev_rrset = NULL; ldns_rr* del_rr = NULL; int del_rrset = 0; uint16_t i = 0; if (!domain) { return; } rrset = domain->rrsets; while (rrset) { if (keepsc) { /* skip rollback for NSEC3PARAM and DNSKEY RRset */ if (rrset->rrtype == LDNS_RR_TYPE_NSEC3PARAMS || rrset->rrtype == LDNS_RR_TYPE_DNSKEY) { prev_rrset = rrset; rrset = rrset->next; continue; } } /* walk rrs */ for (i=0; i < rrset->rr_count; i++) { rrset->rrs[i].is_added = 0; rrset->rrs[i].is_removed = 0; if (!rrset->rrs[i].exists) { /* can we delete the RRset? */ if(rrset->rr_count == 1) { del_rrset = 1; } del_rr = rrset->rrs[i].rr; rrset_del_rr(rrset, i); ldns_rr_free(del_rr); del_rr = NULL; i--; } } /* next rrset */ if (del_rrset) { /* delete entire rrset */ if (!prev_rrset) { domain->rrsets = rrset->next; } else { prev_rrset->next = rrset->next; } rrset->next = NULL; log_rrset(domain->dname, rrset->rrtype, "-RRSET", LOG_DEEEBUG); rrset_cleanup(rrset); if (!prev_rrset) { rrset = domain->rrsets; } else { rrset = prev_rrset->next; } if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 0; } del_rrset = 0; } else { /* just go to next rrset */ prev_rrset = rrset; rrset = rrset->next; } } return; } /** * Check whether a domain is an empty non-terminal to unsigned delegation. * */ int domain_ent2unsignedns(domain_type* domain) { ldns_rbnode_t* n = LDNS_RBTREE_NULL; domain_type* d = NULL; ods_log_assert(domain); if (domain->rrsets) { return 0; /* not an empty non-terminal */ } n = ldns_rbtree_next(domain->node); while (n && n != LDNS_RBTREE_NULL) { d = (domain_type*) n->data; if (!ldns_dname_is_subdomain(d->dname, domain->dname)) { break; } if (d->rrsets) { if (domain_is_delegpt(d) != LDNS_RR_TYPE_NS && domain_is_occluded(d) == LDNS_RR_TYPE_SOA) { /* domain has signed delegation/auth */ return 0; } } /* maybe there is data at the next domain */ n = ldns_rbtree_next(n); } return 1; } /** * Check whether the domain is a delegation point. * */ ldns_rr_type domain_is_delegpt(domain_type* domain) { ods_log_assert(domain); if (domain->is_apex) { return LDNS_RR_TYPE_SOA; } if (domain_lookup_rrset(domain, LDNS_RR_TYPE_NS)) { if (domain_lookup_rrset(domain, LDNS_RR_TYPE_DS)) { /* Signed delegation */ return LDNS_RR_TYPE_DS; } else { /* Unsigned delegation */ return LDNS_RR_TYPE_NS; } } /* Authoritative */ return LDNS_RR_TYPE_SOA; } /** * Check whether the domain is occluded. * */ ldns_rr_type domain_is_occluded(domain_type* domain) { domain_type* parent = NULL; ods_log_assert(domain); if (domain->is_apex) { return LDNS_RR_TYPE_SOA; } parent = domain->parent; while (parent && !parent->is_apex) { if (domain_lookup_rrset(parent, LDNS_RR_TYPE_NS)) { /* Glue / Empty non-terminal to Glue */ return LDNS_RR_TYPE_A; } if (domain_lookup_rrset(parent, LDNS_RR_TYPE_DNAME)) { /* Occluded data / Empty non-terminal to Occluded data */ return LDNS_RR_TYPE_DNAME; } parent = parent->parent; } /* Authoritative or delegation */ return LDNS_RR_TYPE_SOA; } /** * Print domain. * */ void domain_print(FILE* fd, domain_type* domain, ods_status* status) { char* str = NULL; rrset_type* rrset = NULL; rrset_type* soa_rrset = NULL; rrset_type* cname_rrset = NULL; if (!domain || !fd) { if (status) { ods_log_crit("[%s] unable to print domain: domain or fd missing", dname_str); *status = ODS_STATUS_ASSERT_ERR; } return; } /* empty non-terminal? */ if (!domain->rrsets) { str = ldns_rdf2str(domain->dname); fprintf(fd, ";;Empty non-terminal %s\n", str); free((void*)str); /* Denial of Existence */ if (domain->denial) { denial_print(fd, (denial_type*) domain->denial, status); } return; } /* no other data may accompany a CNAME */ cname_rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_CNAME); if (cname_rrset) { rrset_print(fd, cname_rrset, 0, status); } else { /* if SOA, print soa first */ if (domain->is_apex) { soa_rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_SOA); if (soa_rrset) { rrset_print(fd, soa_rrset, 0, status); if (status && *status != ODS_STATUS_OK) { return; } } } /* print other RRsets */ rrset = domain->rrsets; while (rrset) { /* skip SOA RRset */ if (rrset->rrtype != LDNS_RR_TYPE_SOA) { rrset_print(fd, rrset, 0, status); } if (status && *status != ODS_STATUS_OK) { ods_log_crit("[%s] failed to print one or more RRsets: %s", dname_str, ods_status2str(*status)); return; } rrset = rrset->next; } } /* Denial of Existence */ if (domain->denial) { denial_print(fd, (denial_type*) domain->denial, status); } return; } /** * Clean up domain. * */ void domain_cleanup(domain_type* domain) { zone_type* zone = NULL; if (!domain) { return; } zone = (zone_type*) domain->zone; ldns_rdf_deep_free(domain->dname); rrset_cleanup(domain->rrsets); allocator_deallocate(zone->allocator, (void*)domain); return; } /** * Backup domain. * */ void domain_backup2(FILE* fd, domain_type* domain, int sigs) { rrset_type* rrset = NULL; if (!domain || !fd) { return; } /* if SOA, print soa first */ if (domain->is_apex) { rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_SOA); if (rrset) { if (sigs) { rrset_backup2(fd, rrset); } else { rrset_print(fd, rrset, 1, NULL); } } } rrset = domain->rrsets; while (rrset) { /* skip SOA RRset */ if (rrset->rrtype != LDNS_RR_TYPE_SOA) { if (sigs) { rrset_backup2(fd, rrset); } else { rrset_print(fd, rrset, 1, NULL); } } rrset = rrset->next; } return; } opendnssec-1.4.3/signer/src/signer/ixfr.h0000664000175000017500000000521611775503701015303 00000000000000/* * $Id: ixfr.h 5260 2011-06-28 14:13:14Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Domain name database. * */ #ifndef SIGNER_IXFR_H #define SIGNER_IXFR_H #include "config.h" #include "shared/locks.h" #include #define IXFR_MAX_PARTS 3 /** * Part of IXFR Journal. * */ typedef struct part_struct part_type; struct part_struct { ldns_rr* soamin; ldns_rr_list* min; ldns_rr* soaplus; ldns_rr_list* plus; }; /** * IXFR Journal. * */ typedef struct ixfr_struct ixfr_type; struct ixfr_struct { void* zone; part_type* part[IXFR_MAX_PARTS]; lock_basic_type ixfr_lock; }; /** * Create a new ixfr journal. * \param[in] zone zone reference * \return ixfr_type* ixfr * */ ixfr_type* ixfr_create(void* zone); /** * Add +RR to ixfr journal. * \param[in] ixfr journal * \param[in] rr +RR * */ void ixfr_add_rr(ixfr_type* ixfr, ldns_rr* rr); /** * Add -RR to ixfr journal. * \param[in] ixfr journal * \param[in] rr -RR * */ void ixfr_del_rr(ixfr_type* ixfr, ldns_rr* rr); /** * Print the ixfr journal. * \param[in] fd file descriptor * \param[in] ixfr journal * */ void ixfr_print(FILE* fd, ixfr_type* ixfr); /** * Purge the ixfr journal. * \param[in] ixfr journal * */ void ixfr_purge(ixfr_type* ixfr); /** * Cleanup the ixfr journal. * \param[in] ixfr journal * */ void ixfr_cleanup(ixfr_type* ixfr); #endif /* SIGNER_IXFR_H */ opendnssec-1.4.3/signer/src/signer/namedb.c0000664000175000017500000007717412225763434015572 00000000000000/* * $Id: namedb.c 5467 2011-08-24 06:51:16Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Domain name database. * */ #include "config.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/namedb.h" #include "signer/zone.h" const char* db_str = "namedb"; /** * Convert a domain to a tree node. * */ static ldns_rbnode_t* domain2node(domain_type* domain) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (!node) { return NULL; } node->key = domain->dname; node->data = domain; return node; } /** * Convert a denial to a tree node. * */ static ldns_rbnode_t* denial2node(denial_type* denial) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (!node) { return NULL; } node->key = denial->dname; node->data = denial; return node; } /** * Compare domains. * */ static int domain_compare(const void* a, const void* b) { ldns_rdf* x = (ldns_rdf*)a; ldns_rdf* y = (ldns_rdf*)b; return ldns_dname_compare(x, y); } /** * Initialize denials. * */ void namedb_init_denials(namedb_type* db) { if (db) { db->denials = ldns_rbtree_create(domain_compare); } return; } /** * Initialize domains. * */ static void namedb_init_domains(namedb_type* db) { if (db) { db->domains = ldns_rbtree_create(domain_compare); } return; } /** * Create a new namedb. * */ namedb_type* namedb_create(void* zone) { namedb_type* db = NULL; zone_type* z = (zone_type*) zone; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->allocator); db = (namedb_type*) allocator_alloc(z->allocator, sizeof(namedb_type)); if (!db) { ods_log_error("[%s] unable to create namedb for zone %s: " "allocator_alloc() failed", db_str, z->name); return NULL; } db->zone = zone; namedb_init_domains(db); if (!db->domains) { ods_log_error("[%s] unable to create namedb for zone %s: " "init domains failed", db_str, z->name); namedb_cleanup(db); return NULL; } namedb_init_denials(db); if (!db->denials) { ods_log_error("[%s] unable to create namedb for zone %s: " "init denials failed", db_str, z->name); namedb_cleanup(db); return NULL; } db->inbserial = 0; db->intserial = 0; db->outserial = 0; db->altserial = 0; db->is_initialized = 0; db->have_serial = 0; db->is_processed = 0; db->serial_updated = 0; db->force_serial = 0; return db; } /** * Internal lookup domain function. * */ static void* namedb_domain_search(ldns_rbtree_t* tree, ldns_rdf* dname) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; if (!tree || !dname) { return NULL; } node = ldns_rbtree_search(tree, dname); if (node && node != LDNS_RBTREE_NULL) { return (void*) node->data; } return NULL; } static uint32_t max(uint32_t a, uint32_t b) { return (aoutserial, inbound_serial); if (!db->have_serial) { prev = inbound_serial; } ods_log_debug("[%s] zone %s update serial: format=%s in=%u internal=%u " "out=%u now=%u", db_str, zone_name, format, db->inbserial, db->intserial, db->outserial, (uint32_t) time_now()); if (db->force_serial) { soa = db->altserial; if (!util_serial_gt(soa, prev)) { ods_log_warning("[%s] zone %s unable to enforce serial: %u does not " " increase %u. Serial set to %u", db_str, zone_name, soa, prev, (prev+1)); soa = prev + 1; } else { ods_log_info("[%s] zone %s enforcing serial %u", db_str, zone_name, soa); } db->force_serial = 0; } else if (ods_strcmp(format, "unixtime") == 0) { soa = (uint32_t) time_now(); if (!util_serial_gt(soa, prev)) { if (!db->have_serial) { ods_log_warning("[%s] zone %s unable to use unixtime as serial: " "%u does not increase %u. Serial set to %u", db_str, zone_name, soa, prev, (prev+1)); } soa = prev + 1; } } else if (ods_strcmp(format, "datecounter") == 0) { soa = (uint32_t) time_datestamp(0, "%Y%m%d", NULL) * 100; if (!util_serial_gt(soa, prev)) { if (!db->have_serial) { ods_log_warning("[%s] zone %s unable to use datecounter as " "serial: %u does not increase %u. Serial set to %u", db_str, zone_name, soa, prev, (prev+1)); } soa = prev + 1; } } else if (ods_strcmp(format, "counter") == 0) { soa = inbound_serial + 1; if (db->have_serial && !util_serial_gt(soa, prev)) { soa = prev + 1; } } else if (ods_strcmp(format, "keep") == 0) { prev = db->outserial; soa = inbound_serial; if (db->have_serial && !util_serial_gt(soa, prev)) { ods_log_error("[%s] zone %s cannot keep SOA SERIAL from input zone " " (%u): previous output SOA SERIAL is %u", db_str, zone_name, soa, prev); return ODS_STATUS_CONFLICT_ERR; } } else { ods_log_error("[%s] zone %s unknown serial type %s", db_str, zone_name, format); return ODS_STATUS_ERR; } /* serial is stored in 32 bits */ update = soa - prev; if (update > 0x7FFFFFFF) { update = 0x7FFFFFFF; } if (!db->have_serial) { db->intserial = soa; } else { db->intserial = prev + update; /* automatically does % 2^32 */ } ods_log_debug("[%s] zone %s update serial: %u + %u = %u", db_str, zone_name, prev, update, db->intserial); return ODS_STATUS_OK; } /** * Add empty non-terminals for domain. * */ ods_status namedb_domain_entize(namedb_type* db, domain_type* domain, ldns_rdf* apex) { ldns_rdf* parent_rdf = NULL; domain_type* parent_domain = NULL; ods_log_assert(apex); ods_log_assert(domain); ods_log_assert(domain->dname); ods_log_assert(db); ods_log_assert(db->domains); if (domain->parent) { /* domain already has parent */ return ODS_STATUS_OK; } while (domain && ldns_dname_is_subdomain(domain->dname, apex) && ldns_dname_compare(domain->dname, apex) != 0) { /** * RFC5155: * 4. If the difference in number of labels between the apex and * the original owner name is greater than 1, additional NSEC3 * RRs need to be added for every empty non-terminal between * the apex and the original owner name. */ parent_rdf = ldns_dname_left_chop(domain->dname); if (!parent_rdf) { ods_log_error("[%s] unable to entize domain: left chop failed", db_str); return ODS_STATUS_ERR; } parent_domain = namedb_lookup_domain(db, parent_rdf); if (!parent_domain) { parent_domain = namedb_add_domain(db, parent_rdf); ldns_rdf_deep_free(parent_rdf); if (!parent_domain) { ods_log_error("[%s] unable to entize domain: failed to add " "parent domain", db_str); return ODS_STATUS_ERR; } domain->parent = parent_domain; /* continue with the parent domain */ domain = parent_domain; } else { ldns_rdf_deep_free(parent_rdf); domain->parent = parent_domain; /* domain has parent, entize done */ domain = NULL; } } return ODS_STATUS_OK; } /** * Lookup domain. * */ domain_type* namedb_lookup_domain(namedb_type* db, ldns_rdf* dname) { if (!db) { return NULL; } return (domain_type*) namedb_domain_search(db->domains, dname); } /** * Add domain to namedb. * */ domain_type* namedb_add_domain(namedb_type* db, ldns_rdf* dname) { domain_type* domain = NULL; ldns_rbnode_t* new_node = LDNS_RBTREE_NULL; if (!dname || !db || !db->domains) { return NULL; } domain = domain_create(db->zone, dname); if (!domain) { ods_log_error("[%s] unable to add domain: domain_create() failed", db_str); return NULL; } new_node = domain2node(domain); if (!new_node) { ods_log_error("[%s] unable to add domain: domain2node() failed", db_str); return NULL; } if (ldns_rbtree_insert(db->domains, new_node) == NULL) { ods_log_error("[%s] unable to add domain: already present", db_str); log_dname(domain->dname, "ERR +DOMAIN", LOG_ERR); domain_cleanup(domain); free((void*)new_node); return NULL; } domain = (domain_type*) new_node->data; domain->node = new_node; domain->is_new = 1; log_dname(domain->dname, "+DOMAIN", LOG_DEEEBUG); return domain; } /** * Delete domain from namedb * */ domain_type* namedb_del_domain(namedb_type* db, domain_type* domain) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; if (!domain || !db || !db->domains) { ods_log_error("[%s] unable to delete domain: !db || !domain", db_str); return NULL; } if (domain->rrsets || domain->denial) { ods_log_error("[%s] unable to delete domain: domain in use", db_str); log_dname(domain->dname, "ERR -DOMAIN", LOG_ERR); return NULL; } node = ldns_rbtree_delete(db->domains, (const void*)domain->dname); if (node) { ods_log_assert(domain->node == node); ods_log_assert(!domain->rrsets); ods_log_assert(!domain->denial); free((void*)node); domain->node = NULL; log_dname(domain->dname, "-DOMAIN", LOG_DEEEBUG); return domain; } ods_log_error("[%s] unable to delete domain: not found", db_str); log_dname(domain->dname, "ERR -DOMAIN", LOG_ERR); return NULL; } /** * Lookup denial. * */ denial_type* namedb_lookup_denial(namedb_type* db, ldns_rdf* dname) { if (!db) { return NULL; } return (denial_type*) namedb_domain_search(db->denials, dname); } /** * See if a domain is an empty terminal * */ static int domain_is_empty_terminal(domain_type* domain) { ldns_rbnode_t* n = LDNS_RBTREE_NULL; domain_type* d = NULL; ods_log_assert(domain); if (domain->is_apex) { return 0; } if (domain->rrsets) { return 0; } n = ldns_rbtree_next(domain->node); if (n) { d = (domain_type*) n->data; } /* if it has children domains, do not delete it */ if(d && ldns_dname_is_subdomain(d->dname, domain->dname)) { return 0; } return 1; } /** * See if a domain can be deleted * */ static int domain_can_be_deleted(domain_type* domain) { ods_log_assert(domain); return (domain_is_empty_terminal(domain) && !domain->denial); } /** * Add NSEC data point. * */ static void namedb_add_nsec_trigger(namedb_type* db, domain_type* domain) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(domain); ods_log_assert(!domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A) { return; /* don't do occluded/glue domain */ } if (!domain->rrsets) { return; /* don't do empty domain */ } /* ok, nsecify this domain */ denial = namedb_add_denial(db, domain->dname, NULL); ods_log_assert(denial); denial->domain = (void*) domain; domain->denial = (void*) denial; domain->is_new = 0; return; } /** * Add NSEC3 data point. * */ static void namedb_add_nsec3_trigger(namedb_type* db, domain_type* domain, nsec3params_type* n3p) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(n3p); ods_log_assert(domain); ods_log_assert(!domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A) { return; /* don't do occluded/glue domain */ } /* Opt-Out? */ if (n3p->flags) { dstatus = domain_is_delegpt(domain); /* If Opt-Out is being used, owner names of unsigned delegations MAY be excluded. */ if (dstatus == LDNS_RR_TYPE_NS || domain_ent2unsignedns(domain)) { return; } } /* ok, nsecify3 this domain */ denial = namedb_add_denial(db, domain->dname, n3p); ods_log_assert(denial); denial->domain = (void*) domain; domain->denial = (void*) denial; domain->is_new = 0; return; } /** * See if denials need to be added. * */ static void namedb_add_denial_trigger(namedb_type* db, domain_type* domain) { zone_type* zone = NULL; ods_log_assert(db); ods_log_assert(domain); if (!domain->denial) { zone = (void*) domain->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); if (zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC) { namedb_add_nsec_trigger(db, domain); } else { ods_log_assert(zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC3); namedb_add_nsec3_trigger(db, domain, zone->signconf->nsec3params); } } return; } /** * Delete NSEC data point. * */ static void namedb_del_nsec_trigger(namedb_type* db, domain_type* domain) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(domain); ods_log_assert(domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A || domain_is_empty_terminal(domain) || !domain->rrsets) { /* domain has become occluded/glue or empty non-terminal*/ denial_diff((denial_type*) domain->denial); denial = namedb_del_denial(db, domain->denial); denial_cleanup(denial); domain->denial = NULL; } return; } /** * Delete NSEC3 data point. * */ static void namedb_del_nsec3_trigger(namedb_type* db, domain_type* domain, nsec3params_type* n3p) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(n3p); ods_log_assert(domain); ods_log_assert(domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A || domain_is_empty_terminal(domain)) { /* domain has become occluded/glue */ denial_diff((denial_type*) domain->denial); denial = namedb_del_denial(db, domain->denial); denial_cleanup(denial); domain->denial = NULL; } else if (n3p->flags) { dstatus = domain_is_delegpt(domain); /* If Opt-Out is being used, owner names of unsigned delegations MAY be excluded. */ if (dstatus == LDNS_RR_TYPE_NS || domain_ent2unsignedns(domain)) { denial_diff((denial_type*) domain->denial); denial = namedb_del_denial(db, domain->denial); denial_cleanup(denial); domain->denial = NULL; } } return; } /** * See if domains/denials can be deleted. * */ static int namedb_del_denial_trigger(namedb_type* db, domain_type* domain, int rollback) { domain_type* parent = NULL; zone_type* zone = NULL; unsigned is_deleted = 0; ods_log_assert(db); ods_log_assert(domain); ods_log_assert(domain->dname); zone = (void*) domain->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); while(domain) { if (!rollback) { if (domain->denial) { if (zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC) { namedb_del_nsec_trigger(db, domain); } else { ods_log_assert(zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC3); namedb_del_nsec3_trigger(db, domain, zone->signconf->nsec3params); } } } parent = domain->parent; if (domain_can_be_deleted(domain)) { /* -DOMAIN */ domain = namedb_del_domain(db, domain); domain_cleanup(domain); is_deleted = 1; } /* continue with parent */ domain = parent; } return is_deleted; } /** * Hash domain name. * */ static ldns_rdf* dname_hash(ldns_rdf* dname, ldns_rdf* apex, nsec3params_type* nsec3params) { ldns_rdf* hashed_ownername = NULL; ldns_rdf* hashed_label = NULL; ods_log_assert(dname); ods_log_assert(apex); ods_log_assert(nsec3params); /** * The owner name of the NSEC3 RR is the hash of the original owner * name, prepended as a single label to the zone name. */ hashed_label = ldns_nsec3_hash_name(dname, nsec3params->algorithm, nsec3params->iterations, nsec3params->salt_len, nsec3params->salt_data); if (!hashed_label) { return NULL; } hashed_ownername = ldns_dname_cat_clone((const ldns_rdf*) hashed_label, (const ldns_rdf*) apex); if (!hashed_ownername) { return NULL; } ldns_rdf_deep_free(hashed_label); return hashed_ownername; } /** * Add denial to namedb. * */ denial_type* namedb_add_denial(namedb_type* db, ldns_rdf* dname, nsec3params_type* n3p) { zone_type* z = NULL; ldns_rbnode_t* new_node = LDNS_RBTREE_NULL; ldns_rbnode_t* pnode = LDNS_RBTREE_NULL; ldns_rdf* owner = NULL; denial_type* denial = NULL; denial_type* pdenial = NULL; ods_log_assert(db); ods_log_assert(db->denials); ods_log_assert(dname); /* nsec or nsec3 */ if (n3p) { z = (zone_type*) db->zone; owner = dname_hash(dname, z->apex, n3p); } else { owner = ldns_rdf_clone(dname); } if (!owner) { ods_log_error("[%s] unable to add denial: create owner failed", db_str); return NULL; } denial = denial_create(db->zone, owner); if (!denial) { ods_log_error("[%s] unable to add denial: denial_create() failed", db_str); return NULL; } new_node = denial2node(denial); if (!new_node) { ods_log_error("[%s] unable to add denial: denial2node() failed", db_str); return NULL; } if (!ldns_rbtree_insert(db->denials, new_node)) { ods_log_error("[%s] unable to add denial: already present", db_str); log_dname(denial->dname, "ERR +DENIAL", LOG_ERR); denial_cleanup(denial); free((void*)new_node); return NULL; } /* denial of existence data point added */ denial = (denial_type*) new_node->data; denial->node = new_node; denial->nxt_changed = 1; pnode = ldns_rbtree_previous(new_node); if (!pnode || pnode == LDNS_RBTREE_NULL) { pnode = ldns_rbtree_last(db->denials); } ods_log_assert(pnode); pdenial = (denial_type*) pnode->data; ods_log_assert(pdenial); pdenial->nxt_changed = 1; log_dname(denial->dname, "+DENIAL", LOG_DEEEBUG); return denial; } /** * Delete denial from namedb * */ denial_type* namedb_del_denial(namedb_type* db, denial_type* denial) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; ldns_rbnode_t* pnode = LDNS_RBTREE_NULL; denial_type* pdenial = NULL; if (!denial || !db || !db->denials) { return NULL; } if (denial->rrset && denial->rrset->rr_count) { ods_log_error("[%s] unable to delete denial: denial in use [#%u]", db_str, denial->rrset->rr_count); log_dname(denial->dname, "ERR -DENIAL", LOG_ERR); return NULL; } pnode = ldns_rbtree_previous(denial->node); if (!pnode || pnode == LDNS_RBTREE_NULL) { pnode = ldns_rbtree_last(db->denials); } ods_log_assert(pnode); pdenial = (denial_type*) pnode->data; ods_log_assert(pdenial); node = ldns_rbtree_delete(db->denials, (const void*)denial->dname); if (!node) { ods_log_error("[%s] unable to delete denial: not found", db_str); log_dname(denial->dname, "ERR -DENIAL", LOG_ERR); return NULL; } ods_log_assert(denial->node == node); pdenial->nxt_changed = 1; free((void*)node); denial->domain = NULL; denial->node = NULL; log_dname(denial->dname, "-DENIAL", LOG_DEEEBUG); return denial; } /** * Apply differences in db. * */ void namedb_diff(namedb_type* db, unsigned is_ixfr, unsigned more_coming) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; if (!db || !db->domains) { return; } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; node = ldns_rbtree_next(node); domain_diff(domain, is_ixfr, more_coming); } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; node = ldns_rbtree_next(node); if (!namedb_del_denial_trigger(db, domain, 0)) { /* del_denial did not delete domain */ namedb_add_denial_trigger(db, domain); } } return; } /** * Rollback differences in db. * */ void namedb_rollback(namedb_type* db, unsigned keepsc) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; if (!db || !db->domains) { return; } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; node = ldns_rbtree_next(node); domain_rollback(domain, keepsc); (void) namedb_del_denial_trigger(db, domain, 1); } return; } /** * Nsecify db. * */ void namedb_nsecify(namedb_type* db, uint32_t* num_added) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; ldns_rbnode_t* nxt_node = LDNS_RBTREE_NULL; denial_type* denial = NULL; denial_type* nxt = NULL; uint32_t nsec_added = 0; ods_log_assert(db); node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; nxt_node = ldns_rbtree_next(node); if (!nxt_node || nxt_node == LDNS_RBTREE_NULL) { nxt_node = ldns_rbtree_first(db->denials); } nxt = (denial_type*) nxt_node->data; denial_nsecify(denial, nxt, &nsec_added); node = ldns_rbtree_next(node); } if (num_added) { *num_added = nsec_added; } return; } /** * Examine updates to db. * */ ods_status namedb_examine(namedb_type* db) { ods_status status = ODS_STATUS_OK; ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; rrset_type* rrset = NULL; /* ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; ldns_rr_type delegpt = LDNS_RR_TYPE_FIRST; */ if (!db || !db->domains) { /* no db, no error */ return ODS_STATUS_OK; } if (db->domains->root != LDNS_RBTREE_NULL) { node = ldns_rbtree_first(db->domains); } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_CNAME); if (rrset) { /* Thou shall not have other data next to CNAME */ if (domain_count_rrset_is_added(domain) > 1 && rrset_count_rr_is_added(rrset) > 0) { log_rrset(domain->dname, rrset->rrtype, "CNAME and other data at the same name", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } /* Thou shall have at most one CNAME per name */ if (rrset_count_rr_is_added(rrset) > 1) { log_rrset(domain->dname, rrset->rrtype, "multiple CNAMEs at the same name", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } } rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_DNAME); if (rrset) { /* Thou shall have at most one DNAME per name */ if (rrset_count_rr_is_added(rrset) > 1) { log_rrset(domain->dname, rrset->rrtype, "multiple DNAMEs at the same name", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } } /* dstatus = domain_is_occluded(domain); delegpt = domain_is_delegpt(domain); */ /* Thou shall not have occluded data in your zone file */ node = ldns_rbtree_next(node); } return status; } /** * Wipe out all NSEC RRsets. * */ void namedb_wipe_denial(namedb_type* db) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; denial_type* denial = NULL; zone_type* zone = NULL; size_t i = 0; if (db && db->denials) { zone = (zone_type*) db->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] wipe denial of existence space zone %s", db_str, zone->name); node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; if (!denial->rrset) { node = ldns_rbtree_next(node); continue; } for (i=0; i < denial->rrset->rr_count; i++) { if (denial->rrset->rrs[i].exists) { /* ixfr -RR */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, denial->rrset->rrs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); } denial->rrset->rrs[i].exists = 0; rrset_del_rr(denial->rrset, i); i--; } for (i=0; i < denial->rrset->rrsig_count; i++) { /* ixfr -RRSIG */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, denial->rrset->rrsigs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_del_rrsig(denial->rrset, i); i--; } rrset_cleanup(denial->rrset); denial->rrset = NULL; node = ldns_rbtree_next(node); } } return; } /** * Export db to file. * */ void namedb_export(FILE* fd, namedb_type* db, ods_status* status) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; if (!fd || !db || !db->domains) { if (status) { ods_log_error("[%s] unable to export namedb: file descriptor " "or name database missing", db_str); *status = ODS_STATUS_ASSERT_ERR; } return; } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { fprintf(fd, "; empty zone\n"); if (status) { *status = ODS_STATUS_OK; } return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; if (domain) { domain_print(fd, domain, status); } node = ldns_rbtree_next(node); } return; } /** * Clean up domains in namedb. * */ static void domain_delfunc(ldns_rbnode_t* elem) { domain_type* domain = NULL; if (elem && elem != LDNS_RBTREE_NULL) { domain = (domain_type*) elem->data; domain_delfunc(elem->left); domain_delfunc(elem->right); domain_cleanup(domain); free((void*)elem); } return; } /** * Clean up denials. * */ static void denial_delfunc(ldns_rbnode_t* elem) { denial_type* denial = NULL; domain_type* domain = NULL; if (elem && elem != LDNS_RBTREE_NULL) { denial = (denial_type*) elem->data; denial_delfunc(elem->left); denial_delfunc(elem->right); domain = (domain_type*) denial->domain; if (domain) { domain->denial = NULL; } denial_cleanup(denial); free((void*)elem); } return; } /** * Clean up domains. * */ static void namedb_cleanup_domains(namedb_type* db) { if (db && db->domains) { domain_delfunc(db->domains->root); ldns_rbtree_free(db->domains); db->domains = NULL; } return; } /** * Clean up denials. * */ void namedb_cleanup_denials(namedb_type* db) { if (db && db->denials) { denial_delfunc(db->denials->root); ldns_rbtree_free(db->denials); db->denials = NULL; } return; } /** * Clean up namedb. * */ void namedb_cleanup(namedb_type* db) { zone_type* z = NULL; if (!db) { return; } z = (zone_type*) db->zone; if (!z || !z->allocator) { return; } namedb_cleanup_denials(db); namedb_cleanup_domains(db); allocator_deallocate(z->allocator, (void*) db); return; } /** * Backup namedb. * */ void namedb_backup2(FILE* fd, namedb_type* db) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; denial_type* denial = NULL; if (!fd || !db) { return; } node = ldns_rbtree_first(db->domains); while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; domain_backup2(fd, domain, 0); node = ldns_rbtree_next(node); } fprintf(fd, ";\n"); node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; if (denial->rrset) { rrset_print(fd, denial->rrset, 1, NULL); } node = ldns_rbtree_next(node); } fprintf(fd, ";\n"); /* signatures */ node = ldns_rbtree_first(db->domains); while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; domain_backup2(fd, domain, 1); node = ldns_rbtree_next(node); } node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; if (denial->rrset) { rrset_backup2(fd, denial->rrset); } node = ldns_rbtree_next(node); } fprintf(fd, ";\n"); return; } opendnssec-1.4.3/signer/src/signer/nsec3params.h0000664000175000017500000000662511732103213016542 00000000000000/* * $Id: nsec3params.h 6215 2012-03-20 13:30:51Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * NSEC3 Parameters. * */ #ifndef SIGNER_NSEC3PARAMS_H #define SIGNER_NSEC3PARAMS_H #include "config.h" #include "shared/status.h" #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include /** * NSEC3 Parameters structure. */ typedef struct nsec3params_struct nsec3params_type; struct nsec3params_struct { void* sc; uint8_t algorithm; uint8_t flags; uint16_t iterations; uint8_t salt_len; uint8_t* salt_data; ldns_rr* rr; }; /** * Create NSEC3 salt. * \param[in] salt_str the salt in string format * \param[out] salt_len lenght of the salt data * \param[out] salt salt in raw data format * \return ods_status status * */ ods_status nsec3params_create_salt(const char* salt_str, uint8_t* salt_len, uint8_t** salt); /** * Create new NSEC3 parameters. * \param[in] sc signer configuration reference * \param[in] algo algorithm * \param[in] flags flags, Opt-Out or Opt-In * \param[in] iter number of iterations * \param[in] salt salt * \return nsec3params_type* the created nsec3params * */ nsec3params_type* nsec3params_create(void* sc, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt); /** * Backup NSEC3 parameters. * \param[in] fd file descriptor * \param[in] algo algorithm * \param[in] flags glags, Opt-Out or Opt-In * \param[in] iter number of iterations * \param[in] salt salt * \param[in] rr NSEC3PARAM RR * \param[in] version version string * */ void nsec3params_backup(FILE* fd, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt, ldns_rr* rr, const char* version); /** * Convert salt to string. * \param[in] nsec3params NSEC3 parameters * \return const char* str salt in string format * */ const char* nsec3params_salt2str(nsec3params_type* nsec3params); /** * Clean up the NSEC3 parameters. * \param[in] nsec3params the nsec3param to be deleted * */ void nsec3params_cleanup(nsec3params_type* nsec3params); #endif /* SIGNER_NSEC3PARAMS_H */ opendnssec-1.4.3/signer/src/signer/ixfr.c0000664000175000017500000001747612005520472015300 00000000000000/* * $Id: ixfr.c 5260 2011-06-28 14:13:14Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * IXFR Journal. * */ #include "config.h" #include "shared/util.h" #include "signer/ixfr.h" #include "signer/rrset.h" #include "signer/zone.h" static const char* ixfr_str = "journal"; /** * Create a part of ixfr journal. * */ static part_type* part_create(allocator_type* allocator) { part_type* part = NULL; ods_log_assert(allocator); part = (part_type*) allocator_alloc(allocator, sizeof(part_type)); if (!part) { ods_log_error("[%s] unable to create ixfr part: " "allocator_alloc() failed", ixfr_str); return NULL; } part->soaplus = NULL; part->soamin = NULL; part->plus = ldns_rr_list_new(); if (!part->plus) { ods_log_error("[%s] unable to create ixfr part: " "ldns_rr_list_new() failed", ixfr_str); allocator_deallocate(allocator, (void*) part); return NULL; } part->min = ldns_rr_list_new(); if (!part->min) { ods_log_error("[%s] unable to create ixfr part: " "ldns_rr_list_new() failed", ixfr_str); ldns_rr_list_free(part->plus); allocator_deallocate(allocator, (void*) part); return NULL; } return part; } /** * Clean up a part of ixfr journal. * */ static void part_cleanup(allocator_type* allocator, part_type* part) { if (!part || !allocator) { return; } ldns_rr_list_deep_free(part->min); ldns_rr_list_free(part->plus); allocator_deallocate(allocator, (void*) part); return; } /** * Create a new ixfr journal. * */ ixfr_type* ixfr_create(void* zone) { size_t i = 0; ixfr_type* xfr = NULL; zone_type* z = (zone_type*) zone; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->allocator); xfr = (ixfr_type*) allocator_alloc(z->allocator, sizeof(ixfr_type)); if (!xfr) { ods_log_error("[%s] unable to create ixfr for zone %s: " "allocator_alloc() failed", ixfr_str, z->name); return NULL; } for (i=0; i < IXFR_MAX_PARTS; i++) { xfr->part[i] = NULL; } xfr->zone = zone; lock_basic_init(&xfr->ixfr_lock); return xfr; } /** * Add +RR to ixfr journal. * */ void ixfr_add_rr(ixfr_type* ixfr, ldns_rr* rr) { zone_type* zone = NULL; if (!ixfr || !rr) { return; } zone = (zone_type*) ixfr->zone; ods_log_assert(zone); ods_log_assert(zone->db); if (!zone->db->is_initialized) { /* no ixfr yet */ return; } ods_log_assert(ixfr->part[0]); ods_log_assert(ixfr->part[0]->plus); if (!ldns_rr_list_push_rr(ixfr->part[0]->plus, rr)) { ods_fatal_exit("[%s] fatal unable to +RR: ldns_rr_list_push_rr() failed", ixfr_str); } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { ixfr->part[0]->soaplus = rr; } return; } /** * Add -RR to ixfr journal. * */ void ixfr_del_rr(ixfr_type* ixfr, ldns_rr* rr) { zone_type* zone = NULL; if (!ixfr || !rr) { return; } zone = (zone_type*) ixfr->zone; ods_log_assert(zone); ods_log_assert(zone->db); if (!zone->db->is_initialized) { /* no ixfr yet */ return; } ods_log_assert(ixfr->part[0]); ods_log_assert(ixfr->part[0]->min); if (!ldns_rr_list_push_rr(ixfr->part[0]->min, rr)) { ods_fatal_exit("[%s] fatal unable to -RR: ldns_rr_list_push_rr() failed", ixfr_str); } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { ixfr->part[0]->soamin = rr; } return; } /** * Print all RRs in list, except SOA RRs. * */ static int part_rr_list_print_nonsoa(FILE* fd, ldns_rr_list* list) { size_t i = 0; int error = 0; if (!list || !fd) { return 1; } for (i = 0; i < ldns_rr_list_rr_count(list); i++) { if (ldns_rr_get_type(ldns_rr_list_rr(list, i)) != LDNS_RR_TYPE_SOA) { if (util_rr_print(fd, ldns_rr_list_rr(list, i)) != ODS_STATUS_OK) { error = 1; } } } return error; } /** * Print part of the ixfr journal. * */ static void part_print(FILE* fd, ixfr_type* ixfr, size_t i) { zone_type* zone = NULL; part_type* part = NULL; int error = 0; if (!ixfr || !fd) { return; } zone = (zone_type*) ixfr->zone; part = ixfr->part[i]; if (!part) { return; } ods_log_assert(part->min); ods_log_assert(part->plus); ods_log_assert(part->soamin); ods_log_assert(part->soaplus); if (util_rr_print(fd, part->soamin) != ODS_STATUS_OK) { zone->adoutbound->error = 1; } error = part_rr_list_print_nonsoa(fd, part->min); if (error) { zone->adoutbound->error = 1; } if (util_rr_print(fd, part->soaplus) != ODS_STATUS_OK) { zone->adoutbound->error = 1; } error = part_rr_list_print_nonsoa(fd, part->plus); if (error) { zone->adoutbound->error = 1; } return; } /** * Print the ixfr journal. * */ void ixfr_print(FILE* fd, ixfr_type* ixfr) { int i = 0; if (!ixfr || !fd) { return; } ods_log_debug("[%s] print ixfr", ixfr_str); for (i = IXFR_MAX_PARTS - 1; i >= 0; i--) { ods_log_deeebug("[%s] print ixfr part #%d", ixfr_str, i); part_print(fd, ixfr, i); } return; } /** * Purge the ixfr journal. * */ void ixfr_purge(ixfr_type* ixfr) { int i = 0; zone_type* zone = NULL; if (!ixfr) { return; } zone = (zone_type*) ixfr->zone; ods_log_assert(zone); ods_log_assert(zone->allocator); ods_log_debug("[%s] purge ixfr for zone %s", ixfr_str, zone->name); for (i = IXFR_MAX_PARTS - 1; i >= 0; i--) { if (i == (IXFR_MAX_PARTS - 1)) { part_cleanup(zone->allocator, ixfr->part[i]); ixfr->part[i] = NULL; } else { ixfr->part[i+1] = ixfr->part[i]; ixfr->part[i] = NULL; } } ixfr->part[0] = part_create(zone->allocator); if (!ixfr->part[0]) { ods_fatal_exit("[%s] fatal unable to purge ixfr for zone %s: " "part_create() failed", ixfr_str, zone->name); } return; } /** * Cleanup the ixfr journal. * */ void ixfr_cleanup(ixfr_type* ixfr) { int i = 0; zone_type* z = NULL; lock_basic_type ixfr_lock; if (!ixfr) { return; } z = (zone_type*) ixfr->zone; ixfr_lock = ixfr->ixfr_lock; for (i = IXFR_MAX_PARTS - 1; i >= 0; i--) { part_cleanup(z->allocator, ixfr->part[i]); } allocator_deallocate(z->allocator, (void*) ixfr); lock_basic_destroy(&ixfr_lock); return; } opendnssec-1.4.3/signer/src/signer/signconf.c0000664000175000017500000004626412225246663016146 00000000000000/* * $Id: signconf.c 7354 2013-10-09 12:36:03Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signer configuration. * */ #include "parser/signconfparser.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/signconf.h" static const char* sc_str = "signconf"; /** * Create a new signer configuration with the 'empty' settings. * */ signconf_type* signconf_create(void) { signconf_type* sc = NULL; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create signconf: allocator_create() " " failed", sc_str); return NULL; } sc = (signconf_type*) allocator_alloc(allocator, sizeof(signconf_type)); if (!sc) { ods_log_error("[%s] unable to create signconf: allocator_alloc() " " failed", sc_str); allocator_cleanup(allocator); return NULL; } sc->allocator = allocator; sc->filename = NULL; /* Signatures */ sc->sig_resign_interval = NULL; sc->sig_refresh_interval = NULL; sc->sig_validity_default = NULL; sc->sig_validity_denial = NULL; sc->sig_jitter = NULL; sc->sig_inception_offset = NULL; /* Denial of existence */ sc->nsec3param_ttl = NULL; sc->nsec_type = 0; sc->nsec3_optout = 0; sc->nsec3_algo = 0; sc->nsec3_iterations = 0; sc->nsec3_salt = NULL; sc->nsec3params = NULL; /* Keys */ sc->dnskey_ttl = NULL; sc->keys = NULL; /* Source of authority */ sc->soa_ttl = NULL; sc->soa_min = NULL; sc->soa_serial = NULL; /* Other useful information */ sc->last_modified = 0; return sc; } /** * Read signer configuration. * */ static ods_status signconf_read(signconf_type* signconf, const char* scfile) { const char* rngfile = ODS_SE_RNGDIR "/signconf.rng"; ods_status status = ODS_STATUS_OK; FILE* fd = NULL; if (!scfile || !signconf) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] read signconf file %s", sc_str, scfile); status = parse_file_check(scfile, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read signconf: parse error in " "file %s (%s)", sc_str, scfile, ods_status2str(status)); return status; } fd = ods_fopen(scfile, NULL, "r"); if (fd) { signconf->filename = allocator_strdup(signconf->allocator, scfile); signconf->sig_resign_interval = parse_sc_sig_resign_interval(scfile); signconf->sig_refresh_interval = parse_sc_sig_refresh_interval(scfile); signconf->sig_validity_default = parse_sc_sig_validity_default(scfile); signconf->sig_validity_denial = parse_sc_sig_validity_denial(scfile); signconf->sig_jitter = parse_sc_sig_jitter(scfile); signconf->sig_inception_offset = parse_sc_sig_inception_offset(scfile); signconf->nsec_type = parse_sc_nsec_type(scfile); if (signconf->nsec_type == LDNS_RR_TYPE_NSEC3) { signconf->nsec3param_ttl = parse_sc_nsec3param_ttl(scfile); signconf->nsec3_optout = parse_sc_nsec3_optout(scfile); signconf->nsec3_algo = parse_sc_nsec3_algorithm(scfile); signconf->nsec3_iterations = parse_sc_nsec3_iterations(scfile); signconf->nsec3_salt = parse_sc_nsec3_salt(signconf->allocator, scfile); signconf->nsec3params = nsec3params_create((void*) signconf, (uint8_t) signconf->nsec3_algo, (uint8_t) signconf->nsec3_optout, (uint16_t)signconf->nsec3_iterations, signconf->nsec3_salt); if (!signconf->nsec3params) { ods_log_error("[%s] unable to read signconf %s: " "nsec3params_create() failed", sc_str, scfile); ods_fclose(fd); return ODS_STATUS_MALLOC_ERR; } } signconf->keys = parse_sc_keys((void*) signconf, scfile); signconf->dnskey_ttl = parse_sc_dnskey_ttl(scfile); signconf->soa_ttl = parse_sc_soa_ttl(scfile); signconf->soa_min = parse_sc_soa_min(scfile); signconf->soa_serial = parse_sc_soa_serial(signconf->allocator, scfile); ods_fclose(fd); return ODS_STATUS_OK; } ods_log_error("[%s] unable to read signconf: failed to open file %s", sc_str, scfile); return ODS_STATUS_ERR; } /** * Update signer configuration. * */ ods_status signconf_update(signconf_type** signconf, const char* scfile, time_t last_modified) { signconf_type* new_sc = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; if (!scfile || !signconf) { return ODS_STATUS_UNCHANGED; } /* is the file updated? */ st_mtime = ods_file_lastmodified(scfile); if (st_mtime <= last_modified) { return ODS_STATUS_UNCHANGED; } /* if so, read the new signer configuration */ new_sc = signconf_create(); if (!new_sc) { ods_log_error("[%s] unable to update signconf: signconf_create() " "failed", sc_str); return ODS_STATUS_ERR; } status = signconf_read(new_sc, scfile); if (status == ODS_STATUS_OK) { new_sc->last_modified = st_mtime; if (signconf_check(new_sc) != ODS_STATUS_OK) { ods_log_error("[%s] unable to update signconf: signconf %s has " "errors", sc_str, scfile); signconf_cleanup(new_sc); return ODS_STATUS_CFG_ERR; } *signconf = new_sc; } else { ods_log_error("[%s] unable to update signconf: failed to read file " "%s (%s)", sc_str, scfile, ods_status2str(status)); signconf_cleanup(new_sc); } return status; } /** * Backup duration. * */ static void signconf_backup_duration(FILE* fd, const char* opt, duration_type* duration) { char* str = duration2string(duration); fprintf(fd, "%s %s ", opt, str); free((void*) str?str:"(null)"); return; } /** * Backup signconf values. * */ void signconf_backup(FILE* fd, signconf_type* sc, const char* version) { if (!fd || !sc) { return; } fprintf(fd, ";;Signconf: lastmod %u ", (unsigned) sc->last_modified); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) && strcmp(version, ODS_SE_FILE_MAGIC_V1)) { /* version 3 and up */ fprintf(fd, "maxzonettl 0 "); /* prepare for enforcer ng */ } signconf_backup_duration(fd, "resign", sc->sig_resign_interval); signconf_backup_duration(fd, "refresh", sc->sig_refresh_interval); signconf_backup_duration(fd, "valid", sc->sig_validity_default); signconf_backup_duration(fd, "denial", sc->sig_validity_denial); signconf_backup_duration(fd, "jitter", sc->sig_jitter); signconf_backup_duration(fd, "offset", sc->sig_inception_offset); fprintf(fd, "nsec %u ", (unsigned) sc->nsec_type); signconf_backup_duration(fd, "dnskeyttl", sc->dnskey_ttl); signconf_backup_duration(fd, "soattl", sc->soa_ttl); signconf_backup_duration(fd, "soamin", sc->soa_min); fprintf(fd, "serial %s ", sc->soa_serial?sc->soa_serial:"(null)"); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) == 0) { fprintf(fd, "audit 0"); } fprintf(fd, "\n"); return; } /** * Check the SOA/Serial type. * */ static int signconf_soa_serial_check(const char* serial) { if (!serial) { return 1; } if (strlen(serial) == 4 && strncmp(serial, "keep", 4) == 0) { return 0; } if (strlen(serial) == 7 && strncmp(serial, "counter", 7) == 0) { return 0; } if (strlen(serial) == 8 && strncmp(serial, "unixtime", 8) == 0) { return 0; } if (strlen(serial) == 11 && strncmp(serial, "datecounter", 11) == 0) { return 0; } return 1; } /** * Check signer configuration settings. * */ ods_status signconf_check(signconf_type* sc) { ods_status status = ODS_STATUS_OK; if (!sc->sig_resign_interval) { ods_log_error("[%s] check failed: no signature resign interval found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_refresh_interval) { ods_log_error("[%s] check failed: no signature resign interval found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_validity_default) { ods_log_error("[%s] check failed: no signature default validity found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_validity_denial) { ods_log_error("[%s] check failed: no signature denial validity found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_jitter) { ods_log_error("[%s] check failed: no signature jitter found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_inception_offset) { ods_log_error("[%s] check failed: no signature inception offset found", sc_str); status = ODS_STATUS_CFG_ERR; } if (sc->nsec_type == LDNS_RR_TYPE_NSEC3) { if (sc->nsec3_algo != LDNS_SHA1) { ods_log_error("[%s] check failed: invalid nsec3 algorithm", sc_str); status = ODS_STATUS_CFG_ERR; } /* iterations */ /* salt */ /* optout */ } else if (sc->nsec_type != LDNS_RR_TYPE_NSEC) { ods_log_error("[%s] check failed: wrong nsec type %i", sc_str, sc->nsec_type); status = ODS_STATUS_CFG_ERR; } if (!sc->keys || sc->keys->count == 0) { ods_log_error("[%s] check failed: no keys found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->dnskey_ttl) { ods_log_error("[%s] check failed: no dnskey ttl found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->soa_ttl) { ods_log_error("[%s] check failed: no soa ttl found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->soa_min) { ods_log_error("[%s] check failed: no soa minimum found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->soa_serial) { ods_log_error("[%s] check failed: no soa serial type found", sc_str); status = ODS_STATUS_CFG_ERR; } else if (signconf_soa_serial_check(sc->soa_serial) != 0) { ods_log_error("[%s] check failed: wrong soa serial type %s", sc_str, sc->soa_serial); status = ODS_STATUS_CFG_ERR; } return status; } /** * Compare signer configurations on denial of existence material. * */ task_id signconf_compare_denial(signconf_type* a, signconf_type* b) { task_id new_task = TASK_NONE; if (!a || !b) { return TASK_NONE; } ods_log_assert(a); ods_log_assert(b); if (duration_compare(a->soa_min, b->soa_min)) { new_task = TASK_NSECIFY; } else if (a->nsec_type != b->nsec_type) { new_task = TASK_NSECIFY; } else if (a->nsec_type == LDNS_RR_TYPE_NSEC3) { if ((ods_strcmp(a->nsec3_salt, b->nsec3_salt) != 0) || (a->nsec3_algo != b->nsec3_algo) || (a->nsec3_iterations != b->nsec3_iterations) || (a->nsec3_optout != b->nsec3_optout)) { new_task = TASK_NSECIFY; } else if (duration_compare(a->nsec3param_ttl, b->nsec3param_ttl)) { new_task = TASK_READ; } } return new_task; } /** * Print sign configuration. * */ void signconf_print(FILE* out, signconf_type* sc, const char* name) { char* s = NULL; fprintf(out, "\n"); if (sc) { fprintf(out, "\n"); fprintf(out, "\t\n", name?name:"(null)"); /* Signatures */ fprintf(out, "\t\t\n"); s = duration2string(sc->sig_resign_interval); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->sig_refresh_interval); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\t\n"); s = duration2string(sc->sig_validity_default); fprintf(out, "\t\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->sig_validity_denial); fprintf(out, "\t\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\t\n"); s = duration2string(sc->sig_jitter); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->sig_inception_offset); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\n"); fprintf(out, "\n"); /* Denial */ fprintf(out, "\t\t\n"); if (sc->nsec_type == LDNS_RR_TYPE_NSEC) { fprintf(out, "\t\t\t\n"); } else if (sc->nsec_type == LDNS_RR_TYPE_NSEC3) { fprintf(out, "\t\t\t\n"); if (sc->nsec3param_ttl) { s = duration2string(sc->nsec3param_ttl); fprintf(out, "\t\t\t\t%s\n", s?s:"(null)"); free((void*)s); } if (sc->nsec3_optout) { fprintf(out, "\t\t\t\t\n"); } fprintf(out, "\t\t\t\t\n"); fprintf(out, "\t\t\t\t\t%i\n", sc->nsec3_algo); fprintf(out, "\t\t\t\t\t%i\n", sc->nsec3_iterations); fprintf(out, "\t\t\t\t\t%s\n", sc->nsec3_salt?sc->nsec3_salt:"(null)"); fprintf(out, "\t\t\t\t\n"); fprintf(out, "\t\t\t\n"); } fprintf(out, "\t\t\n"); fprintf(out, "\n"); /* Keys */ fprintf(out, "\t\t\n"); s = duration2string(sc->dnskey_ttl); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\n"); keylist_print(out, sc->keys); fprintf(out, "\t\t\n"); fprintf(out, "\n"); /* SOA */ fprintf(out, "\t\t\n"); s = duration2string(sc->soa_ttl); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->soa_min); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\t%s\n", sc->soa_serial?sc->soa_serial:"(null)"); fprintf(out, "\t\t\n"); fprintf(out, "\n"); fprintf(out, "\t\n"); fprintf(out, "\n"); } return; } /** * Log sign configuration. * */ void signconf_log(signconf_type* sc, const char* name) { char* resign = NULL; char* refresh = NULL; char* validity = NULL; char* denial = NULL; char* jitter = NULL; char* offset = NULL; char* dnskeyttl = NULL; char* soattl = NULL; char* soamin = NULL; char* paramttl = NULL; if (sc) { resign = duration2string(sc->sig_resign_interval); refresh = duration2string(sc->sig_refresh_interval); validity = duration2string(sc->sig_validity_default); denial = duration2string(sc->sig_validity_denial); jitter = duration2string(sc->sig_jitter); offset = duration2string(sc->sig_inception_offset); dnskeyttl = duration2string(sc->dnskey_ttl); paramttl = duration2string(sc->nsec3param_ttl); soattl = duration2string(sc->soa_ttl); soamin = duration2string(sc->soa_min); /* signconf */ ods_log_info("[%s] zone %s signconf: RESIGN[%s] REFRESH[%s] " "VALIDITY[%s] DENIAL[%s] JITTER[%s] OFFSET[%s] NSEC[%i] " "DNSKEYTTL[%s] SOATTL[%s] MINIMUM[%s] SERIAL[%s]", sc_str, name?name:"(null)", resign?resign:"(null)", refresh?refresh:"(null)", validity?validity:"(null)", denial?denial:"(null)", jitter?jitter:"(null)", offset?offset:"(null)", (int) sc->nsec_type, dnskeyttl?dnskeyttl:"(null)", soattl?soattl:"(null)", soamin?soamin:"(null)", sc->soa_serial?sc->soa_serial:"(null)"); /* nsec3 parameters */ if (sc->nsec_type == LDNS_RR_TYPE_NSEC3) { ods_log_debug("[%s] zone %s nsec3: PARAMTTL[%s] OPTOUT[%i] " "ALGORITHM[%u] ITERATIONS[%u] SALT[%s]", sc_str, name?name:"(null)", paramttl?paramttl:"PT0S", sc->nsec3_optout, sc->nsec3_algo, sc->nsec3_iterations, sc->nsec3_salt?sc->nsec3_salt:"(null)"); } /* keys */ keylist_log(sc->keys, name); /* cleanup */ free((void*)resign); free((void*)refresh); free((void*)validity); free((void*)denial); free((void*)jitter); free((void*)offset); free((void*)dnskeyttl); free((void*)paramttl); free((void*)soattl); free((void*)soamin); } return; } /** * Clean up signer configuration. * */ void signconf_cleanup(signconf_type* sc) { allocator_type* allocator = NULL; if (!sc) { return; } duration_cleanup(sc->sig_resign_interval); duration_cleanup(sc->sig_refresh_interval); duration_cleanup(sc->sig_validity_default); duration_cleanup(sc->sig_validity_denial); duration_cleanup(sc->sig_jitter); duration_cleanup(sc->sig_inception_offset); duration_cleanup(sc->dnskey_ttl); duration_cleanup(sc->soa_ttl); duration_cleanup(sc->soa_min); keylist_cleanup(sc->keys); nsec3params_cleanup(sc->nsec3params); allocator = sc->allocator; allocator_deallocate(allocator, (void*) sc->filename); allocator_deallocate(allocator, (void*) sc->nsec3_salt); allocator_deallocate(allocator, (void*) sc->soa_serial); allocator_deallocate(allocator, (void*) sc); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/signer/domain.h0000664000175000017500000001227412055134674015605 00000000000000/* * $Id: domain.h 6870 2012-11-27 13:01:48Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Domain. * */ #ifndef SIGNER_DOMAIN_H #define SIGNER_DOMAIN_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "signer/rrset.h" #include #include #define SE_NSEC_RDATA_NXT 0 #define SE_NSEC_RDATA_BITMAP 1 #define SE_NSEC3_RDATA_NSEC3PARAMS 4 #define SE_NSEC3_RDATA_NXT 4 #define SE_NSEC3_RDATA_BITMAP 5 /** * Domain. * */ typedef struct domain_struct domain_type; struct domain_struct { void* zone; void* denial; ldns_rbnode_t* node; ldns_rdf* dname; domain_type* parent; rrset_type* rrsets; unsigned is_new : 1; unsigned is_apex : 1; /* apex */ }; /** * Log domain name. * \param[in] rdf domain name * \param[in] pre log message * \param[in] level log level * */ void log_dname(ldns_rdf* rdf, const char* pre, int level); /** * Create domain. * \param[in] zoneptr zone reference * \param[in] dname owner name * \return domain_type* domain * */ domain_type* domain_create(void* zoneptr, ldns_rdf* dname); /** * Count the number of RRsets at this domain. * \param[in] domain domain * \return size_t number of RRsets * */ size_t domain_count_rrset(domain_type* domain); /** * Count the number of RRsets at this domain with RRs that have is_added. * \param[in] domain domain * \return size_t number of RRsets * */ size_t domain_count_rrset_is_added(domain_type* domain); /** * Look up RRset at this domain. * \param[in] domain the domain * \param[in] rrtype RRtype * \return rrset_type* RRset, if found * */ rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype); /** * Add RRset to domain. * \param[in] domain domain * \param[in] rrset RRset * */ void domain_add_rrset(domain_type* domain, rrset_type* rrset); /** * Delete RRset from domain. * \param[in] domain domain * \param[in] rrtype RRtype of RRset * \return rrset_type* deleted RRset * */ rrset_type* domain_del_rrset(domain_type* domain, ldns_rr_type rrtype); /** * Apply differences at domain. * \param[in] domain domain * \param[in] is_ixfr true if incremental change * \param[in] more_coming more transactions possible * */ void domain_diff(domain_type* domain, unsigned is_ixfr, unsigned more_coming); /** * Rollback differences at domain. * \param[in] domain domain * \param[in] keepsc keep RRs that did not came from the adapter * */ void domain_rollback(domain_type* domain, int keepsc); /** * Check whether a domain is an empty non-terminal to an unsigned delegation. * \param[in] domain domain * \return int yes or no * */ int domain_ent2unsignedns(domain_type* domain); /** * Check whether a domain is a delegation, regardless of parent. * \param[in] domain domain * \return ldns_rr_type RRtype that hints whether the domain is occluded. * LDNS_RR_TYPE_NS Unsigned delegation * LDNS_RR_TYPE_DS Signed delegation * LDNS_RR_TYPE_SOA Authoritative data (or signed delegation) * */ ldns_rr_type domain_is_delegpt(domain_type* domain); /** * Check whether the domain is occluded. * \param[in] domain domain * \return ldns_rr_type RRtype that hints whether the domain is occluded. * LDNS_RR_TYPE_DNAME Occluded * LDNS_RR_TYPE_A Glue * LDNS_RR_TYPE_SOA Authoritative data or delegation * */ ldns_rr_type domain_is_occluded(domain_type* domain); /** * Print domain. * \param[in] fd file descriptor * \param[in] domain domain * \param[out] status status * */ void domain_print(FILE* fd, domain_type* domain, ods_status* status); /** * Clean up domain. * \param[in] domain domain to cleanup * */ void domain_cleanup(domain_type* domain); /** * Backup domain. * \param[in] fd file descriptor * \param[in] domain domain * \param[in] sigs do RRSIGS if true, otherwise do RRset * */ void domain_backup2(FILE* fd, domain_type* domain, int sigs); #endif /* SIGNER_DOMAIN_H */ opendnssec-1.4.3/signer/src/signer/backup.h0000664000175000017500000001032511732103213015560 00000000000000/* * $Id: tools.c 3817 2010-08-27 08:43:00Z matthijs $ * * Copyright (c) 2006-2010 NLNet Labs. 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, 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 ``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 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. * */ /** * Recover from backup. * */ #ifndef SIGNER_BACKUP_H #define SIGNER_BACKUP_H #include "config.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/status.h" #include /** * Read token from backup file. * \param[in] in input file descriptor * \return char* read token * */ char* backup_read_token(FILE* in); /** * Read and match a string from backup file. * \param[in] in input file descriptor * \param[in] str string to match * \return 1 if string was read and matched, 0 otherwise * */ int backup_read_check_str(FILE* in, const char* str); /** * Read a string from backup file. * \param[in] in input file descriptor * \param[out] string storage * \return int 1 on success, 0 otherwise * */ int backup_read_str(FILE* in, const char** str); /** * Read time from backup file. * \param[in] in input file descriptor * \param[out] v time_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_time_t(FILE* in, time_t* v); /** * Read duration from backup file. * \param[in] in input file descriptor * \param[out] v duration storage * \return int 1 on success, 0 otherwise * */ int backup_read_duration(FILE* in, duration_type** v); /** * Read rr type from backup file. * \param[in] in input file descriptor * \param[out] v rr type storage * \return int 1 on success, 0 otherwise * */ int backup_read_rr_type(FILE* in, ldns_rr_type* v); /** * Read integer from backup file. * \param[in] in input file descriptor * \param[out] v integer storage * \return int 1 on success, 0 otherwise * */ int backup_read_int(FILE* in, int* v); /** * Read size type from backup file. * \param[in] in input file descriptor * \param[out] v integer storage * \return int 1 on success, 0 otherwise * */ int backup_read_size_t(FILE* in, size_t* v); /** * Read 8bit unsigned integer from backup file. * \param[in] in input file descriptor * \param[out] v uint8_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_uint8_t(FILE* in, uint8_t* v); /** * Read 16bit unsigned integer from backup file. * \param[in] in input file descriptor * \param[out] v uint16_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_uint16_t(FILE* in, uint16_t* v); /** * Read 32bit unsigned integer from backup file. * \param[in] in input file descriptor * \param[out] v uint32_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_uint32_t(FILE* in, uint32_t* v); /** * Read namedb from backup file. * \param[in] in input file descriptor * \param[in] zone zone reference * \return ods_status status * */ ods_status backup_read_namedb(FILE* in, void* zone); /** * Read ixfr journal from file. * \param[in] in input file descriptor * \param[in] zone zone reference * \return ods_status status * */ ods_status backup_read_ixfr(FILE* in, void* zone); #endif /* SIGNER_BACKUP_H */ opendnssec-1.4.3/signer/src/signer/stats.h0000664000175000017500000000524311622424220015456 00000000000000/* * $Id: stats.h 5410 2011-08-16 08:21:36Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signer statistics. * */ #ifndef SIGNER_STATS_H #define SIGNER_STATS_H #include "shared/locks.h" #include #include #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include /** * Statistics structure. */ typedef struct stats_struct stats_type; struct stats_struct { uint32_t sort_count; time_t sort_time; int sort_done; uint32_t nsec_count; time_t nsec_time; uint32_t sig_count; uint32_t sig_soa_count; uint32_t sig_reuse; time_t sig_time; time_t audit_time; time_t start_time; time_t end_time; lock_basic_type stats_lock; }; /** * Initialize statistics. * \return the initialized stats; * */ stats_type* stats_create(void); /** * Log statistics. * \param[in] stats statistics * \param[in] name zone name * \param[in] nsec_type NSEC or NSEC3 * */ void stats_log(stats_type* stats, const char* name, ldns_rr_type nsec_type); /** * Clear statistics. * \param[in] stats statistics to be cleared * */ void stats_clear(stats_type* stats); /** * Clean up statistics. * \param[in] stats statistics to be deleted * */ void stats_cleanup(stats_type* stats); #endif /* SIGNER_STATS_H */ opendnssec-1.4.3/signer/src/signer/rrset.h0000664000175000017500000001175612055134674015501 00000000000000/* * $Id: rrset.h 6870 2012-11-27 13:01:48Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * RRset. * */ #ifndef SIGNER_RRSET_H #define SIGNER_RRSET_H #include "config.h" #include "shared/status.h" #include "signer/stats.h" #include #include /** * RRSIG. * */ typedef struct rrsig_struct rrsig_type; struct rrsig_struct { ldns_rr* rr; void* owner; const char* key_locator; uint32_t key_flags; }; /** * RR. * */ typedef struct rr_struct rr_type; struct rr_struct { ldns_rr* rr; void* owner; unsigned exists : 1; unsigned is_added : 1; unsigned is_removed : 1; }; /** * RRset. * */ typedef struct rrset_struct rrset_type; struct rrset_struct { rrset_type* next; void* zone; void* domain; ldns_rr_type rrtype; rr_type* rrs; rrsig_type* rrsigs; size_t rr_count; size_t rrsig_count; unsigned needs_signing : 1; }; /** * Log RR. * \param[in] rr RR * \param[in] pre log message * \param[in] level log level * */ void log_rr(ldns_rr* rr, const char* pre, int level); /** * Log RRset. * \param[in] dname domain name * \param[in] type RRtype * \param[in] pre log message * \param[in] level log level * */ void log_rrset(ldns_rdf* dname, ldns_rr_type type, const char* pre, int level); /** * Get the string-format of RRtype. * \param[in] type RRtype * \return const char* string-format of RRtype * */ const char* rrset_type2str(ldns_rr_type type); /** * Create RRset. * \param[in] zoneptr zone reference * \param[in] type RRtype * \return rrset_type* RRset * */ rrset_type* rrset_create(void* zoneptr, ldns_rr_type type); /** * Lookup RR in RRset. * \param[in] rrset RRset * \param[in] rr RR * \return rr_type* RR if found * */ rr_type* rrset_lookup_rr(rrset_type* rrset, ldns_rr* rr); /** * Count the number of RRs in this RRset that have is_added. * \param[in] rrset RRset * \return size_t number of RRs * */ size_t rrset_count_rr_is_added(rrset_type* rrset); /** * Add RR to RRset. * \param[in] rrset RRset * \param[in] rr RR * \return rr_type* added RR * */ rr_type* rrset_add_rr(rrset_type* rrset, ldns_rr* rr); /** * Delete RR from RRset. * \param[in] rrset RRset * \param[in] rrnum position of RR * */ void rrset_del_rr(rrset_type* rrset, uint16_t rrnum); /** * Add RRSIG to RRset. * \param[in] rrset RRset * \param[in] rr RRSIG * \param[in] locator key locator * \param[in] flags key flags * \return rr_type* added RRSIG * */ rrsig_type* rrset_add_rrsig(rrset_type* rrset, ldns_rr* rr, const char* locator, uint32_t flags); /** * Delete RRSIG from RRset. * \param[in] rrset RRset * \param[in] rrnum position of RRSIG * */ void rrset_del_rrsig(rrset_type* rrset, uint16_t rrnum); /** * Apply differences at RRset. * \param[in] rrset RRset * \param[in] is_ixfr true if incremental change * \param[in] more_coming more transactions possible * */ void rrset_diff(rrset_type* rrset, unsigned is_ixfr, unsigned more_coming); /** * Sign RRset. * \param[in] ctx HSM context * \param[in] rrset RRset * \param[in] signtime time when the zone is being signed * \return ods_status status * */ ods_status rrset_sign(hsm_ctx_t* ctx, rrset_type* rrset, time_t signtime); /** * Print RRset. * \param[in] fd file descriptor * \param[in] rrset RRset to be printed * \param[in] skip_rrsigs if true, don't print RRSIG records * \param[out] status status * */ void rrset_print(FILE* fd, rrset_type* rrset, int skip_rrsigs, ods_status* status); /** * Clean up RRset. * \param[in] rrset RRset to be cleaned up * */ void rrset_cleanup(rrset_type* rrset); /** * Backup RRset. * \param[in] fd file descriptor * \param[in] rrset RRset * */ void rrset_backup2(FILE* fd, rrset_type* rrset); #endif /* SIGNER_RRSET_H */ opendnssec-1.4.3/signer/src/signer/zone.c0000664000175000017500000010770312225763434015307 00000000000000/* * $Id: zone.c 7359 2013-10-11 11:55:08Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone. * */ #include "adapter/adapter.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/hsm.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/zone.h" #include "wire/netio.h" #include static const char* zone_str = "zone"; /** * Create a new zone. * */ zone_type* zone_create(char* name, ldns_rr_class klass) { allocator_type* allocator = NULL; zone_type* zone = NULL; if (!name || !klass) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create zone %s: allocator_create() " "failed", zone_str, name); return NULL; } zone = (zone_type*) allocator_alloc(allocator, sizeof(zone_type)); if (!zone) { ods_log_error("[%s] unable to create zone %s: allocator_alloc()", "failed", zone_str, name); allocator_cleanup(allocator); return NULL; } zone->allocator = allocator; /* [start] PS 9218653: Drop trailing dot in domain name */ if (strlen(name) > 1 && name[strlen(name)-1] == '.') { name[strlen(name)-1] = '\0'; } /* [end] PS 9218653 */ zone->name = allocator_strdup(allocator, name); if (!zone->name) { ods_log_error("[%s] unable to create zone %s: allocator_strdup() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->klass = klass; zone->default_ttl = 3600; /* TODO: configure --default-ttl option? */ zone->apex = ldns_dname_new_frm_str(name); /* check zone->apex? */ zone->notify_command = NULL; zone->notify_ns = NULL; zone->notify_args = NULL; zone->policy_name = NULL; zone->signconf_filename = NULL; zone->adinbound = NULL; zone->adoutbound = NULL; zone->zl_status = ZONE_ZL_OK; zone->task = NULL; zone->xfrd = NULL; zone->notify = NULL; zone->db = namedb_create((void*)zone); if (!zone->db) { ods_log_error("[%s] unable to create zone %s: namedb_create() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->ixfr = ixfr_create((void*)zone); if (!zone->ixfr) { ods_log_error("[%s] unable to create zone %s: ixfr_create() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->signconf = signconf_create(); if (!zone->signconf) { ods_log_error("[%s] unable to create zone %s: signconf_create() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->stats = stats_create(); lock_basic_init(&zone->zone_lock); lock_basic_init(&zone->xfr_lock); return zone; } /** * Load signer configuration for zone. * */ ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf) { ods_status status = ODS_STATUS_OK; signconf_type* signconf = NULL; char* datestamp = NULL; if (!zone || !zone->name || !zone->signconf) { return ODS_STATUS_ASSERT_ERR; } if (!zone->signconf_filename) { ods_log_warning("[%s] zone %s has no signconf filename, treat as " "insecure?", zone_str, zone->name); return ODS_STATUS_INSECURE; } status = signconf_update(&signconf, zone->signconf_filename, zone->signconf->last_modified); if (status == ODS_STATUS_OK) { if (!signconf) { /* this is unexpected */ ods_log_alert("[%s] unable to load signconf for zone %s: signconf " "status ok but no signconf stored", zone_str, zone->name); return ODS_STATUS_ASSERT_ERR; } (void)time_datestamp(signconf->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_debug("[%s] zone %s signconf file %s is modified since %s", zone_str, zone->name, zone->signconf_filename, datestamp?datestamp:"Unknown"); free((void*)datestamp); *new_signconf = signconf; } else if (status == ODS_STATUS_UNCHANGED) { (void)time_datestamp(zone->signconf->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_verbose("[%s] zone %s signconf file %s is unchanged since " "%s", zone_str, zone->name, zone->signconf_filename, datestamp?datestamp:"Unknown"); free((void*)datestamp); } else { ods_log_error("[%s] unable to load signconf for zone %s: signconf %s " "%s", zone_str, zone->name, zone->signconf_filename, ods_status2str(status)); } return status; } /** * Reschedule task for zone. * */ ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq, task_id what) { task_type* task = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(taskq); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->task); ods_log_debug("[%s] reschedule task for zone %s", zone_str, zone->name); lock_basic_lock(&taskq->schedule_lock); task = unschedule_task(taskq, (task_type*) zone->task); if (task != NULL) { if (task->what != what) { task->halted = task->what; task->halted_when = task->when; task->interrupt = what; } /** Only reschedule if what to do is lower than what was scheduled. */ if (task->what > what) { task->what = what; } task->when = time_now(); status = schedule_task(taskq, task, 0); } else { /* task not queued, being worked on? */ ods_log_verbose("[%s] unable to reschedule task for zone %s now: " "task is not queued (task will be rescheduled when it is put " "back on the queue)", zone_str, zone->name); task = (task_type*) zone->task; task->interrupt = what; /* task->halted(_when) set by worker */ } lock_basic_unlock(&taskq->schedule_lock); zone->task = task; return status; } /** * Publish the keys as indicated by the signer configuration. * */ ods_status zone_publish_dnskeys(zone_type* zone) { hsm_ctx_t* ctx = NULL; uint32_t ttl = 0; uint16_t i = 0; ods_status status = ODS_STATUS_OK; rrset_type* rrset = NULL; rr_type* dnskey = NULL; if (!zone || !zone->db || !zone->signconf || !zone->signconf->keys) { return ODS_STATUS_ASSERT_ERR; } ods_log_assert(zone->name); /* hsm access */ ctx = hsm_create_context(); if (ctx == NULL) { ods_log_error("[%s] unable to publish keys for zone %s: " "error creating libhsm context", zone_str, zone->name); return ODS_STATUS_HSM_ERR; } /* dnskey ttl */ ttl = zone->default_ttl; if (zone->signconf->dnskey_ttl) { ttl = (uint32_t) duration2time(zone->signconf->dnskey_ttl); } /* publish keys */ for (i=0; i < zone->signconf->keys->count; i++) { if (!zone->signconf->keys->keys[i].publish) { continue; } if (!zone->signconf->keys->keys[i].dnskey) { /* get dnskey */ status = lhsm_get_key(ctx, zone->apex, &zone->signconf->keys->keys[i]); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to publish dnskeys for zone %s: " "error creating dnskey", zone_str, zone->name); break; } } ods_log_assert(zone->signconf->keys->keys[i].dnskey); ldns_rr_set_ttl(zone->signconf->keys->keys[i].dnskey, ttl); ldns_rr_set_class(zone->signconf->keys->keys[i].dnskey, zone->klass); status = zone_add_rr(zone, zone->signconf->keys->keys[i].dnskey, 0); if (status == ODS_STATUS_UNCHANGED) { /* rr already exists, adjust pointer */ rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_DNSKEY); ods_log_assert(rrset); dnskey = rrset_lookup_rr(rrset, zone->signconf->keys->keys[i].dnskey); ods_log_assert(dnskey); if (dnskey->rr != zone->signconf->keys->keys[i].dnskey) { ldns_rr_free(zone->signconf->keys->keys[i].dnskey); } zone->signconf->keys->keys[i].dnskey = dnskey->rr; status = ODS_STATUS_OK; } else if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to publish dnskeys for zone %s: " "error adding dnskey", zone_str, zone->name); break; } } /* done */ hsm_destroy_context(ctx); return status; } /** * Unlink DNSKEY RRs. * */ void zone_rollback_dnskeys(zone_type* zone) { uint16_t i = 0; rrset_type* rrset = NULL; rr_type* dnskey = NULL; if (!zone || !zone->signconf || !zone->signconf->keys) { return; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_DNSKEY); /* unlink dnskey rrs */ for (i=0; i < zone->signconf->keys->count; i++) { if (rrset && zone->signconf->keys->keys[i].dnskey) { dnskey = rrset_lookup_rr(rrset, zone->signconf->keys->keys[i].dnskey); if (dnskey && !dnskey->exists && dnskey->rr == zone->signconf->keys->keys[i].dnskey) { zone->signconf->keys->keys[i].dnskey = NULL; } } } /* done */ return; } /** * Publish the NSEC3 parameters as indicated by the signer configuration. * */ ods_status zone_publish_nsec3param(zone_type* zone) { rrset_type* rrset = NULL; rr_type* n3prr = NULL; ldns_rr* rr = NULL; ods_status status = ODS_STATUS_OK; if (!zone || !zone->name || !zone->db || !zone->signconf) { return ODS_STATUS_ASSERT_ERR; } if (!zone->signconf->nsec3params) { /* NSEC */ ods_log_assert(zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC); return ODS_STATUS_OK; } if (!zone->signconf->nsec3params->rr) { uint32_t paramttl = (uint32_t) duration2time(zone->signconf->nsec3param_ttl); rr = ldns_rr_new_frm_type(LDNS_RR_TYPE_NSEC3PARAMS); if (!rr) { ods_log_error("[%s] unable to publish nsec3params for zone %s: " "error creating rr (%s)", zone_str, zone->name, ods_status2str(status)); return ODS_STATUS_MALLOC_ERR; } ldns_rr_set_class(rr, zone->klass); ldns_rr_set_ttl(rr, paramttl); ldns_rr_set_owner(rr, ldns_rdf_clone(zone->apex)); ldns_nsec3_add_param_rdfs(rr, zone->signconf->nsec3params->algorithm, 0, zone->signconf->nsec3params->iterations, zone->signconf->nsec3params->salt_len, zone->signconf->nsec3params->salt_data); /** * Always set bit 7 of the flags to zero, * according to rfc5155 section 11 */ ldns_set_bit(ldns_rdf_data(ldns_rr_rdf(rr, 1)), 7, 0); zone->signconf->nsec3params->rr = rr; } ods_log_assert(zone->signconf->nsec3params->rr); status = zone_add_rr(zone, zone->signconf->nsec3params->rr, 0); if (status == ODS_STATUS_UNCHANGED) { /* rr already exists, adjust pointer */ rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_NSEC3PARAMS); ods_log_assert(rrset); n3prr = rrset_lookup_rr(rrset, zone->signconf->nsec3params->rr); ods_log_assert(n3prr); if (n3prr->rr != zone->signconf->nsec3params->rr) { ldns_rr_free(zone->signconf->nsec3params->rr); } zone->signconf->nsec3params->rr = n3prr->rr; status = ODS_STATUS_OK; } else if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to publish nsec3params for zone %s: " "error adding nsec3params (%s)", zone_str, zone->name, ods_status2str(status)); } return status; } /** * Unlink NSEC3PARAM RR. * */ void zone_rollback_nsec3param(zone_type* zone) { rrset_type* rrset = NULL; rr_type* n3prr = NULL; if (!zone || !zone->signconf || !zone->signconf->nsec3params) { return; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_NSEC3PARAMS); if (rrset && zone->signconf->nsec3params->rr) { n3prr = rrset_lookup_rr(rrset, zone->signconf->nsec3params->rr); if (n3prr && !n3prr->exists && n3prr->rr == zone->signconf->nsec3params->rr) { zone->signconf->nsec3params->rr = NULL; } } return; } /** * Prepare keys for signing. * */ ods_status zone_prepare_keys(zone_type* zone) { hsm_ctx_t* ctx = NULL; uint16_t i = 0; ods_status status = ODS_STATUS_OK; if (!zone || !zone->db || !zone->signconf || !zone->signconf->keys) { return ODS_STATUS_ASSERT_ERR; } ods_log_assert(zone->name); /* hsm access */ ctx = hsm_create_context(); if (ctx == NULL) { ods_log_error("[%s] unable to prepare signing keys for zone %s: " "error creating libhsm context", zone_str, zone->name); return ODS_STATUS_HSM_ERR; } /* prepare keys */ for (i=0; i < zone->signconf->keys->count; i++) { /* get dnskey */ status = lhsm_get_key(ctx, zone->apex, &zone->signconf->keys->keys[i]); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to prepare signing keys for zone %s: " "error getting dnskey", zone_str, zone->name); break; } ods_log_assert(zone->signconf->keys->keys[i].dnskey); ods_log_assert(zone->signconf->keys->keys[i].hsmkey); ods_log_assert(zone->signconf->keys->keys[i].params); } /* done */ hsm_destroy_context(ctx); return status; } /** * Update serial. * */ ods_status zone_update_serial(zone_type* zone) { ods_status status = ODS_STATUS_OK; rrset_type* rrset = NULL; rr_type* soa = NULL; ldns_rr* rr = NULL; ldns_rdf* soa_rdata = NULL; ods_log_assert(zone); ods_log_assert(zone->apex); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); if (zone->db->serial_updated) { /* already done, unmark and return ok */ ods_log_debug("[%s] zone %s soa serial already up to date", zone_str, zone->name); zone->db->serial_updated = 0; return ODS_STATUS_OK; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); ods_log_assert(rrset->rrs); ods_log_assert(rrset->rrs[0].rr); rr = ldns_rr_clone(rrset->rrs[0].rr); if (!rr) { ods_log_error("[%s] unable to update zone %s soa serial: failed to " "clone soa rr", zone_str, zone->name); return ODS_STATUS_ERR; } status = namedb_update_serial(zone->db, zone->name, zone->signconf->soa_serial, zone->db->inbserial); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to update zone %s soa serial: %s", zone_str, zone->name, ods_status2str(status)); if (status == ODS_STATUS_CONFLICT_ERR) { ods_log_error("[%s] If this is the result of a key rollover, " "please increment the serial in the unsigned zone %s", zone_str, zone->name); } ldns_rr_free(rr); return status; } ods_log_verbose("[%s] zone %s set soa serial to %u", zone_str, zone->name, zone->db->intserial); soa_rdata = ldns_rr_set_rdf(rr, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, zone->db->intserial), SE_SOA_RDATA_SERIAL); if (soa_rdata) { ldns_rdf_deep_free(soa_rdata); soa_rdata = NULL; } else { ods_log_error("[%s] unable to update zone %s soa serial: failed to " "replace soa serial rdata", zone_str, zone->name); ldns_rr_free(rr); return ODS_STATUS_ERR; } soa = rrset_add_rr(rrset, rr); ods_log_assert(soa); rrset_diff(rrset, 0, 0); zone->db->serial_updated = 0; return ODS_STATUS_OK; } /** * Lookup RRset. * */ rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner, ldns_rr_type type) { domain_type* domain = NULL; if (!zone || !owner || !type) { return NULL; } domain = namedb_lookup_domain(zone->db, owner); if (!domain) { return NULL; } return domain_lookup_rrset(domain, type); } /** * Add RR. * */ ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats) { domain_type* domain = NULL; rrset_type* rrset = NULL; rr_type* record = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); /* If we already have this RR, return ODS_STATUS_UNCHANGED */ domain = namedb_lookup_domain(zone->db, ldns_rr_owner(rr)); if (!domain) { domain = namedb_add_domain(zone->db, ldns_rr_owner(rr)); if (!domain) { ods_log_error("[%s] unable to add RR to zone %s: " "failed to add domain", zone_str, zone->name); return ODS_STATUS_ERR; } if (ldns_dname_compare(domain->dname, zone->apex) == 0) { domain->is_apex = 1; } else { status = namedb_domain_entize(zone->db, domain, zone->apex); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to add RR to zone %s: " "failed to entize domain", zone_str, zone->name); return ODS_STATUS_ERR; } } } rrset = domain_lookup_rrset(domain, ldns_rr_get_type(rr)); if (!rrset) { rrset = rrset_create(domain->zone, ldns_rr_get_type(rr)); if (!rrset) { ods_log_error("[%s] unable to add RR to zone %s: " "failed to add RRset", zone_str, zone->name); return ODS_STATUS_ERR; } domain_add_rrset(domain, rrset); } record = rrset_lookup_rr(rrset, rr); if (record) { record->is_added = 1; /* already exists, just mark added */ record->is_removed = 0; /* unset is_removed */ if (ldns_rr_ttl(rr) != ldns_rr_ttl(record->rr)) { ldns_rr_set_ttl(record->rr, ldns_rr_ttl(rr)); rrset->needs_signing = 1; } return ODS_STATUS_UNCHANGED; } else { record = rrset_add_rr(rrset, rr); ods_log_assert(record); ods_log_assert(record->rr); ods_log_assert(record->is_added); } /* update stats */ if (do_stats && zone->stats) { zone->stats->sort_count += 1; } return ODS_STATUS_OK; } /** * Delete RR. * */ ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats) { domain_type* domain = NULL; rrset_type* rrset = NULL; rr_type* record = NULL; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); domain = namedb_lookup_domain(zone->db, ldns_rr_owner(rr)); if (!domain) { ods_log_warning("[%s] unable to delete RR from zone %s: " "domain not found", zone_str, zone->name); return ODS_STATUS_UNCHANGED; } rrset = domain_lookup_rrset(domain, ldns_rr_get_type(rr)); if (!rrset) { ods_log_warning("[%s] unable to delete RR from zone %s: " "RRset not found", zone_str, zone->name); return ODS_STATUS_UNCHANGED; } record = rrset_lookup_rr(rrset, rr); if (!record) { ods_log_error("[%s] unable to delete RR from zone %s: " "RR not found", zone_str, zone->name); return ODS_STATUS_UNCHANGED; } record->is_removed = 1; record->is_added = 0; /* unset is_added */ /* update stats */ if (do_stats && zone->stats) { zone->stats->sort_count -= 1; } return ODS_STATUS_OK; } /** * Merge zones. * */ void zone_merge(zone_type* z1, zone_type* z2) { const char* str; adapter_type* adtmp = NULL; if (!z1 || !z2) { return; } /* policy name */ if (ods_strcmp(z2->policy_name, z1->policy_name) != 0) { if (z2->policy_name) { str = strdup(z2->policy_name); if (!str) { ods_log_error("[%s] failed to merge policy %s name to zone " "%s", zone_str, z2->policy_name, z1->name); } else { free((void*)z1->policy_name); z1->policy_name = str; z1->zl_status = ZONE_ZL_UPDATED; } } else { free((void*)z1->policy_name); z1->policy_name = NULL; z1->zl_status = ZONE_ZL_UPDATED; } } /* signconf filename */ if (ods_strcmp(z2->signconf_filename, z1->signconf_filename) != 0) { if (z2->signconf_filename) { str = strdup(z2->signconf_filename); if (!str) { ods_log_error("[%s] failed to merge signconf filename %s to " "zone %s", zone_str, z2->policy_name, z1->name); } else { free((void*)z1->signconf_filename); z1->signconf_filename = str; z1->zl_status = ZONE_ZL_UPDATED; } } else { free((void*)z1->signconf_filename); z1->signconf_filename = NULL; z1->zl_status = ZONE_ZL_UPDATED; } } /* adapters */ if (adapter_compare(z2->adinbound, z1->adinbound) != 0) { adtmp = z2->adinbound; z2->adinbound = z1->adinbound; z1->adinbound = adtmp; adtmp = NULL; } if (adapter_compare(z2->adoutbound, z1->adoutbound) != 0) { adtmp = z2->adoutbound; z2->adoutbound = z1->adoutbound; z1->adoutbound = adtmp; adtmp = NULL; } return; } /** * Clean up zone. * */ void zone_cleanup(zone_type* zone) { allocator_type* allocator; lock_basic_type zone_lock; lock_basic_type xfr_lock; if (!zone) { return; } allocator = zone->allocator; zone_lock = zone->zone_lock; xfr_lock = zone->xfr_lock; ldns_rdf_deep_free(zone->apex); adapter_cleanup(zone->adinbound); adapter_cleanup(zone->adoutbound); namedb_cleanup(zone->db); ixfr_cleanup(zone->ixfr); xfrd_cleanup(zone->xfrd); notify_cleanup(zone->notify); signconf_cleanup(zone->signconf); stats_cleanup(zone->stats); allocator_deallocate(allocator, (void*) zone->notify_command); allocator_deallocate(allocator, (void*) zone->notify_args); allocator_deallocate(allocator, (void*) zone->policy_name); allocator_deallocate(allocator, (void*) zone->signconf_filename); allocator_deallocate(allocator, (void*) zone->name); allocator_deallocate(allocator, (void*) zone); allocator_cleanup(allocator); lock_basic_destroy(&xfr_lock); lock_basic_destroy(&zone_lock); return; } /** * Recover zone from backup. * */ ods_status zone_recover2(zone_type* zone) { char* filename = NULL; FILE* fd = NULL; const char* token = NULL; time_t when = 0; task_type* task = NULL; ods_status status = ODS_STATUS_OK; /* zone part */ int klass = 0; uint32_t inbound = 0, internal = 0, outbound = 0; /* signconf part */ time_t lastmod = 0; /* nsec3params part */ const char* salt = NULL; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->signconf); ods_log_assert(zone->db); filename = ods_build_path(zone->name, ".backup2", 0, 1); if (!filename) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(filename, NULL, "r"); if (fd) { /* start recovery */ if (!backup_read_check_str(fd, ODS_SE_FILE_MAGIC_V3)) { ods_log_error("[%s] corrupted backup file zone %s: read magic " "error", zone_str, zone->name); goto recover_error2; } if (!backup_read_check_str(fd, ";;Time:") | !backup_read_time_t(fd, &when)) { ods_log_error("[%s] corrupted backup file zone %s: read time " "error", zone_str, zone->name); goto recover_error2; } /* zone stuff */ if (!backup_read_check_str(fd, ";;Zone:") | !backup_read_check_str(fd, "name") | !backup_read_check_str(fd, zone->name)) { ods_log_error("[%s] corrupted backup file zone %s: read name " "error", zone_str, zone->name); goto recover_error2; } if (!backup_read_check_str(fd, "class") | !backup_read_int(fd, &klass)) { ods_log_error("[%s] corrupted backup file zone %s: read class " "error", zone_str, zone->name); goto recover_error2; } if (!backup_read_check_str(fd, "inbound") | !backup_read_uint32_t(fd, &inbound) | !backup_read_check_str(fd, "internal") | !backup_read_uint32_t(fd, &internal) | !backup_read_check_str(fd, "outbound") | !backup_read_uint32_t(fd, &outbound)) { ods_log_error("[%s] corrupted backup file zone %s: read serial " "error", zone_str, zone->name); goto recover_error2; } zone->klass = (ldns_rr_class) klass; zone->db->inbserial = inbound; zone->db->intserial = internal; zone->db->outserial = outbound; /* signconf part */ if (!backup_read_check_str(fd, ";;Signconf:") | !backup_read_check_str(fd, "lastmod") | !backup_read_time_t(fd, &lastmod) | !backup_read_check_str(fd, "maxzonettl") | !backup_read_check_str(fd, "0") | !backup_read_check_str(fd, "resign") | !backup_read_duration(fd, &zone->signconf->sig_resign_interval) | !backup_read_check_str(fd, "refresh") | !backup_read_duration(fd, &zone->signconf->sig_refresh_interval) | !backup_read_check_str(fd, "valid") | !backup_read_duration(fd, &zone->signconf->sig_validity_default) | !backup_read_check_str(fd, "denial") | !backup_read_duration(fd,&zone->signconf->sig_validity_denial) | !backup_read_check_str(fd, "jitter") | !backup_read_duration(fd, &zone->signconf->sig_jitter) | !backup_read_check_str(fd, "offset") | !backup_read_duration(fd, &zone->signconf->sig_inception_offset) | !backup_read_check_str(fd, "nsec") | !backup_read_rr_type(fd, &zone->signconf->nsec_type) | !backup_read_check_str(fd, "dnskeyttl") | !backup_read_duration(fd, &zone->signconf->dnskey_ttl) | !backup_read_check_str(fd, "soattl") | !backup_read_duration(fd, &zone->signconf->soa_ttl) | !backup_read_check_str(fd, "soamin") | !backup_read_duration(fd, &zone->signconf->soa_min) | !backup_read_check_str(fd, "serial") | !backup_read_str(fd, &zone->signconf->soa_serial)) { ods_log_error("[%s] corrupted backup file zone %s: read signconf " "error", zone_str, zone->name); goto recover_error2; } /* nsec3params part */ if (zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC3) { if (!backup_read_check_str(fd, ";;Nsec3parameters:") | !backup_read_check_str(fd, "salt") | !backup_read_str(fd, &salt) | !backup_read_check_str(fd, "algorithm") | !backup_read_uint32_t(fd, &zone->signconf->nsec3_algo) | !backup_read_check_str(fd, "optout") | !backup_read_int(fd, &zone->signconf->nsec3_optout) | !backup_read_check_str(fd, "iterations") | !backup_read_uint32_t(fd, &zone->signconf->nsec3_iterations)) { ods_log_error("[%s] corrupted backup file zone %s: read " "nsec3parameters error", zone_str, zone->name); goto recover_error2; } zone->signconf->nsec3_salt = allocator_strdup( zone->signconf->allocator, salt); free((void*) salt); salt = NULL; zone->signconf->nsec3params = nsec3params_create( (void*) zone->signconf, (uint8_t) zone->signconf->nsec3_algo, (uint8_t) zone->signconf->nsec3_optout, (uint16_t) zone->signconf->nsec3_iterations, zone->signconf->nsec3_salt); if (!zone->signconf->nsec3params) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "create nsec3param", zone_str, zone->name); goto recover_error2; } } zone->signconf->last_modified = lastmod; zone->default_ttl = (uint32_t) duration2time(zone->signconf->soa_min); /* keys part */ zone->signconf->keys = keylist_create((void*) zone->signconf); while (backup_read_str(fd, &token)) { if (ods_strcmp(token, ";;Key:") == 0) { if (!key_recover2(fd, zone->signconf->keys)) { ods_log_error("[%s] corrupted backup file zone %s: read " "key error", zone_str, zone->name); goto recover_error2; } } else if (ods_strcmp(token, ";;") == 0) { /* keylist done */ free((void*) token); token = NULL; break; } else { /* keylist corrupted */ goto recover_error2; } free((void*) token); token = NULL; } /* publish dnskeys */ status = zone_publish_dnskeys(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "publish dnskeys (%s)", zone_str, zone->name, ods_status2str(status)); goto recover_error2; } /* publish nsec3param */ status = zone_publish_nsec3param(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "publish nsec3param (%s)", zone_str, zone->name, ods_status2str(status)); goto recover_error2; } /* publish other records */ status = backup_read_namedb(fd, zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "read resource records (%s)", zone_str, zone->name, ods_status2str(status)); goto recover_error2; } /* task */ task = task_create(TASK_SIGN, when, (void*) zone); if (!task) { ods_log_error("[%s] failed to restore zone %s: unable to " "create task", zone_str, zone->name); goto recover_error2; } zone->task = (void*) task; free((void*)filename); ods_fclose(fd); zone->db->is_initialized = 1; zone->db->have_serial = 1; /* journal */ filename = ods_build_path(zone->name, ".ixfr", 0, 1); if (filename) { fd = ods_fopen(filename, NULL, "r"); } if (fd) { status = backup_read_ixfr(fd, zone); if (status != ODS_STATUS_OK) { ods_log_warning("[%s] corrupted journal file zone %s, " "skipping (%s)", zone_str, zone->name, ods_status2str(status)); (void)unlink(filename); ixfr_cleanup(zone->ixfr); zone->ixfr = ixfr_create((void*)zone); } } lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_purge(zone->ixfr); lock_basic_unlock(&zone->ixfr->ixfr_lock); /* all ok */ free((void*)filename); ods_fclose(fd); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); } return ODS_STATUS_OK; } return ODS_STATUS_UNCHANGED; recover_error2: free((void*)filename); ods_fclose(fd); /* signconf cleanup */ free((void*)salt); salt = NULL; signconf_cleanup(zone->signconf); zone->signconf = signconf_create(); ods_log_assert(zone->signconf); /* namedb cleanup */ namedb_cleanup(zone->db); zone->db = namedb_create((void*)zone); ods_log_assert(zone->db); /* stats reset */ if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); } return ODS_STATUS_ERR; } /** * Backup zone. * */ ods_status zone_backup2(zone_type* zone) { char* filename = NULL; char* tmpfile = NULL; FILE* fd = NULL; task_type* task = NULL; int ret = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); ods_log_assert(zone->task); tmpfile = ods_build_path(zone->name, ".backup2.tmp", 0, 1); filename = ods_build_path(zone->name, ".backup2", 0, 1); if (!tmpfile || !filename) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(tmpfile, NULL, "w"); if (fd) { fprintf(fd, "%s\n", ODS_SE_FILE_MAGIC_V3); task = (task_type*) zone->task; fprintf(fd, ";;Time: %u\n", (unsigned) task->when); /** Backup zone */ fprintf(fd, ";;Zone: name %s class %i inbound %u internal %u " "outbound %u\n", zone->name, (int) zone->klass, (unsigned) zone->db->inbserial, (unsigned) zone->db->intserial, (unsigned) zone->db->outserial); /** Backup signconf */ signconf_backup(fd, zone->signconf, ODS_SE_FILE_MAGIC_V3); /** Backup NSEC3 parameters */ if (zone->signconf->nsec3params) { nsec3params_backup(fd, zone->signconf->nsec3_algo, zone->signconf->nsec3_optout, zone->signconf->nsec3_iterations, zone->signconf->nsec3_salt, zone->signconf->nsec3params->rr, ODS_SE_FILE_MAGIC_V3); } /** Backup keylist */ keylist_backup(fd, zone->signconf->keys, ODS_SE_FILE_MAGIC_V3); fprintf(fd, ";;\n"); /** Backup domains and stuff */ namedb_backup2(fd, zone->db); /** Done */ fprintf(fd, "%s\n", ODS_SE_FILE_MAGIC_V3); ods_fclose(fd); ret = rename(tmpfile, filename); if (ret != 0) { ods_log_error("[%s] unable to rename zone %s backup %s to %s: %s", zone_str, zone->name, tmpfile, filename, strerror(errno)); status = ODS_STATUS_RENAME_ERR; } } else { status = ODS_STATUS_FOPEN_ERR; } free((void*) tmpfile); free((void*) filename); return status; } opendnssec-1.4.3/signer/src/signer/keys.c0000664000175000017500000002020711763141520015270 00000000000000/* * $Id: keys.c 6376 2012-06-04 14:16:48Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signing keys. * */ #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/keys.h" #include "signer/signconf.h" static const char* key_str = "keys"; /** * Create a new key list. * */ keylist_type* keylist_create(void* sc) { signconf_type* signconf = (signconf_type*) sc; keylist_type* kl = NULL; if (!signconf || !signconf->allocator) { return NULL; } kl = (keylist_type*) allocator_alloc(signconf->allocator, sizeof(keylist_type)); if (!kl) { ods_log_error("[%s] create list failed: allocator_alloc() failed", key_str); return NULL; } kl->sc = sc; kl->count = 0; kl->keys = NULL; return kl; } /** * Lookup a key in the key list by locator. * */ key_type* keylist_lookup_by_locator(keylist_type* kl, const char* locator) { uint16_t i = 0; if (!kl || !locator || kl->count <= 0) { return NULL; } for (i=0; i < kl->count; i++) { if (&kl->keys[i] && kl->keys[i].locator) { if (ods_strcmp(kl->keys[i].locator, locator) == 0) { return &kl->keys[i]; } } } return NULL; } /** * Lookup a key in the key list by dnskey. * */ key_type* keylist_lookup_by_dnskey(keylist_type* kl, ldns_rr* dnskey) { uint16_t i = 0; if (!kl || !dnskey || kl->count <= 0) { return NULL; } for (i=0; i < kl->count; i++) { if (&kl->keys[i] && kl->keys[i].dnskey) { if (ldns_rr_compare(kl->keys[i].dnskey, dnskey) == 0) { return &kl->keys[i]; } } } return NULL; } /** * Push a key to the key list. * */ key_type* keylist_push(keylist_type* kl, const char* locator, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk) { key_type* keys_old = NULL; signconf_type* sc = NULL; ods_log_assert(kl); ods_log_assert(locator); ods_log_debug("[%s] add locator %s", key_str, locator); sc = (signconf_type*) kl->sc; keys_old = kl->keys; kl->keys = (key_type*) allocator_alloc(sc->allocator, (kl->count + 1) * sizeof(key_type)); if (!kl->keys) { ods_fatal_exit("[%s] unable to add key: allocator_alloc() failed", key_str); } if (keys_old) { memcpy(kl->keys, keys_old, (kl->count) * sizeof(key_type)); } allocator_deallocate(sc->allocator, (void*) keys_old); kl->count++; kl->keys[kl->count -1].locator = locator; kl->keys[kl->count -1].algorithm = algorithm; kl->keys[kl->count -1].flags = flags; kl->keys[kl->count -1].publish = publish; kl->keys[kl->count -1].ksk = ksk; kl->keys[kl->count -1].zsk = zsk; kl->keys[kl->count -1].dnskey = NULL; kl->keys[kl->count -1].hsmkey = NULL; kl->keys[kl->count -1].params = NULL; return &kl->keys[kl->count -1]; } /** * Print key. * */ static void key_print(FILE* fd, key_type* key) { if (!fd || !key) { return; } fprintf(fd, "\t\t\t\n"); fprintf(fd, "\t\t\t\t%u\n", key->flags); fprintf(fd, "\t\t\t\t%u\n", key->algorithm); if (key->locator) { fprintf(fd, "\t\t\t\t%s\n", key->locator); } if (key->ksk) { fprintf(fd, "\t\t\t\t\n"); } if (key->zsk) { fprintf(fd, "\t\t\t\t\n"); } if (key->publish) { fprintf(fd, "\t\t\t\t\n"); } fprintf(fd, "\t\t\t\n"); fprintf(fd, "\n"); return; } /** * Log key. * */ static void key_log(key_type* key, const char* name) { if (!key) { return; } ods_log_debug("[%s] zone %s key: LOCATOR[%s] FLAGS[%u] ALGORITHM[%u] " "KSK[%i] ZSK[%i] PUBLISH[%i]", key_str, name?name:"(null)", key->locator, key->flags, key->algorithm, key->ksk, key->zsk, key->publish); return; } /** * Print key list. * */ void keylist_print(FILE* fd, keylist_type* kl) { uint16_t i = 0; if (!fd || !kl || kl->count <= 0) { return; } for (i=0; i < kl->count; i++) { key_print(fd, &kl->keys[i]); } return; } /** * Log key list. * */ void keylist_log(keylist_type* kl, const char* name) { uint16_t i = 0; if (!kl || kl->count <= 0) { return; } for (i=0; i < kl->count; i++) { key_log(&kl->keys[i], name); } return; } /** * Clean up key. * */ static void key_delfunc(key_type* key) { if (!key) { return; } /* ldns_rr_free(key->dnskey); */ hsm_key_free(key->hsmkey); hsm_sign_params_free(key->params); free((void*) key->locator); return; } /** * Clean up key list. * */ void keylist_cleanup(keylist_type* kl) { uint16_t i = 0; signconf_type* sc = NULL; if (!kl) { return; } for (i=0; i < kl->count; i++) { key_delfunc(&kl->keys[i]); } sc = (signconf_type*) kl->sc; allocator_deallocate(sc->allocator, (void*) kl->keys); allocator_deallocate(sc->allocator, (void*) kl); } /** * Backup key. * */ static void key_backup(FILE* fd, key_type* key, const char* version) { if (!fd || !key) { return; } fprintf(fd, ";;Key: locator %s algorithm %u flags %u publish %i ksk %i " "zsk %i\n", key->locator, (unsigned) key->algorithm, (unsigned) key->flags, key->publish, key->ksk, key->zsk); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) == 0) { if (key->dnskey) { (void)util_rr_print(fd, key->dnskey); } fprintf(fd, ";;Keydone\n"); } return; } /** * Recover key from backup. * */ key_type* key_recover2(FILE* fd, keylist_type* kl) { const char* locator = NULL; uint8_t algorithm = 0; uint32_t flags = 0; int publish = 0; int ksk = 0; int zsk = 0; ods_log_assert(fd); if (!backup_read_check_str(fd, "locator") || !backup_read_str(fd, &locator) || !backup_read_check_str(fd, "algorithm") || !backup_read_uint8_t(fd, &algorithm) || !backup_read_check_str(fd, "flags") || !backup_read_uint32_t(fd, &flags) || !backup_read_check_str(fd, "publish") || !backup_read_int(fd, &publish) || !backup_read_check_str(fd, "ksk") || !backup_read_int(fd, &ksk) || !backup_read_check_str(fd, "zsk") || !backup_read_int(fd, &zsk)) { if (locator) { free((void*)locator); locator = NULL; } return NULL; } /* key ok */ return keylist_push(kl, locator, algorithm, flags, publish, ksk, zsk); } /** * Backup key list. * */ void keylist_backup(FILE* fd, keylist_type* kl, const char* version) { uint16_t i = 0; if (!fd || !kl || kl->count <= 0) { return; } for (i=0; i < kl->count; i++) { key_backup(fd, &kl->keys[i], version); } return; } opendnssec-1.4.3/signer/src/signer/backup.c0000664000175000017500000004314512166477645015612 00000000000000/* * $Id: tools.c 3817 2010-08-27 08:43:00Z matthijs $ * * Copyright (c) 2006-2010 NLNet Labs. 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, 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 ``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 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. * */ /** * Recover from backup. * */ #include "config.h" #include "adapter/adapi.h" #include "adapter/adutil.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/zone.h" #include static const char* backup_str = "backup"; /** * Read token from backup file. * */ char* backup_read_token(FILE* in) { static char buf[4000]; buf[sizeof(buf)-1]=0; while (1) { if (fscanf(in, "%3990s", buf) != 1) { return 0; } if (buf[0] != '#') { return buf; } if (!fgets(buf, sizeof(buf), in)) { return 0; } } return 0; } /** * Read and match a string from backup file. * */ int backup_read_check_str(FILE* in, const char* str) { char *p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read check string \'%s\'", backup_str, str); return 0; } if (ods_strcmp(p, str) != 0) { ods_log_debug("[%s] \'%s\' does not match \'%s\'", backup_str, p, str); return 0; } return 1; } /** * Read a string from backup file. * */ int backup_read_str(FILE* in, const char** str) { char *p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read string", backup_str); return 0; } *str = strdup(p); return 1; } /** * Read time from backup file. * */ int backup_read_time_t(FILE* in, time_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read time", backup_str); return 0; } *v=atol(p); return 1; } /** * Read duration from backup file. * */ int backup_read_duration(FILE* in, duration_type** v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read duration", backup_str); return 0; } *v=duration_create_from_string((const char*) p); return 1; } /** * Read rr type from backup file. * */ int backup_read_rr_type(FILE* in, ldns_rr_type* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read rr type", backup_str); return 0; } *v=(ldns_rr_type) atoi(p); return 1; } /** * Read integer from backup file. * */ int backup_read_int(FILE* in, int* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read integer", backup_str); return 0; } *v=atoi(p); return 1; } /** * Read size type from backup file. * */ int backup_read_size_t(FILE* in, size_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read size_t", backup_str); return 0; } *v=(size_t)atoi(p); return 1; } /** * Read 8bit unsigned integer from backup file. * */ int backup_read_uint8_t(FILE* in, uint8_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read uint8_t", backup_str); return 0; } *v= (uint8_t)atoi(p); return 1; } /** * Read 16bit unsigned integer from backup file. * */ int backup_read_uint16_t(FILE* in, uint16_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read uint16_t", backup_str); return 0; } *v= (uint16_t)atoi(p); return 1; } /** * Read 32bit unsigned integer from backup file. * */ int backup_read_uint32_t(FILE* in, uint32_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read uint32_t", backup_str); return 0; } *v= (uint32_t)atol(p); return 1; } /** * Read the next RR from the backup file. * */ static ldns_rr* backup_read_rr(FILE* in, zone_type* zone, char* line, ldns_rdf** orig, ldns_rdf** prev, ldns_status* status, unsigned int* l) { ldns_rr* rr = NULL; int len = 0; backup_read_line: len = adutil_readline_frm_file(in, line, l, 1); if (len >= 0) { switch (line[0]) { case ';': /* done */ *status = LDNS_STATUS_OK; return NULL; break; case '\n': case '\0': goto backup_read_line; /* perhaps next line is rr */ break; /* let's hope its a RR */ default: *status = ldns_rr_new_frm_str(&rr, line, zone->default_ttl, *orig, prev); if (*status == LDNS_STATUS_OK) { return rr; } else if (*status == LDNS_STATUS_SYNTAX_EMPTY) { if (rr) { ldns_rr_free(rr); rr = NULL; } *status = LDNS_STATUS_OK; goto backup_read_line; /* perhaps next line is rr */ break; } else { ods_log_error("[%s] error parsing RR #%i (%s): %s", backup_str, l&&*l?*l:0, ldns_get_errorstr_by_id(*status), line); if (rr) { ldns_rr_free(rr); rr = NULL; } return NULL; } break; } } /* -1, EOF */ *status = LDNS_STATUS_OK; return NULL; } /** * Get locator from string. * */ static char* replace_space_with_nul(char* str) { int i = 0; if (!str) { return NULL; } i = strlen(str); while (i>0) { --i; if (str[i] == ' ') { str[i] = '\0'; } } return strdup(str); } /** * Read namedb from backup file. * */ ods_status backup_read_namedb(FILE* in, void* zone) { zone_type* z = (zone_type*) zone; denial_type* denial = NULL; rrset_type* rrset = NULL; ods_status result = ODS_STATUS_OK; ldns_rr_type type_covered; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; char* str = NULL; char* locator = NULL; uint32_t flags = 0; unsigned int l = 0; ods_log_assert(in); ods_log_assert(z); /* $ORIGIN */ dname = adapi_get_origin(z); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } /* read RRs */ ods_log_debug("[%s] read RRs %s", backup_str, z->name); while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } /* add to the database */ result = adapi_add_rr(z, rr, 1); if (result == ODS_STATUS_UNCHANGED) { ods_log_debug("[%s] skipping RR #%i (duplicate): %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else if (result != ODS_STATUS_OK) { ods_log_error("[%s] error adding RR #%i: %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; goto backup_namedb_done; } } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } namedb_diff(z->db, 0, 0); /* read NSEC(3)s */ ods_log_debug("[%s] read NSEC(3)s %s", backup_str, z->name); l = 0; while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading NSEC(3) #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_NSEC && ldns_rr_get_type(rr) != LDNS_RR_TYPE_NSEC3) { ods_log_error("[%s] error NSEC(3) #%i is not NSEC(3): %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } /* add to the denial chain */ denial = namedb_lookup_denial(z->db, ldns_rr_owner(rr)); if (!denial) { ods_log_error("[%s] error adding NSEC(3) #%i: %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } denial_add_rr(denial, rr); } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading NSEC(3) #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } /* read RRSIGs */ ods_log_debug("[%s] read RRSIGs %s", backup_str, z->name); l = 0; while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_RRSIG) { ods_log_error("[%s] error RRSIG #%i is not RRSIG: %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } /* read locator and flags */ str = strstr(line, "flags"); if (str) { flags = (uint32_t) atoi(str+6); } str = strstr(line, "locator"); if (str) { locator = replace_space_with_nul(str+8); } /* add signatures */ type_covered = ldns_rdf2rr_type(ldns_rr_rrsig_typecovered(rr)); if (type_covered == LDNS_RR_TYPE_NSEC || type_covered == LDNS_RR_TYPE_NSEC3) { denial = namedb_lookup_denial(z->db, ldns_rr_owner(rr)); if (!denial) { ods_log_error("[%s] error restoring RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } rrset = denial->rrset; } else { rrset = zone_lookup_rrset(z, ldns_rr_owner(rr), type_covered); } if (!rrset || !rrset_add_rrsig(rrset, rr, locator, flags)) { ods_log_error("[%s] error restoring RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } else { rrset->needs_signing = 0; } } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } backup_namedb_done: if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } return result; } /** * Read ixfr journal from file. * * */ ods_status backup_read_ixfr(FILE* in, void* zone) { zone_type* z = (zone_type*) zone; ods_status result = ODS_STATUS_OK; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; uint32_t serial = 0; unsigned l = 0; unsigned first_soa = 0; unsigned del_mode = 0; ods_log_assert(in); ods_log_assert(z); /* $ORIGIN */ dname = adapi_get_origin(z); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } /* read RRs */ while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_ixfr_done; } if (first_soa == 2) { ods_log_error("[%s] bad ixfr journal: trailing RRs after final " "SOA", backup_str); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_ixfr_done; } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { serial = ldns_rdf2native_int32( ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); if (!first_soa) { ods_log_debug("[%s] ixfr first SOA: %s", backup_str, ldns_rr2str(rr)); /* first SOA */ ldns_rr_free(rr); rr = NULL; if (z->db->outserial != serial) { ods_log_error("[%s] bad ixfr journal: first SOA wrong " "serial (was %u, expected %u)", backup_str, serial, z->db->outserial); result = ODS_STATUS_ERR; goto backup_ixfr_done; } first_soa = 1; continue; } ods_log_assert(first_soa); if (!del_mode) { if (z->db->outserial == serial) { /* final SOA */ ods_log_debug("[%s] ixfr final SOA: %s", backup_str, ldns_rr2str(rr)); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; first_soa = 2; continue; } else { ods_log_debug("[%s] new part SOA: %s", backup_str, ldns_rr2str(rr)); lock_basic_lock(&z->ixfr->ixfr_lock); ixfr_purge(z->ixfr); lock_basic_unlock(&z->ixfr->ixfr_lock); } } else { ods_log_debug("[%s] second part SOA: %s", backup_str, ldns_rr2str(rr)); } del_mode = !del_mode; } /* ixfr add or del rr */ if (!first_soa) { ods_log_error("[%s] bad ixfr journal: first RR not SOA", backup_str); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_ixfr_done; } ods_log_assert(first_soa); lock_basic_lock(&z->ixfr->ixfr_lock); if (del_mode) { ods_log_debug("[%s] -IXFR: %s", backup_str, ldns_rr2str(rr)); ixfr_del_rr(z->ixfr, rr); } else { ods_log_debug("[%s] +IXFR: %s", backup_str, ldns_rr2str(rr)); ixfr_add_rr(z->ixfr, rr); } lock_basic_unlock(&z->ixfr->ixfr_lock); } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } backup_ixfr_done: if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } return result; } opendnssec-1.4.3/signer/src/signer/denial.h0000664000175000017500000000613511763360055015570 00000000000000/* * $Id$ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Denial of Existence. * */ #ifndef SIGNER_DENIAL_H #define SIGNER_DENIAL_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "signer/nsec3params.h" #include "signer/rrset.h" #include #include /** * Denial of Existence data point. * */ typedef struct denial_struct denial_type; struct denial_struct { void* zone; void* domain; ldns_rbnode_t* node; ldns_rdf* dname; rrset_type* rrset; unsigned bitmap_changed : 1; unsigned nxt_changed : 1; }; /** * Create new Denial of Existence data point. * \param[in] zoneptr zone reference * \param[in] dname owner name * \return denial_type* denial of existence data point * */ denial_type* denial_create(void* zoneptr, ldns_rdf* dname); /** * Apply differences at denial. * \param[in] denial Denial of Existence data point * */ void denial_diff(denial_type* denial); /** * Add NSEC(3) to the Denial of Existence data point. * \param[in] denial Denial of Existence data point * \param[in] rr NSEC(3) resource record * */ void denial_add_rr(denial_type* denial, ldns_rr* rr); /** * Nsecify Denial of Existence data point. * \param[in] denial Denial of Existence data point * \param[in] nxt next Denial of Existence data point * \param[out] num_added number of RRs added * */ void denial_nsecify(denial_type* denial, denial_type* nxt, uint32_t* num_added); /** * Print Denial of Existence data point. * \param[in] fd file descriptor * \param[in] denial denial of existence data point * \param[out] status status * */ void denial_print(FILE* fd, denial_type* denial, ods_status* status); /** * Cleanup Denial of Existence data point. * \param[in] denial denial of existence data point * */ void denial_cleanup(denial_type* denial); #endif /* SIGNER_DENIAL_H */ opendnssec-1.4.3/signer/src/signer/namedb.h0000664000175000017500000001273512225763434015567 00000000000000/* * $Id: namedb.h 5465 2011-08-23 14:39:28Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Domain name database. * */ #ifndef SIGNER_NAMEDB_H #define SIGNER_NAMEDB_H #include "config.h" #include "signer/denial.h" #include "signer/domain.h" #include "signer/nsec3params.h" #include /** * Domain name database. * */ typedef struct namedb_struct namedb_type; struct namedb_struct { void* zone; ldns_rbtree_t* domains; ldns_rbtree_t* denials; uint32_t inbserial; uint32_t intserial; uint32_t outserial; uint32_t altserial; unsigned is_initialized : 1; unsigned is_processed : 1; unsigned serial_updated : 1; unsigned force_serial : 1; unsigned have_serial : 1; }; /** * Initialize denial of existence chain. * \param[in] db namedb * */ void namedb_init_denials(namedb_type* db); /** * Create a new namedb. * \param[in] zone zone reference * \return namedb_type* namedb * */ namedb_type* namedb_create(void* zone); /** * Determine new SOA SERIAL. * \param[in] db namedb * \param[in] zone_name zone name * \param[in] format format from signer configuration * \param[in] inbound_serial inbound serial * \return ods_status status * */ ods_status namedb_update_serial(namedb_type* db, const char* zone_name, const char* format, uint32_t inbound_serial); /** * Add empty non-terminals for domain. * \param[in] db namedb * \param[in] domain domain * \param[in] apex apex domain name * \return ods_status status * */ ods_status namedb_domain_entize(namedb_type* db, domain_type* domain, ldns_rdf* apex); /** * Look up domain. * \param[in] db namedb * \param[in] dname domain name * \return domain_type* domain, if found * */ domain_type* namedb_lookup_domain(namedb_type* db, ldns_rdf* dname); /** * Add domain to namedb. * \param[in] db namedb * \param[in] dname domain name * \return domain_type* added domain * */ domain_type* namedb_add_domain(namedb_type* db, ldns_rdf* dname); /** * Delete domain from namedb * \param[in] db namedb * \param[in] domain domain * \return domain_type* deleted domain * */ domain_type* namedb_del_domain(namedb_type* db, domain_type* domain); /** * Lookup denial. * \param[in] db namedb * \param[in] dname domain name * \return denial_type* denial, if found * */ denial_type* namedb_lookup_denial(namedb_type* db, ldns_rdf* dname); /** * Add denial to namedb. * \param[in] db namedb * \param[in] dname domain name * \param[in] n3p NSEC3 parameters, NULL if we do NSEC * \return denial_type* added denial * */ denial_type* namedb_add_denial(namedb_type* db, ldns_rdf* dname, nsec3params_type* n3p); /** * Delete denial from namedb * \param[in] db namedb * \param[in] denial denial * \return denial_type* deleted denial * */ denial_type* namedb_del_denial(namedb_type* db, denial_type* denial); /** * Examine updates to namedb. * \param[in] db namedb * \return ods_status status * */ ods_status namedb_examine(namedb_type* db); /** * Apply differences in db. * \param[in] db namedb * \param[in] is_ixfr true if incremental change * \param[in] more_coming more transactions possible * */ void namedb_diff(namedb_type* db, unsigned is_ixfr, unsigned more_coming); /** * Rollback differences in db. * \param[in] db namedb * \param[in] keepsc keep RRs that did not came from the adapter. * */ void namedb_rollback(namedb_type* db, unsigned keepsc); /** * Nsecify db. * \param[in] db namedb * \param[out] num_added number of NSEC RRs added * */ void namedb_nsecify(namedb_type* db, uint32_t* num_added); /** * Export db to file. * \param[in] fd file descriptor * \param[in] namedb namedb * \param[out] status status * */ void namedb_export(FILE* fd, namedb_type* db, ods_status* status); /** * Wipe out all NSEC(3) RRsets. * \param[in] db namedb * */ void namedb_wipe_denial(namedb_type* db); /** * Clean up denial of existence chain. * \param[in] db namedb * */ void namedb_cleanup_denials(namedb_type* db); /** * Clean up namedb. * \param[in] namedb namedb * */ void namedb_cleanup(namedb_type* db); /** * Backup namedb. * \param[in] fd output file descriptor * \param[in] zd zone data * */ void namedb_backup2(FILE* fd, namedb_type* db); #endif /* SIGNER_NAMEDB_H */ opendnssec-1.4.3/signer/src/signer/denial.c0000664000175000017500000002410112055134674015555 00000000000000/* * $Id$ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Denial of Existence. * */ #include "config.h" #include "shared/log.h" #include "signer/denial.h" #include "signer/domain.h" #include "signer/zone.h" #define SE_MAX_RRTYPE_COUNT 65536 static const char* denial_str = "denial"; /** * Create new Denial of Existence data point. * */ denial_type* denial_create(void* zoneptr, ldns_rdf* dname) { denial_type* denial = NULL; zone_type* zone = (zone_type*) zoneptr; if (!dname || !zoneptr) { return NULL; } denial = (denial_type*) allocator_alloc( zone->allocator, sizeof(denial_type)); if (!denial) { ods_log_error("[%s] unable to create denial: allocator_alloc() " "failed", denial_str); return NULL; } denial->dname = dname; denial->zone = zoneptr; denial->domain = NULL; /* no back reference yet */ denial->node = NULL; /* not in db yet */ denial->rrset = NULL; denial->bitmap_changed = 0; denial->nxt_changed = 0; return denial; } /** * Create NSEC(3) Type Bitmaps Field. * */ static void denial_create_bitmap(denial_type* denial, ldns_rr_type types[], size_t* types_count) { domain_type* domain = NULL; rrset_type* rrset = NULL; ods_log_assert(denial); ods_log_assert(denial->domain); domain = (domain_type*) denial->domain; rrset = domain->rrsets; while (rrset) { ldns_rr_type dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_SOA) { /* Authoritative or delegation */ dstatus = domain_is_delegpt(domain); if (dstatus == LDNS_RR_TYPE_SOA || rrset->rrtype == LDNS_RR_TYPE_NS || rrset->rrtype == LDNS_RR_TYPE_DS) { types[*types_count] = rrset->rrtype; *types_count = *types_count + 1; } } rrset = rrset->next; } return; } /** * Create NSEC3 Next Hashed Owner Name Field. * */ static ldns_rdf* denial_create_nsec3_nxt(ldns_rdf* nxt) { ldns_status status = LDNS_STATUS_OK; ldns_rdf* next_owner_label = NULL; ldns_rdf* next_owner_rdf = NULL; char* next_owner_string = NULL; ods_log_assert(nxt); next_owner_label = ldns_dname_label(nxt, 0); if (!next_owner_label) { ods_log_alert("[%s] unable to create NSEC3 Next: " "ldns_dname_label() failed", denial_str); return NULL; } next_owner_string = ldns_rdf2str(next_owner_label); if (!next_owner_string) { ods_log_alert("[%s] unable to create NSEC3 Next: " "ldns_rdf2str() failed", denial_str); ldns_rdf_deep_free(next_owner_label); return NULL; } if (next_owner_string[strlen(next_owner_string)-1] == '.') { next_owner_string[strlen(next_owner_string)-1] = '\0'; } status = ldns_str2rdf_b32_ext(&next_owner_rdf, next_owner_string); if (status != LDNS_STATUS_OK) { ods_log_alert("[%s] unable to create NSEC3 Next: " "ldns_str2rdf_b32_ext() failed", denial_str); } free((void*)next_owner_string); ldns_rdf_deep_free(next_owner_label); return next_owner_rdf; } /** * Create NSEC(3) RR. * */ static ldns_rr* denial_create_nsec(denial_type* denial, denial_type* nxt, uint32_t ttl, ldns_rr_class klass, nsec3params_type* n3p) { ldns_rr* nsec_rr = NULL; ldns_rr_type rrtype = LDNS_RR_TYPE_NSEC; ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; ldns_rdf* rdf = NULL; domain_type* domain = NULL; ldns_rr_type types[SE_MAX_RRTYPE_COUNT]; size_t types_count = 0; int i = 0; ods_log_assert(denial); ods_log_assert(denial->dname); ods_log_assert(nxt); ods_log_assert(nxt->dname); nsec_rr = ldns_rr_new(); if (!nsec_rr) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "ldns_rr_new() failed", denial_str); return NULL; } /* RRtype */ if (n3p) { rrtype = LDNS_RR_TYPE_NSEC3; } ldns_rr_set_type(nsec_rr, rrtype); /* owner */ rdf = ldns_rdf_clone(denial->dname); if (!rdf) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "ldns_rdf_clone(owner) failed", denial_str); ldns_rr_free(nsec_rr); return NULL; } ldns_rr_set_owner(nsec_rr, rdf); /* NSEC3 parameters */ if (n3p) { /* set all to NULL first, then call nsec3_add_param_rdfs. */ for (i=0; i < SE_NSEC3_RDATA_NSEC3PARAMS; i++) { ldns_rr_push_rdf(nsec_rr, NULL); } ldns_nsec3_add_param_rdfs(nsec_rr, n3p->algorithm, n3p->flags, n3p->iterations, n3p->salt_len, n3p->salt_data); } /* NXT */ if (n3p) { rdf = denial_create_nsec3_nxt(nxt->dname); } else { rdf = ldns_rdf_clone(nxt->dname); } if (!rdf) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "create next field failed", denial_str); ldns_rr_free(nsec_rr); return NULL; } ldns_rr_push_rdf(nsec_rr, rdf); /* Type Bit Maps */ denial_create_bitmap(denial, types, &types_count); if (n3p) { domain = (domain_type*) denial->domain; dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_SOA) { dstatus = domain_is_delegpt(domain); if (dstatus != LDNS_RR_TYPE_NS && domain->rrsets) { /* Authoritative domain, not empty: add RRSIGs */ types[types_count] = LDNS_RR_TYPE_RRSIG; types_count++; } } /* and don't add NSEC3 type... */ } else { types[types_count] = LDNS_RR_TYPE_RRSIG; types_count++; types[types_count] = LDNS_RR_TYPE_NSEC; types_count++; } rdf = ldns_dnssec_create_nsec_bitmap(types, types_count, rrtype); if (!rdf) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "ldns_dnssec_create_nsec_bitmap() failed", denial_str); ldns_rr_free(nsec_rr); return NULL; } ldns_rr_push_rdf(nsec_rr, rdf); ldns_rr_set_ttl(nsec_rr, ttl); ldns_rr_set_class(nsec_rr, klass); return nsec_rr; } /** * Apply differences at denial. * */ void denial_diff(denial_type* denial) { if (denial && denial->rrset) { rrset_diff(denial->rrset, 0, 0); } return; } /** * Add NSEC(3) to the Denial of Existence data point. * */ void denial_add_rr(denial_type* denial, ldns_rr* rr) { rr_type* record = NULL; zone_type* zone = NULL; ods_log_assert(denial); ods_log_assert(rr); zone = (zone_type*) denial->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); if (!denial->rrset) { if (zone->signconf->nsec3params) { denial->rrset = rrset_create(denial->zone, LDNS_RR_TYPE_NSEC3); } else { denial->rrset = rrset_create(denial->zone, LDNS_RR_TYPE_NSEC); } if (!denial->rrset) { ods_fatal_exit("[%s] unable to nsecify: rrset_create() failed", denial_str); } } ods_log_assert(denial->rrset); record = rrset_add_rr(denial->rrset, rr); ods_log_assert(record); ods_log_assert(record->rr); record->owner = (void*) denial; denial_diff(denial); denial->bitmap_changed = 0; denial->nxt_changed = 0; return; } /** * Nsecify Denial of Existence data point. * */ void denial_nsecify(denial_type* denial, denial_type* nxt, uint32_t* num_added) { ldns_rr* nsec_rr = NULL; zone_type* zone = NULL; ods_log_assert(denial); ods_log_assert(nxt); zone = (zone_type*) denial->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); if (denial->nxt_changed || denial->bitmap_changed) { /* create new NSEC(3) rr */ nsec_rr = denial_create_nsec(denial, nxt, zone->default_ttl, zone->klass, zone->signconf->nsec3params); if (!nsec_rr) { ods_fatal_exit("[%s] unable to nsecify: denial_create_nsec() " "failed", denial_str); } denial_add_rr(denial, nsec_rr); if (num_added) { (*num_added)++; } } return; } /** * Print Denial of Existence data point. * */ void denial_print(FILE* fd, denial_type* denial, ods_status* status) { if (!denial || !fd) { if (status) { ods_log_crit("[%s] unable to print denial: denial of fd missing", denial_str); *status = ODS_STATUS_ASSERT_ERR; } return; } if (denial->rrset) { rrset_print(fd, denial->rrset, 0, status); } return; } /** * Cleanup Denial of Existence data point. * */ void denial_cleanup(denial_type* denial) { zone_type* zone = NULL; if (!denial) { return; } zone = (zone_type*) denial->zone; ldns_rdf_deep_free(denial->dname); rrset_cleanup(denial->rrset); allocator_deallocate(zone->allocator, (void*) denial); return; } opendnssec-1.4.3/signer/src/signer/zonelist.h0000664000175000017500000000651711665414722016211 00000000000000/* * $Id: zonelist.h 5948 2011-11-30 11:56:02Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * * The zonelist and all. */ #ifndef SIGNER_ZONELIST_H #define SIGNER_ZONELIST_H #include "shared/allocator.h" #include "shared/locks.h" #include "signer/zone.h" #include #include #include /** * Zone list * */ typedef struct zonelist_struct zonelist_type; struct zonelist_struct { allocator_type* allocator; ldns_rbtree_t* zones; time_t last_modified; int just_added; int just_updated; int just_removed; lock_basic_type zl_lock; }; /** * Create zone list. * \param[in] allocator memory allocator * \return zonelist_type* created zone list * */ zonelist_type* zonelist_create(allocator_type* allocator); /** * Lookup zone by name and class. * \param[in] zl zone list * \param[in] name zone name * \param[in] klass zone class * \return zone_type* found zone * */ zone_type* zonelist_lookup_zone_by_name(zonelist_type* zonelist, const char* name, ldns_rr_class klass); /** * Lookup zone by dname and class. * \param[in] zl zone list * \param[in] dname zone domain name * \param[in] klass zone class * \return zone_type* found zone * */ zone_type* zonelist_lookup_zone_by_dname(zonelist_type* zonelist, ldns_rdf* dname, ldns_rr_class klass); /** * Add zone. * \param[in] zl zone list * \param[in] zone zone * \return zone_type* added zone * */ zone_type* zonelist_add_zone(zonelist_type* zl, zone_type* zone); /** * Delete zone. * \param[in] zl zone list * \param[in] zone zone * \return zone_type* deleted zone * */ zone_type* zonelist_del_zone(zonelist_type* zlist, zone_type* zone); /** * Update zonelist. * \param[in] zl zone list * \param[in] zlfile zone list filename * \return ods_status status * */ ods_status zonelist_update(zonelist_type* zl, const char* zlfile); /** * Clean up zone list. * \param[in] zl zone list * */ void zonelist_cleanup(zonelist_type* zl); /** * Free zone list. * \param[in] zl zone list * */ void zonelist_free(zonelist_type* zl); #endif /* SIGNER_ZONELIST_H */ opendnssec-1.4.3/signer/src/signer/signconf.h0000664000175000017500000001027212225246663016141 00000000000000/* * $Id: signconf.h 7354 2013-10-09 12:36:03Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signer configuration. * */ #ifndef SIGNER_SIGNCONF_H #define SIGNER_SIGNCONF_H #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/duration.h" #include "signer/keys.h" #include "signer/nsec3params.h" #include #include /** * Signer Configuration. * */ typedef struct signconf_struct signconf_type; struct signconf_struct { /* Zone */ const char* name; allocator_type* allocator; /* Signatures */ duration_type* sig_resign_interval; duration_type* sig_refresh_interval; duration_type* sig_validity_default; duration_type* sig_validity_denial; duration_type* sig_jitter; duration_type* sig_inception_offset; /* Denial of existence */ duration_type* nsec3param_ttl; ldns_rr_type nsec_type; int nsec3_optout; uint32_t nsec3_algo; uint32_t nsec3_iterations; const char* nsec3_salt; nsec3params_type* nsec3params; /* Keys */ duration_type* dnskey_ttl; keylist_type* keys; /* Source of authority */ duration_type* soa_ttl; duration_type* soa_min; const char* soa_serial; /* Other useful information */ const char* filename; time_t last_modified; }; /** * Create a new signer configuration with the 'empty' settings. * \return signconf_type* signer configuration * */ signconf_type* signconf_create(void); /** * Update signer configuration. * \param[out] signconf signer configuration * \param[in] scfile signer configuration file name * \param[in] last_modified last known modification * \return ods_status status * */ ods_status signconf_update(signconf_type** signconf, const char* scfile, time_t last_modified); /** * Backup signer configuration. * \param[in] fd file descriptor * \param[in] sc signer configuration settings * \param[in] version version string * */ void signconf_backup(FILE* fd, signconf_type* sc, const char* version); /** * Check signer configuration. * \param signconf signer configuration * \return ods_status status * */ ods_status signconf_check(signconf_type* signconf); /** * Compare signer configurations on denial of existence material. * \param[in] a a signer configuration * \param[in] b another signer configuration * \return task_id what task needs to be scheduled * */ task_id signconf_compare_denial(signconf_type* a, signconf_type* b); /** * Print signer configuration. * \param[in] out file descriptor * \param[in] sc signconf to print * \param[in] name zone name * */ void signconf_print(FILE* out, signconf_type* sc, const char* name); /** * Log signer configuration. * \param[in] sc signconf to log * \param[in] name zone name * */ void signconf_log(signconf_type* sc, const char* name); /** * Clean up signer configuration. * \param[in] sc signconf to cleanup * */ void signconf_cleanup(signconf_type* sc); #endif /* SIGNER_SIGNCONF_H */ opendnssec-1.4.3/signer/src/signer/stats.c0000664000175000017500000000572111701562115015456 00000000000000/* * $Id: stats.c 6036 2012-01-06 12:08:45Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signer statistics. * */ #include "shared/log.h" #include "signer/stats.h" /** * Initialize statistics. * */ stats_type* stats_create(void) { stats_type* stats = (stats_type*) malloc(sizeof(stats_type)); stats_clear(stats); lock_basic_init(&stats->stats_lock); return stats; } /** * Clear statistics. * */ void stats_clear(stats_type* stats) { ods_log_assert(stats); stats->sort_count = 0; stats->sort_time = 0; stats->sort_done = 0; stats->nsec_count = 0; stats->nsec_time = 0; stats->sig_count = 0; stats->sig_soa_count = 0; stats->sig_reuse = 0; stats->sig_time = 0; stats->start_time = 0; stats->end_time = 0; } /** * Log statistics. * */ void stats_log(stats_type* stats, const char* name, ldns_rr_type nsec_type) { uint32_t avsign = 0; if (!stats) { return; } ods_log_assert(stats); if (stats->sig_time) { avsign = (uint32_t) (stats->sig_count/stats->sig_time); } ods_log_info("[STATS] %s RR[count=%u time=%u(sec)] " "NSEC%s[count=%u time=%u(sec)] " "RRSIG[new=%u reused=%u time=%u(sec) avg=%u(sig/sec)] " "TOTAL[time=%u(sec)] ", name?name:"(null)", stats->sort_count, stats->sort_time, nsec_type==LDNS_RR_TYPE_NSEC3?"3":"", stats->nsec_count, stats->nsec_time, stats->sig_count, stats->sig_reuse, stats->sig_time, avsign, (uint32_t) (stats->end_time - stats->start_time)); return; } /** * Clean up statistics. * */ void stats_cleanup(stats_type* stats) { lock_basic_destroy(&stats->stats_lock); free((void*) stats); return; } opendnssec-1.4.3/signer/src/signer/tools.c0000664000175000017500000002201712225763434015466 00000000000000/* * $Id: tools.c 7359 2013-10-11 11:55:08Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone signing tools. * */ #include "config.h" #include "daemon/dnshandler.h" #include "adapter/adapter.h" #include "shared/log.h" #include "signer/tools.h" #include "signer/zone.h" #include #include #include #include static const char* tools_str = "tools"; /** * Load zone signconf. * */ ods_status tools_signconf(zone_type* zone) { ods_status status = ODS_STATUS_OK; signconf_type* new_signconf = NULL; ods_log_assert(zone); ods_log_assert(zone->name); status = zone_load_signconf(zone, &new_signconf); if (status == ODS_STATUS_OK) { ods_log_assert(new_signconf); /* Denial of Existence Rollover? */ if (signconf_compare_denial(zone->signconf, new_signconf) == TASK_NSECIFY) { /** * Or NSEC -> NSEC3, or NSEC3 -> NSEC, or NSEC3 params changed. * All NSEC(3)s become invalid. */ namedb_wipe_denial(zone->db); namedb_cleanup_denials(zone->db); namedb_init_denials(zone->db); } /* all ok, switch signer configuration */ signconf_cleanup(zone->signconf); ods_log_debug("[%s] zone %s switch to new signconf", tools_str, zone->name); zone->signconf = new_signconf; signconf_log(zone->signconf, zone->name); zone->default_ttl = (uint32_t) duration2time(zone->signconf->soa_min); } else if (status != ODS_STATUS_UNCHANGED) { ods_log_error("[%s] unable to load signconf for zone %s: %s", tools_str, zone->name, ods_status2str(status)); } return status; } /** * Read zone from input adapter. * */ ods_status tools_input(zone_type* zone) { ods_status status = ODS_STATUS_OK; time_t start = 0; time_t end = 0; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adinbound); ods_log_assert(zone->signconf); /* Key Rollover? */ status = zone_publish_dnskeys(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read zone %s: failed to " "publish dnskeys (%s)", tools_str, zone->name, ods_status2str(status)); zone_rollback_dnskeys(zone); zone_rollback_nsec3param(zone); namedb_rollback(zone->db, 0); return status; } /* Denial of Existence Rollover? */ status = zone_publish_nsec3param(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read zone %s: failed to " "publish nsec3param (%s)", tools_str, zone->name, ods_status2str(status)); zone_rollback_dnskeys(zone); zone_rollback_nsec3param(zone); namedb_rollback(zone->db, 0); return status; } if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->sort_done = 0; zone->stats->sort_count = 0; zone->stats->sort_time = 0; lock_basic_unlock(&zone->stats->stats_lock); } /* Input Adapter */ start = time(NULL); status = adapter_read((void*)zone); if (status != ODS_STATUS_OK && status != ODS_STATUS_UNCHANGED) { ods_log_error("[%s] unable to read zone %s: adapter failed (%s)", tools_str, zone->name, ods_status2str(status)); zone_rollback_dnskeys(zone); zone_rollback_nsec3param(zone); namedb_rollback(zone->db, 0); } end = time(NULL); if ((status == ODS_STATUS_OK || status == ODS_STATUS_UNCHANGED) && zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->start_time = start; zone->stats->sort_time = (end-start); zone->stats->sort_done = 1; lock_basic_unlock(&zone->stats->stats_lock); } return status; } /** * Close file descriptors. * */ static void ods_closeall(int fd) { int fdlimit = sysconf(_SC_OPEN_MAX); while (fd < fdlimit) { close(fd++); } return; } /** * Write zone to output adapter. * */ ods_status tools_output(zone_type* zone, engine_type* engine) { ods_status status = ODS_STATUS_OK; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_assert(zone); ods_log_assert(zone->db); ods_log_assert(zone->name); ods_log_assert(zone->signconf); ods_log_assert(zone->adoutbound); /* prepare */ if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (zone->stats->sort_done == 0 && (zone->stats->sig_count <= zone->stats->sig_soa_count)) { ods_log_verbose("[%s] skip write zone %s serial %u (zone not " "changed)", tools_str, zone->name?zone->name:"(null)", zone->db->intserial); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); zone->db->intserial = zone->db->outserial; return ODS_STATUS_OK; } lock_basic_unlock(&zone->stats->stats_lock); } /* Output Adapter */ status = adapter_write((void*)zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to write zone %s: adapter failed (%s)", tools_str, zone->name, ods_status2str(status)); return status; } zone->db->outserial = zone->db->intserial; zone->db->is_initialized = 1; zone->db->have_serial = 1; lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_purge(zone->ixfr); lock_basic_unlock(&zone->ixfr->ixfr_lock); /* kick the nameserver */ if (zone->notify_ns) { int status; pid_t pid, wpid; ods_log_verbose("[%s] notify nameserver: %s", tools_str, zone->notify_ns); /** fork */ switch ((pid = fork())) { case -1: /* error */ ods_log_error("[%s] notify nameserver failed: unable to fork " "(%s)", tools_str, strerror(errno)); return ODS_STATUS_FORK_ERR; case 0: /* child */ /** close fds */ ods_closeall(0); /** execv */ execvp(zone->notify_ns, zone->notify_args); /** error */ ods_log_error("[%s] notify nameserver failed: execv() failed " "(%s)", tools_str, strerror(errno)); exit(1); break; default: /* parent */ ods_log_debug("[%s] notify nameserver process forked", tools_str); /** wait for completion */ while((wpid = waitpid(pid, &status, 0)) <= 0) { if (errno != EINTR) { break; } } if (wpid == -1) { ods_log_error("[%s] notify nameserver failed: waitpid() ", "failed (%s)", tools_str, strerror(errno)); } else if (!WIFEXITED(status)) { ods_log_error("[%s] notify nameserver failed: notify ", "command did not terminate normally", tools_str); } else { ods_log_verbose("[%s] notify nameserver ok", tools_str); } break; } } if (engine->dnshandler) { dnshandler_fwd_notify(engine->dnshandler, (uint8_t*) ODS_SE_NOTIFY_CMD, strlen(ODS_SE_NOTIFY_CMD)); } /* log stats */ if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->end_time = time(NULL); ods_log_debug("[%s] log stats for zone %s", tools_str, zone->name?zone->name:"(null)"); stats_log(zone->stats, zone->name, zone->signconf->nsec_type); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); } return status; } opendnssec-1.4.3/signer/src/signer/zone.h0000664000175000017500000001473012204642554015305 00000000000000/* * $Id: zone.h 7223 2013-08-20 10:31:08Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone. * */ #ifndef SIGNER_ZONE_H #define SIGNER_ZONE_H #include "config.h" #include "adapter/adapter.h" #include "scheduler/schedule.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "signer/ixfr.h" #include "signer/namedb.h" #include "signer/signconf.h" #include "signer/stats.h" #include "wire/buffer.h" #include "wire/notify.h" #include "wire/xfrd.h" #include struct schedule_struct; enum zone_zl_status_enum { ZONE_ZL_OK = 0, ZONE_ZL_ADDED, ZONE_ZL_UPDATED, ZONE_ZL_REMOVED }; typedef enum zone_zl_status_enum zone_zl_status; /** * Zone. * */ typedef struct zone_struct zone_type; struct zone_struct { allocator_type* allocator; /* memory allocator */ ldns_rdf* apex; /* wire format zone name */ ldns_rr_class klass; /* class */ uint32_t default_ttl; /* ttl */ /* from conf.xml */ char *notify_command; /* placeholder for the whole notify command */ const char* notify_ns; /* master name server reload command */ char** notify_args; /* reload command arguments */ /* from zonelist.xml */ const char* name; /* string format zone name */ const char* policy_name; /* policy identifier */ const char* signconf_filename; /* signconf filename */ zone_zl_status zl_status; /* zonelist status */ /* adapters */ adapter_type* adinbound; /* inbound adapter */ adapter_type* adoutbound; /* outbound adapter */ /* from signconf.xml */ signconf_type* signconf; /* signer configuration values */ /* zone data */ namedb_type* db; ixfr_type* ixfr; /* zone transfers */ xfrd_type* xfrd; notify_type* notify; /* worker variables */ void* task; /* next assigned task */ /* statistics */ stats_type* stats; lock_basic_type zone_lock; lock_basic_type xfr_lock; }; /** * Create a new zone. * \param[in] name zone name * \param[in] klass zone class * \return zone_type* zone * */ zone_type* zone_create(char* name, ldns_rr_class klass); /** * Load signer configuration for zone. * \param[in] zone zone * \param[out] new_signconf new signer configuration * \return ods_status status * ODS_STATUS_OK: new signer configuration loaded * ODS_STATUS_UNCHANGED: signer configuration has not changed * other: signer configuration not loaded, error occurred * */ ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf); /** * Reschedule task for zone. * \param[in] zone zone * \param[in] taskq task queue * \param[in] what new task identifier * \return ods_status status * */ ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq, task_id what); /** * Publish the keys as indicated by the signer configuration. * \param[in] zone zone * \return ods_status status * */ ods_status zone_publish_dnskeys(zone_type* zone); /** * Unlink DNSKEY RRs. * \param[in] zone zone * */ void zone_rollback_dnskeys(zone_type* zone); /** * Publish the NSEC3 parameters as indicated by the signer configuration. * \param[in] zone zone * \return ods_status status * */ ods_status zone_publish_nsec3param(zone_type* zone); /** * Unlink NSEC3PARAM RR. * \param[in] zone zone * */ void zone_rollback_nsec3param(zone_type* zone); /** * Prepare keys for signing. * \param[in] zone zone * \return ods_status status * */ ods_status zone_prepare_keys(zone_type* zone); /** * Update serial. * \param[in] zone zone * \return ods_status status * */ ods_status zone_update_serial(zone_type* zone); /** * Lookup RRset. * \param[in] zone zone * \param[in] owner RRset owner * \param[in] type RRtype * \return rrset_type* RRset, if found * */ rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner, ldns_rr_type type); /** * Add RR. * \param[in] zone zone * \param[in] rr rr * \param[in] do_stats true if we need to maintain statistics * \return ods_status status * ODS_STATUS_OK: rr to be added to zone * ODS_STATUS_UNCHANGED: rr not added to zone, rr already exists * other: rr not added to zone, error occurred * */ ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats); /** * Delete RR. * \param[in] zone zone * \param[in] rr rr * \param[in] do_stats true if we need to maintain statistics * \return ods_status status * ODS_STATUS_OK: rr to be removed from zone * ODS_STATUS_UNCHANGED: rr not removed from zone, rr does not exist * other: rr not removed from zone, error occurred * */ ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats); /** * Merge zones. Values that are merged: * - policy name * - signconf filename * - input and output adapter * * \param[in] z1 zone * \param[in] z2 zone with new values * */ void zone_merge(zone_type* z1, zone_type* z2); /** * Clean up zone. * \param[in] zone zone * */ void zone_cleanup(zone_type* zone); /** * Backup zone. * \param[in] zone corresponding zone * \return ods_status status * */ ods_status zone_backup2(zone_type* zone); /** * Recover zone from backup. * \param[in] zone corresponding zone * */ ods_status zone_recover2(zone_type* zone); #endif /* SIGNER_ZONE_H */ opendnssec-1.4.3/signer/src/signer/nsec3params.c0000664000175000017500000001460312107367651016547 00000000000000/* * $Id: nsec3params.c 7040 2013-02-15 08:19:53Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * NSEC3 Parameters. * */ #include "shared/allocator.h" #include "shared/log.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/nsec3params.h" #include "signer/signconf.h" #include #include #include #include static const char* nsec3_str = "nsec3"; /** * Create NSEC3 salt. * */ ods_status nsec3params_create_salt(const char* salt_str, uint8_t* salt_len, uint8_t** salt) { uint8_t c; uint8_t* salt_tmp; if (!salt_str) { *salt_len = 0; *salt = NULL; return ODS_STATUS_OK; } *salt_len = (uint8_t) strlen(salt_str); if (*salt_len == 1 && salt_str[0] == '-') { *salt_len = 0; *salt = NULL; return ODS_STATUS_OK; } else if (*salt_len % 2 != 0) { ods_log_error("[%s] invalid salt %s", nsec3_str, salt_str); *salt = NULL; return ODS_STATUS_ERR; } /* construct salt data */ salt_tmp = (uint8_t*) calloc(*salt_len / 2, sizeof(uint8_t)); if (!salt_tmp) { ods_log_error("[%s] construct salt data for %s failed", nsec3_str, salt_str); *salt = NULL; return ODS_STATUS_MALLOC_ERR; } for (c = 0; c < *salt_len; c += 2) { if (isxdigit((int) salt_str[c]) && isxdigit((int) salt_str[c+1])) { salt_tmp[c/2] = (uint8_t) ldns_hexdigit_to_int(salt_str[c]) * 16 + ldns_hexdigit_to_int(salt_str[c+1]); } else { ods_log_error("[%s] invalid salt %s", nsec3_str, salt_str); free((void*)salt_tmp); *salt = NULL; return ODS_STATUS_ERR; } } *salt_len = *salt_len / 2; /* update length */ *salt = salt_tmp; return ODS_STATUS_OK; } /** * Create new NSEC3 parameters. * */ nsec3params_type* nsec3params_create(void* sc, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt) { nsec3params_type* nsec3params = NULL; signconf_type* signconf = (signconf_type*) sc; uint8_t salt_len; /* calculate salt len */ uint8_t* salt_data; /* calculate salt data */ if (!sc) { return NULL; } nsec3params = (nsec3params_type*) allocator_alloc(signconf->allocator, sizeof(nsec3params_type)); if (!nsec3params) { ods_log_error("[%s] unable to create: allocator_alloc() failed", nsec3_str); return NULL; } nsec3params->sc = sc; nsec3params->algorithm = algo; nsec3params->flags = flags; nsec3params->iterations = iter; /* construct the salt from the string */ if (nsec3params_create_salt(salt, &salt_len, &salt_data) != 0) { ods_log_error("[%s] unable to create: create salt failed", nsec3_str); allocator_deallocate(signconf->allocator, (void*)nsec3params); return NULL; } nsec3params->salt_len = salt_len; nsec3params->salt_data = salt_data; nsec3params->rr = NULL; return nsec3params; } /** * Backup NSEC3 parameters. * */ void nsec3params_backup(FILE* fd, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt, ldns_rr* rr, const char* version) { if (!fd) { return; } fprintf(fd, ";;Nsec3parameters: salt %s algorithm %u optout %u " "iterations %u\n", salt?salt:"-", (unsigned) algo, (unsigned) flags, (unsigned) iter); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) == 0) { if (rr) { (void)util_rr_print(fd, rr); } fprintf(fd, ";;Nsec3done\n"); fprintf(fd, ";;\n"); } return; } /** * Convert salt to string. * */ const char* nsec3params_salt2str(nsec3params_type* nsec3params) { uint8_t *data; uint8_t salt_length = 0; uint8_t salt_pos = 0; int written = 0; char* str = NULL; ldns_buffer* buffer = NULL; salt_length = nsec3params->salt_len; data = nsec3params->salt_data; /* from now there are variable length entries so remember pos */ if (salt_length == 0) { buffer = ldns_buffer_new(2); written = ldns_buffer_printf(buffer, "-"); } else { buffer = ldns_buffer_new(salt_pos+1); for (salt_pos = 0; salt_pos < salt_length; salt_pos++) { written = ldns_buffer_printf(buffer, "%02x", data[salt_pos]); } } if (ldns_buffer_status(buffer) == LDNS_STATUS_OK) { str = ldns_buffer2str(buffer); } else if (written) { ods_log_error("[%s] unable to convert nsec3 salt to string: %s", nsec3_str, ldns_get_errorstr_by_id(ldns_buffer_status(buffer))); } else { ods_log_error("[%s] unable to convert nsec3 salt to string: zero " "bytes written", nsec3_str); } ldns_buffer_free(buffer); return (const char*) str; } /** * Clean up NSEC3 parameters. * */ void nsec3params_cleanup(nsec3params_type* nsec3params) { signconf_type* sc = NULL; if (!nsec3params) { return; } sc = (signconf_type*) nsec3params->sc; allocator_deallocate(sc->allocator, (void*) nsec3params->salt_data); allocator_deallocate(sc->allocator, (void*) nsec3params); return; } opendnssec-1.4.3/signer/src/signer/keys.h0000664000175000017500000001005611732103213015267 00000000000000/* * $Id: keys.h 6215 2012-03-20 13:30:51Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Signing keys. * */ #ifndef SIGNER_KEYS_H #define SIGNER_KEYS_H #include "shared/allocator.h" #include "shared/status.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include /** * Key. * */ typedef struct key_struct key_type; struct key_struct { ldns_rr* dnskey; hsm_key_t* hsmkey; hsm_sign_params_t* params; const char* locator; uint8_t algorithm; uint32_t flags; int publish; int ksk; int zsk; }; /** * Key list. * */ typedef struct keylist_struct keylist_type; struct keylist_struct { void* sc; key_type* keys; size_t count; }; /** * Create a new key list. * \param[in] sc signer configuration reference * \return keylist_type* key list * */ keylist_type* keylist_create(void* sc); /** * Lookup a key in the key list by locator. * \param[in] kl key list * \param[in] locator key locator * \return key_type* key if it exists, NULL otherwise * */ key_type* keylist_lookup_by_locator(keylist_type* kl, const char* locator); /** * Lookup a key in the key list by dnskey. * \param[in] kl key list * \param[in] dnskey dnskey * \return key_type* key if it exists, NULL otherwise * */ key_type* keylist_lookup_by_dnskey(keylist_type* kl, ldns_rr* dnskey); /** * Push a key to the keylist. * \param[in] kl key list * \param[in] locator string that identifies location of key * \param[in] algorithm DNSKEY algorithm field value * \param[in] flags DNSKEY flags field value * \param[in] publish if true, publish key as a DNSKEY * \param[in] ksk if true, sign DNSKEY RRset with this key * \param[in] zsk if true, sign all but DNSKEY RRset with this key * \return key_type* key * */ key_type* keylist_push(keylist_type* kl, const char* locator, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk); /** * Print key list. * \param[in] fd file descriptor * \param[in] kl key list to print * */ void keylist_print(FILE* fd, keylist_type* kl); /** * Log key list. * \param[in] kl key list to print * \param[in] name zone name * */ void keylist_log(keylist_type* kl, const char* name); /** * Clean up key list. * \param[in] kl key list to clean up * */ void keylist_cleanup(keylist_type* kl); /** * Recover key from backup. * \param[in] fd file descriptor of key backup file * \param[in] kl key list to print * \return key_type* key * */ key_type* key_recover2(FILE* fd, keylist_type* kl); /** * Backup key list. * \param[in] fd file descriptor * \param[in] kl key list to print * \param[in] version version string * */ void keylist_backup(FILE* fd, keylist_type* kl, const char* version); #endif /* SIGNER_KEYS_H */ opendnssec-1.4.3/signer/src/Makefile.in0000664000175000017500000033735412247571140014750 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6368 2012-06-04 10:11:42Z matthijs $ VPATH = @srcdir@ 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 = ods-signerd$(EXEEXT) ods-signer$(EXEEXT) subdir = signer/src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_ods_signer_OBJECTS = ods-signer.$(OBJEXT) allocator.$(OBJEXT) \ duration.$(OBJEXT) file.$(OBJEXT) log.$(OBJEXT) util.$(OBJEXT) ods_signer_OBJECTS = $(am_ods_signer_OBJECTS) ods_signer_DEPENDENCIES = $(LIBHSM) am_ods_signerd_OBJECTS = ods-signerd.$(OBJEXT) adapi.$(OBJEXT) \ adapter.$(OBJEXT) addns.$(OBJEXT) adfile.$(OBJEXT) \ adutil.$(OBJEXT) cfg.$(OBJEXT) cmdhandler.$(OBJEXT) \ dnshandler.$(OBJEXT) xfrhandler.$(OBJEXT) engine.$(OBJEXT) \ signal.$(OBJEXT) worker.$(OBJEXT) addnsparser.$(OBJEXT) \ confparser.$(OBJEXT) signconfparser.$(OBJEXT) \ zonelistparser.$(OBJEXT) fifoq.$(OBJEXT) schedule.$(OBJEXT) \ task.$(OBJEXT) allocator.$(OBJEXT) duration.$(OBJEXT) \ file.$(OBJEXT) hsm.$(OBJEXT) locks.$(OBJEXT) log.$(OBJEXT) \ privdrop.$(OBJEXT) status.$(OBJEXT) util.$(OBJEXT) \ backup.$(OBJEXT) denial.$(OBJEXT) domain.$(OBJEXT) \ ixfr.$(OBJEXT) keys.$(OBJEXT) namedb.$(OBJEXT) \ nsec3params.$(OBJEXT) rrset.$(OBJEXT) signconf.$(OBJEXT) \ stats.$(OBJEXT) tools.$(OBJEXT) zone.$(OBJEXT) \ zonelist.$(OBJEXT) acl.$(OBJEXT) axfr.$(OBJEXT) \ buffer.$(OBJEXT) edns.$(OBJEXT) listener.$(OBJEXT) \ netio.$(OBJEXT) notify.$(OBJEXT) query.$(OBJEXT) \ sock.$(OBJEXT) tcpset.$(OBJEXT) tsig.$(OBJEXT) \ tsig-openssl.$(OBJEXT) xfrd.$(OBJEXT) ods_signerd_OBJECTS = $(am_ods_signerd_OBJECTS) ods_signerd_DEPENDENCIES = $(LIBHSM) $(LIBCOMPAT) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common 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 = $(ods_signer_SOURCES) $(ods_signerd_SOURCES) DIST_SOURCES = $(ods_signer_SOURCES) $(ods_signerd_SOURCES) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBHSM = ${top_builddir}/libhsm/src/lib/libhsm.a LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(top_srcdir)/libhsm/src/lib \ @SSL_INCLUDES@ \ @XML2_INCLUDES@ \ @LDNS_INCLUDES@ signerdir = @libdir@/opendnssec/signer # man8_MANS = man/ods-signer.8 man/ods-signerd.8 ods_signerd_SOURCES = ods-signerd.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_signerd_LDADD = $(LIBHSM) $(LIBCOMPAT) @LDNS_LIBS@ @XML2_LIBS@ \ @PTHREAD_LIBS@ @RT_LIBS@ @SSL_LIBS@ @C_LIBS@ $(am__empty) ods_signer_SOURCES = ods-signer.c \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/log.c shared/log.h \ shared/util.c shared/util.h ods_signer_LDADD = $(LIBHSM) @LDNS_LIBS@ @XML2_LIBS@ 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 signer/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign signer/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) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ 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 ods-signer$(EXEEXT): $(ods_signer_OBJECTS) $(ods_signer_DEPENDENCIES) $(EXTRA_ods_signer_DEPENDENCIES) @rm -f ods-signer$(EXEEXT) $(LINK) $(ods_signer_OBJECTS) $(ods_signer_LDADD) $(LIBS) ods-signerd$(EXEEXT): $(ods_signerd_OBJECTS) $(ods_signerd_DEPENDENCIES) $(EXTRA_ods_signerd_DEPENDENCIES) @rm -f ods-signerd$(EXEEXT) $(LINK) $(ods_signerd_OBJECTS) $(ods_signerd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adapter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addns.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addnsparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/axfr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdhandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/denial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnshandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/domain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/duration.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edns.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifoq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ixfr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namedb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsec3params.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ods-signer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ods-signerd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privdrop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedule.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signconfparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsig-openssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfrd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfrhandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zone.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zonelist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zonelistparser.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 $@ $< allocator.o: shared/allocator.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT allocator.o -MD -MP -MF $(DEPDIR)/allocator.Tpo -c -o allocator.o `test -f 'shared/allocator.c' || echo '$(srcdir)/'`shared/allocator.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/allocator.Tpo $(DEPDIR)/allocator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/allocator.c' object='allocator.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) $(AM_CFLAGS) $(CFLAGS) -c -o allocator.o `test -f 'shared/allocator.c' || echo '$(srcdir)/'`shared/allocator.c allocator.obj: shared/allocator.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT allocator.obj -MD -MP -MF $(DEPDIR)/allocator.Tpo -c -o allocator.obj `if test -f 'shared/allocator.c'; then $(CYGPATH_W) 'shared/allocator.c'; else $(CYGPATH_W) '$(srcdir)/shared/allocator.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/allocator.Tpo $(DEPDIR)/allocator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/allocator.c' object='allocator.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) $(AM_CFLAGS) $(CFLAGS) -c -o allocator.obj `if test -f 'shared/allocator.c'; then $(CYGPATH_W) 'shared/allocator.c'; else $(CYGPATH_W) '$(srcdir)/shared/allocator.c'; fi` duration.o: shared/duration.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT duration.o -MD -MP -MF $(DEPDIR)/duration.Tpo -c -o duration.o `test -f 'shared/duration.c' || echo '$(srcdir)/'`shared/duration.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/duration.Tpo $(DEPDIR)/duration.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/duration.c' object='duration.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) $(AM_CFLAGS) $(CFLAGS) -c -o duration.o `test -f 'shared/duration.c' || echo '$(srcdir)/'`shared/duration.c duration.obj: shared/duration.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT duration.obj -MD -MP -MF $(DEPDIR)/duration.Tpo -c -o duration.obj `if test -f 'shared/duration.c'; then $(CYGPATH_W) 'shared/duration.c'; else $(CYGPATH_W) '$(srcdir)/shared/duration.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/duration.Tpo $(DEPDIR)/duration.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/duration.c' object='duration.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) $(AM_CFLAGS) $(CFLAGS) -c -o duration.obj `if test -f 'shared/duration.c'; then $(CYGPATH_W) 'shared/duration.c'; else $(CYGPATH_W) '$(srcdir)/shared/duration.c'; fi` file.o: shared/file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f 'shared/file.c' || echo '$(srcdir)/'`shared/file.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/file.c' object='file.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) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f 'shared/file.c' || echo '$(srcdir)/'`shared/file.c file.obj: shared/file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f 'shared/file.c'; then $(CYGPATH_W) 'shared/file.c'; else $(CYGPATH_W) '$(srcdir)/shared/file.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/file.c' object='file.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) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f 'shared/file.c'; then $(CYGPATH_W) 'shared/file.c'; else $(CYGPATH_W) '$(srcdir)/shared/file.c'; fi` log.o: shared/log.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.o -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.o `test -f 'shared/log.c' || echo '$(srcdir)/'`shared/log.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/log.c' object='log.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) $(AM_CFLAGS) $(CFLAGS) -c -o log.o `test -f 'shared/log.c' || echo '$(srcdir)/'`shared/log.c log.obj: shared/log.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.obj -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.obj `if test -f 'shared/log.c'; then $(CYGPATH_W) 'shared/log.c'; else $(CYGPATH_W) '$(srcdir)/shared/log.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/log.c' object='log.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) $(AM_CFLAGS) $(CFLAGS) -c -o log.obj `if test -f 'shared/log.c'; then $(CYGPATH_W) 'shared/log.c'; else $(CYGPATH_W) '$(srcdir)/shared/log.c'; fi` util.o: shared/util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT util.o -MD -MP -MF $(DEPDIR)/util.Tpo -c -o util.o `test -f 'shared/util.c' || echo '$(srcdir)/'`shared/util.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/util.Tpo $(DEPDIR)/util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/util.c' object='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) $(AM_CFLAGS) $(CFLAGS) -c -o util.o `test -f 'shared/util.c' || echo '$(srcdir)/'`shared/util.c util.obj: shared/util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT util.obj -MD -MP -MF $(DEPDIR)/util.Tpo -c -o util.obj `if test -f 'shared/util.c'; then $(CYGPATH_W) 'shared/util.c'; else $(CYGPATH_W) '$(srcdir)/shared/util.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/util.Tpo $(DEPDIR)/util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/util.c' object='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) $(AM_CFLAGS) $(CFLAGS) -c -o util.obj `if test -f 'shared/util.c'; then $(CYGPATH_W) 'shared/util.c'; else $(CYGPATH_W) '$(srcdir)/shared/util.c'; fi` adapi.o: adapter/adapi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapi.o -MD -MP -MF $(DEPDIR)/adapi.Tpo -c -o adapi.o `test -f 'adapter/adapi.c' || echo '$(srcdir)/'`adapter/adapi.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adapi.Tpo $(DEPDIR)/adapi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adapi.c' object='adapi.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) $(AM_CFLAGS) $(CFLAGS) -c -o adapi.o `test -f 'adapter/adapi.c' || echo '$(srcdir)/'`adapter/adapi.c adapi.obj: adapter/adapi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapi.obj -MD -MP -MF $(DEPDIR)/adapi.Tpo -c -o adapi.obj `if test -f 'adapter/adapi.c'; then $(CYGPATH_W) 'adapter/adapi.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapi.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adapi.Tpo $(DEPDIR)/adapi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adapi.c' object='adapi.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) $(AM_CFLAGS) $(CFLAGS) -c -o adapi.obj `if test -f 'adapter/adapi.c'; then $(CYGPATH_W) 'adapter/adapi.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapi.c'; fi` adapter.o: adapter/adapter.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapter.o -MD -MP -MF $(DEPDIR)/adapter.Tpo -c -o adapter.o `test -f 'adapter/adapter.c' || echo '$(srcdir)/'`adapter/adapter.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adapter.Tpo $(DEPDIR)/adapter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adapter.c' object='adapter.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) $(AM_CFLAGS) $(CFLAGS) -c -o adapter.o `test -f 'adapter/adapter.c' || echo '$(srcdir)/'`adapter/adapter.c adapter.obj: adapter/adapter.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapter.obj -MD -MP -MF $(DEPDIR)/adapter.Tpo -c -o adapter.obj `if test -f 'adapter/adapter.c'; then $(CYGPATH_W) 'adapter/adapter.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapter.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adapter.Tpo $(DEPDIR)/adapter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adapter.c' object='adapter.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) $(AM_CFLAGS) $(CFLAGS) -c -o adapter.obj `if test -f 'adapter/adapter.c'; then $(CYGPATH_W) 'adapter/adapter.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapter.c'; fi` addns.o: adapter/addns.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addns.o -MD -MP -MF $(DEPDIR)/addns.Tpo -c -o addns.o `test -f 'adapter/addns.c' || echo '$(srcdir)/'`adapter/addns.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/addns.Tpo $(DEPDIR)/addns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/addns.c' object='addns.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) $(AM_CFLAGS) $(CFLAGS) -c -o addns.o `test -f 'adapter/addns.c' || echo '$(srcdir)/'`adapter/addns.c addns.obj: adapter/addns.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addns.obj -MD -MP -MF $(DEPDIR)/addns.Tpo -c -o addns.obj `if test -f 'adapter/addns.c'; then $(CYGPATH_W) 'adapter/addns.c'; else $(CYGPATH_W) '$(srcdir)/adapter/addns.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/addns.Tpo $(DEPDIR)/addns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/addns.c' object='addns.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) $(AM_CFLAGS) $(CFLAGS) -c -o addns.obj `if test -f 'adapter/addns.c'; then $(CYGPATH_W) 'adapter/addns.c'; else $(CYGPATH_W) '$(srcdir)/adapter/addns.c'; fi` adfile.o: adapter/adfile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adfile.o -MD -MP -MF $(DEPDIR)/adfile.Tpo -c -o adfile.o `test -f 'adapter/adfile.c' || echo '$(srcdir)/'`adapter/adfile.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adfile.Tpo $(DEPDIR)/adfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adfile.c' object='adfile.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) $(AM_CFLAGS) $(CFLAGS) -c -o adfile.o `test -f 'adapter/adfile.c' || echo '$(srcdir)/'`adapter/adfile.c adfile.obj: adapter/adfile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adfile.obj -MD -MP -MF $(DEPDIR)/adfile.Tpo -c -o adfile.obj `if test -f 'adapter/adfile.c'; then $(CYGPATH_W) 'adapter/adfile.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adfile.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adfile.Tpo $(DEPDIR)/adfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adfile.c' object='adfile.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) $(AM_CFLAGS) $(CFLAGS) -c -o adfile.obj `if test -f 'adapter/adfile.c'; then $(CYGPATH_W) 'adapter/adfile.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adfile.c'; fi` adutil.o: adapter/adutil.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adutil.o -MD -MP -MF $(DEPDIR)/adutil.Tpo -c -o adutil.o `test -f 'adapter/adutil.c' || echo '$(srcdir)/'`adapter/adutil.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adutil.Tpo $(DEPDIR)/adutil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adutil.c' object='adutil.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) $(AM_CFLAGS) $(CFLAGS) -c -o adutil.o `test -f 'adapter/adutil.c' || echo '$(srcdir)/'`adapter/adutil.c adutil.obj: adapter/adutil.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adutil.obj -MD -MP -MF $(DEPDIR)/adutil.Tpo -c -o adutil.obj `if test -f 'adapter/adutil.c'; then $(CYGPATH_W) 'adapter/adutil.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adutil.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/adutil.Tpo $(DEPDIR)/adutil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='adapter/adutil.c' object='adutil.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) $(AM_CFLAGS) $(CFLAGS) -c -o adutil.obj `if test -f 'adapter/adutil.c'; then $(CYGPATH_W) 'adapter/adutil.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adutil.c'; fi` cfg.o: daemon/cfg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cfg.o -MD -MP -MF $(DEPDIR)/cfg.Tpo -c -o cfg.o `test -f 'daemon/cfg.c' || echo '$(srcdir)/'`daemon/cfg.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cfg.Tpo $(DEPDIR)/cfg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/cfg.c' object='cfg.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) $(AM_CFLAGS) $(CFLAGS) -c -o cfg.o `test -f 'daemon/cfg.c' || echo '$(srcdir)/'`daemon/cfg.c cfg.obj: daemon/cfg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cfg.obj -MD -MP -MF $(DEPDIR)/cfg.Tpo -c -o cfg.obj `if test -f 'daemon/cfg.c'; then $(CYGPATH_W) 'daemon/cfg.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cfg.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cfg.Tpo $(DEPDIR)/cfg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/cfg.c' object='cfg.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) $(AM_CFLAGS) $(CFLAGS) -c -o cfg.obj `if test -f 'daemon/cfg.c'; then $(CYGPATH_W) 'daemon/cfg.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cfg.c'; fi` cmdhandler.o: daemon/cmdhandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmdhandler.o -MD -MP -MF $(DEPDIR)/cmdhandler.Tpo -c -o cmdhandler.o `test -f 'daemon/cmdhandler.c' || echo '$(srcdir)/'`daemon/cmdhandler.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cmdhandler.Tpo $(DEPDIR)/cmdhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/cmdhandler.c' object='cmdhandler.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) $(AM_CFLAGS) $(CFLAGS) -c -o cmdhandler.o `test -f 'daemon/cmdhandler.c' || echo '$(srcdir)/'`daemon/cmdhandler.c cmdhandler.obj: daemon/cmdhandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmdhandler.obj -MD -MP -MF $(DEPDIR)/cmdhandler.Tpo -c -o cmdhandler.obj `if test -f 'daemon/cmdhandler.c'; then $(CYGPATH_W) 'daemon/cmdhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cmdhandler.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cmdhandler.Tpo $(DEPDIR)/cmdhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/cmdhandler.c' object='cmdhandler.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) $(AM_CFLAGS) $(CFLAGS) -c -o cmdhandler.obj `if test -f 'daemon/cmdhandler.c'; then $(CYGPATH_W) 'daemon/cmdhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cmdhandler.c'; fi` dnshandler.o: daemon/dnshandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dnshandler.o -MD -MP -MF $(DEPDIR)/dnshandler.Tpo -c -o dnshandler.o `test -f 'daemon/dnshandler.c' || echo '$(srcdir)/'`daemon/dnshandler.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dnshandler.Tpo $(DEPDIR)/dnshandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/dnshandler.c' object='dnshandler.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) $(AM_CFLAGS) $(CFLAGS) -c -o dnshandler.o `test -f 'daemon/dnshandler.c' || echo '$(srcdir)/'`daemon/dnshandler.c dnshandler.obj: daemon/dnshandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dnshandler.obj -MD -MP -MF $(DEPDIR)/dnshandler.Tpo -c -o dnshandler.obj `if test -f 'daemon/dnshandler.c'; then $(CYGPATH_W) 'daemon/dnshandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/dnshandler.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dnshandler.Tpo $(DEPDIR)/dnshandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/dnshandler.c' object='dnshandler.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) $(AM_CFLAGS) $(CFLAGS) -c -o dnshandler.obj `if test -f 'daemon/dnshandler.c'; then $(CYGPATH_W) 'daemon/dnshandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/dnshandler.c'; fi` xfrhandler.o: daemon/xfrhandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrhandler.o -MD -MP -MF $(DEPDIR)/xfrhandler.Tpo -c -o xfrhandler.o `test -f 'daemon/xfrhandler.c' || echo '$(srcdir)/'`daemon/xfrhandler.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xfrhandler.Tpo $(DEPDIR)/xfrhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/xfrhandler.c' object='xfrhandler.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) $(AM_CFLAGS) $(CFLAGS) -c -o xfrhandler.o `test -f 'daemon/xfrhandler.c' || echo '$(srcdir)/'`daemon/xfrhandler.c xfrhandler.obj: daemon/xfrhandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrhandler.obj -MD -MP -MF $(DEPDIR)/xfrhandler.Tpo -c -o xfrhandler.obj `if test -f 'daemon/xfrhandler.c'; then $(CYGPATH_W) 'daemon/xfrhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/xfrhandler.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xfrhandler.Tpo $(DEPDIR)/xfrhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/xfrhandler.c' object='xfrhandler.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) $(AM_CFLAGS) $(CFLAGS) -c -o xfrhandler.obj `if test -f 'daemon/xfrhandler.c'; then $(CYGPATH_W) 'daemon/xfrhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/xfrhandler.c'; fi` engine.o: daemon/engine.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT engine.o -MD -MP -MF $(DEPDIR)/engine.Tpo -c -o engine.o `test -f 'daemon/engine.c' || echo '$(srcdir)/'`daemon/engine.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/engine.Tpo $(DEPDIR)/engine.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/engine.c' object='engine.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) $(AM_CFLAGS) $(CFLAGS) -c -o engine.o `test -f 'daemon/engine.c' || echo '$(srcdir)/'`daemon/engine.c engine.obj: daemon/engine.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT engine.obj -MD -MP -MF $(DEPDIR)/engine.Tpo -c -o engine.obj `if test -f 'daemon/engine.c'; then $(CYGPATH_W) 'daemon/engine.c'; else $(CYGPATH_W) '$(srcdir)/daemon/engine.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/engine.Tpo $(DEPDIR)/engine.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/engine.c' object='engine.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) $(AM_CFLAGS) $(CFLAGS) -c -o engine.obj `if test -f 'daemon/engine.c'; then $(CYGPATH_W) 'daemon/engine.c'; else $(CYGPATH_W) '$(srcdir)/daemon/engine.c'; fi` signal.o: daemon/signal.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signal.o -MD -MP -MF $(DEPDIR)/signal.Tpo -c -o signal.o `test -f 'daemon/signal.c' || echo '$(srcdir)/'`daemon/signal.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/signal.Tpo $(DEPDIR)/signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/signal.c' object='signal.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) $(AM_CFLAGS) $(CFLAGS) -c -o signal.o `test -f 'daemon/signal.c' || echo '$(srcdir)/'`daemon/signal.c signal.obj: daemon/signal.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signal.obj -MD -MP -MF $(DEPDIR)/signal.Tpo -c -o signal.obj `if test -f 'daemon/signal.c'; then $(CYGPATH_W) 'daemon/signal.c'; else $(CYGPATH_W) '$(srcdir)/daemon/signal.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/signal.Tpo $(DEPDIR)/signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/signal.c' object='signal.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) $(AM_CFLAGS) $(CFLAGS) -c -o signal.obj `if test -f 'daemon/signal.c'; then $(CYGPATH_W) 'daemon/signal.c'; else $(CYGPATH_W) '$(srcdir)/daemon/signal.c'; fi` worker.o: daemon/worker.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT worker.o -MD -MP -MF $(DEPDIR)/worker.Tpo -c -o worker.o `test -f 'daemon/worker.c' || echo '$(srcdir)/'`daemon/worker.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/worker.Tpo $(DEPDIR)/worker.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/worker.c' object='worker.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) $(AM_CFLAGS) $(CFLAGS) -c -o worker.o `test -f 'daemon/worker.c' || echo '$(srcdir)/'`daemon/worker.c worker.obj: daemon/worker.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT worker.obj -MD -MP -MF $(DEPDIR)/worker.Tpo -c -o worker.obj `if test -f 'daemon/worker.c'; then $(CYGPATH_W) 'daemon/worker.c'; else $(CYGPATH_W) '$(srcdir)/daemon/worker.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/worker.Tpo $(DEPDIR)/worker.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='daemon/worker.c' object='worker.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) $(AM_CFLAGS) $(CFLAGS) -c -o worker.obj `if test -f 'daemon/worker.c'; then $(CYGPATH_W) 'daemon/worker.c'; else $(CYGPATH_W) '$(srcdir)/daemon/worker.c'; fi` addnsparser.o: parser/addnsparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addnsparser.o -MD -MP -MF $(DEPDIR)/addnsparser.Tpo -c -o addnsparser.o `test -f 'parser/addnsparser.c' || echo '$(srcdir)/'`parser/addnsparser.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/addnsparser.Tpo $(DEPDIR)/addnsparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/addnsparser.c' object='addnsparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o addnsparser.o `test -f 'parser/addnsparser.c' || echo '$(srcdir)/'`parser/addnsparser.c addnsparser.obj: parser/addnsparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addnsparser.obj -MD -MP -MF $(DEPDIR)/addnsparser.Tpo -c -o addnsparser.obj `if test -f 'parser/addnsparser.c'; then $(CYGPATH_W) 'parser/addnsparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/addnsparser.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/addnsparser.Tpo $(DEPDIR)/addnsparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/addnsparser.c' object='addnsparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o addnsparser.obj `if test -f 'parser/addnsparser.c'; then $(CYGPATH_W) 'parser/addnsparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/addnsparser.c'; fi` confparser.o: parser/confparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT confparser.o -MD -MP -MF $(DEPDIR)/confparser.Tpo -c -o confparser.o `test -f 'parser/confparser.c' || echo '$(srcdir)/'`parser/confparser.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/confparser.Tpo $(DEPDIR)/confparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/confparser.c' object='confparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o confparser.o `test -f 'parser/confparser.c' || echo '$(srcdir)/'`parser/confparser.c confparser.obj: parser/confparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT confparser.obj -MD -MP -MF $(DEPDIR)/confparser.Tpo -c -o confparser.obj `if test -f 'parser/confparser.c'; then $(CYGPATH_W) 'parser/confparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/confparser.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/confparser.Tpo $(DEPDIR)/confparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/confparser.c' object='confparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o confparser.obj `if test -f 'parser/confparser.c'; then $(CYGPATH_W) 'parser/confparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/confparser.c'; fi` signconfparser.o: parser/signconfparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconfparser.o -MD -MP -MF $(DEPDIR)/signconfparser.Tpo -c -o signconfparser.o `test -f 'parser/signconfparser.c' || echo '$(srcdir)/'`parser/signconfparser.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/signconfparser.Tpo $(DEPDIR)/signconfparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/signconfparser.c' object='signconfparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o signconfparser.o `test -f 'parser/signconfparser.c' || echo '$(srcdir)/'`parser/signconfparser.c signconfparser.obj: parser/signconfparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconfparser.obj -MD -MP -MF $(DEPDIR)/signconfparser.Tpo -c -o signconfparser.obj `if test -f 'parser/signconfparser.c'; then $(CYGPATH_W) 'parser/signconfparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/signconfparser.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/signconfparser.Tpo $(DEPDIR)/signconfparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/signconfparser.c' object='signconfparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o signconfparser.obj `if test -f 'parser/signconfparser.c'; then $(CYGPATH_W) 'parser/signconfparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/signconfparser.c'; fi` zonelistparser.o: parser/zonelistparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelistparser.o -MD -MP -MF $(DEPDIR)/zonelistparser.Tpo -c -o zonelistparser.o `test -f 'parser/zonelistparser.c' || echo '$(srcdir)/'`parser/zonelistparser.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zonelistparser.Tpo $(DEPDIR)/zonelistparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/zonelistparser.c' object='zonelistparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o zonelistparser.o `test -f 'parser/zonelistparser.c' || echo '$(srcdir)/'`parser/zonelistparser.c zonelistparser.obj: parser/zonelistparser.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelistparser.obj -MD -MP -MF $(DEPDIR)/zonelistparser.Tpo -c -o zonelistparser.obj `if test -f 'parser/zonelistparser.c'; then $(CYGPATH_W) 'parser/zonelistparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/zonelistparser.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zonelistparser.Tpo $(DEPDIR)/zonelistparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser/zonelistparser.c' object='zonelistparser.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) $(AM_CFLAGS) $(CFLAGS) -c -o zonelistparser.obj `if test -f 'parser/zonelistparser.c'; then $(CYGPATH_W) 'parser/zonelistparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/zonelistparser.c'; fi` fifoq.o: scheduler/fifoq.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fifoq.o -MD -MP -MF $(DEPDIR)/fifoq.Tpo -c -o fifoq.o `test -f 'scheduler/fifoq.c' || echo '$(srcdir)/'`scheduler/fifoq.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fifoq.Tpo $(DEPDIR)/fifoq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scheduler/fifoq.c' object='fifoq.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) $(AM_CFLAGS) $(CFLAGS) -c -o fifoq.o `test -f 'scheduler/fifoq.c' || echo '$(srcdir)/'`scheduler/fifoq.c fifoq.obj: scheduler/fifoq.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fifoq.obj -MD -MP -MF $(DEPDIR)/fifoq.Tpo -c -o fifoq.obj `if test -f 'scheduler/fifoq.c'; then $(CYGPATH_W) 'scheduler/fifoq.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/fifoq.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fifoq.Tpo $(DEPDIR)/fifoq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scheduler/fifoq.c' object='fifoq.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) $(AM_CFLAGS) $(CFLAGS) -c -o fifoq.obj `if test -f 'scheduler/fifoq.c'; then $(CYGPATH_W) 'scheduler/fifoq.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/fifoq.c'; fi` schedule.o: scheduler/schedule.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT schedule.o -MD -MP -MF $(DEPDIR)/schedule.Tpo -c -o schedule.o `test -f 'scheduler/schedule.c' || echo '$(srcdir)/'`scheduler/schedule.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/schedule.Tpo $(DEPDIR)/schedule.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scheduler/schedule.c' object='schedule.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) $(AM_CFLAGS) $(CFLAGS) -c -o schedule.o `test -f 'scheduler/schedule.c' || echo '$(srcdir)/'`scheduler/schedule.c schedule.obj: scheduler/schedule.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT schedule.obj -MD -MP -MF $(DEPDIR)/schedule.Tpo -c -o schedule.obj `if test -f 'scheduler/schedule.c'; then $(CYGPATH_W) 'scheduler/schedule.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/schedule.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/schedule.Tpo $(DEPDIR)/schedule.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scheduler/schedule.c' object='schedule.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) $(AM_CFLAGS) $(CFLAGS) -c -o schedule.obj `if test -f 'scheduler/schedule.c'; then $(CYGPATH_W) 'scheduler/schedule.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/schedule.c'; fi` task.o: scheduler/task.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.o -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.o `test -f 'scheduler/task.c' || echo '$(srcdir)/'`scheduler/task.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scheduler/task.c' object='task.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) $(AM_CFLAGS) $(CFLAGS) -c -o task.o `test -f 'scheduler/task.c' || echo '$(srcdir)/'`scheduler/task.c task.obj: scheduler/task.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.obj -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.obj `if test -f 'scheduler/task.c'; then $(CYGPATH_W) 'scheduler/task.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/task.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scheduler/task.c' object='task.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) $(AM_CFLAGS) $(CFLAGS) -c -o task.obj `if test -f 'scheduler/task.c'; then $(CYGPATH_W) 'scheduler/task.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/task.c'; fi` hsm.o: shared/hsm.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hsm.o -MD -MP -MF $(DEPDIR)/hsm.Tpo -c -o hsm.o `test -f 'shared/hsm.c' || echo '$(srcdir)/'`shared/hsm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hsm.Tpo $(DEPDIR)/hsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/hsm.c' object='hsm.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) $(AM_CFLAGS) $(CFLAGS) -c -o hsm.o `test -f 'shared/hsm.c' || echo '$(srcdir)/'`shared/hsm.c hsm.obj: shared/hsm.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hsm.obj -MD -MP -MF $(DEPDIR)/hsm.Tpo -c -o hsm.obj `if test -f 'shared/hsm.c'; then $(CYGPATH_W) 'shared/hsm.c'; else $(CYGPATH_W) '$(srcdir)/shared/hsm.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hsm.Tpo $(DEPDIR)/hsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/hsm.c' object='hsm.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) $(AM_CFLAGS) $(CFLAGS) -c -o hsm.obj `if test -f 'shared/hsm.c'; then $(CYGPATH_W) 'shared/hsm.c'; else $(CYGPATH_W) '$(srcdir)/shared/hsm.c'; fi` locks.o: shared/locks.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT locks.o -MD -MP -MF $(DEPDIR)/locks.Tpo -c -o locks.o `test -f 'shared/locks.c' || echo '$(srcdir)/'`shared/locks.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/locks.Tpo $(DEPDIR)/locks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/locks.c' object='locks.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) $(AM_CFLAGS) $(CFLAGS) -c -o locks.o `test -f 'shared/locks.c' || echo '$(srcdir)/'`shared/locks.c locks.obj: shared/locks.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT locks.obj -MD -MP -MF $(DEPDIR)/locks.Tpo -c -o locks.obj `if test -f 'shared/locks.c'; then $(CYGPATH_W) 'shared/locks.c'; else $(CYGPATH_W) '$(srcdir)/shared/locks.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/locks.Tpo $(DEPDIR)/locks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/locks.c' object='locks.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) $(AM_CFLAGS) $(CFLAGS) -c -o locks.obj `if test -f 'shared/locks.c'; then $(CYGPATH_W) 'shared/locks.c'; else $(CYGPATH_W) '$(srcdir)/shared/locks.c'; fi` privdrop.o: shared/privdrop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT privdrop.o -MD -MP -MF $(DEPDIR)/privdrop.Tpo -c -o privdrop.o `test -f 'shared/privdrop.c' || echo '$(srcdir)/'`shared/privdrop.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/privdrop.Tpo $(DEPDIR)/privdrop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/privdrop.c' object='privdrop.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) $(AM_CFLAGS) $(CFLAGS) -c -o privdrop.o `test -f 'shared/privdrop.c' || echo '$(srcdir)/'`shared/privdrop.c privdrop.obj: shared/privdrop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT privdrop.obj -MD -MP -MF $(DEPDIR)/privdrop.Tpo -c -o privdrop.obj `if test -f 'shared/privdrop.c'; then $(CYGPATH_W) 'shared/privdrop.c'; else $(CYGPATH_W) '$(srcdir)/shared/privdrop.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/privdrop.Tpo $(DEPDIR)/privdrop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/privdrop.c' object='privdrop.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) $(AM_CFLAGS) $(CFLAGS) -c -o privdrop.obj `if test -f 'shared/privdrop.c'; then $(CYGPATH_W) 'shared/privdrop.c'; else $(CYGPATH_W) '$(srcdir)/shared/privdrop.c'; fi` status.o: shared/status.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT status.o -MD -MP -MF $(DEPDIR)/status.Tpo -c -o status.o `test -f 'shared/status.c' || echo '$(srcdir)/'`shared/status.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/status.Tpo $(DEPDIR)/status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/status.c' object='status.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) $(AM_CFLAGS) $(CFLAGS) -c -o status.o `test -f 'shared/status.c' || echo '$(srcdir)/'`shared/status.c status.obj: shared/status.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT status.obj -MD -MP -MF $(DEPDIR)/status.Tpo -c -o status.obj `if test -f 'shared/status.c'; then $(CYGPATH_W) 'shared/status.c'; else $(CYGPATH_W) '$(srcdir)/shared/status.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/status.Tpo $(DEPDIR)/status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shared/status.c' object='status.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) $(AM_CFLAGS) $(CFLAGS) -c -o status.obj `if test -f 'shared/status.c'; then $(CYGPATH_W) 'shared/status.c'; else $(CYGPATH_W) '$(srcdir)/shared/status.c'; fi` backup.o: signer/backup.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backup.o -MD -MP -MF $(DEPDIR)/backup.Tpo -c -o backup.o `test -f 'signer/backup.c' || echo '$(srcdir)/'`signer/backup.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/backup.Tpo $(DEPDIR)/backup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/backup.c' object='backup.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) $(AM_CFLAGS) $(CFLAGS) -c -o backup.o `test -f 'signer/backup.c' || echo '$(srcdir)/'`signer/backup.c backup.obj: signer/backup.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backup.obj -MD -MP -MF $(DEPDIR)/backup.Tpo -c -o backup.obj `if test -f 'signer/backup.c'; then $(CYGPATH_W) 'signer/backup.c'; else $(CYGPATH_W) '$(srcdir)/signer/backup.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/backup.Tpo $(DEPDIR)/backup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/backup.c' object='backup.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) $(AM_CFLAGS) $(CFLAGS) -c -o backup.obj `if test -f 'signer/backup.c'; then $(CYGPATH_W) 'signer/backup.c'; else $(CYGPATH_W) '$(srcdir)/signer/backup.c'; fi` denial.o: signer/denial.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT denial.o -MD -MP -MF $(DEPDIR)/denial.Tpo -c -o denial.o `test -f 'signer/denial.c' || echo '$(srcdir)/'`signer/denial.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/denial.Tpo $(DEPDIR)/denial.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/denial.c' object='denial.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) $(AM_CFLAGS) $(CFLAGS) -c -o denial.o `test -f 'signer/denial.c' || echo '$(srcdir)/'`signer/denial.c denial.obj: signer/denial.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT denial.obj -MD -MP -MF $(DEPDIR)/denial.Tpo -c -o denial.obj `if test -f 'signer/denial.c'; then $(CYGPATH_W) 'signer/denial.c'; else $(CYGPATH_W) '$(srcdir)/signer/denial.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/denial.Tpo $(DEPDIR)/denial.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/denial.c' object='denial.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) $(AM_CFLAGS) $(CFLAGS) -c -o denial.obj `if test -f 'signer/denial.c'; then $(CYGPATH_W) 'signer/denial.c'; else $(CYGPATH_W) '$(srcdir)/signer/denial.c'; fi` domain.o: signer/domain.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT domain.o -MD -MP -MF $(DEPDIR)/domain.Tpo -c -o domain.o `test -f 'signer/domain.c' || echo '$(srcdir)/'`signer/domain.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/domain.Tpo $(DEPDIR)/domain.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/domain.c' object='domain.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) $(AM_CFLAGS) $(CFLAGS) -c -o domain.o `test -f 'signer/domain.c' || echo '$(srcdir)/'`signer/domain.c domain.obj: signer/domain.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT domain.obj -MD -MP -MF $(DEPDIR)/domain.Tpo -c -o domain.obj `if test -f 'signer/domain.c'; then $(CYGPATH_W) 'signer/domain.c'; else $(CYGPATH_W) '$(srcdir)/signer/domain.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/domain.Tpo $(DEPDIR)/domain.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/domain.c' object='domain.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) $(AM_CFLAGS) $(CFLAGS) -c -o domain.obj `if test -f 'signer/domain.c'; then $(CYGPATH_W) 'signer/domain.c'; else $(CYGPATH_W) '$(srcdir)/signer/domain.c'; fi` ixfr.o: signer/ixfr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ixfr.o -MD -MP -MF $(DEPDIR)/ixfr.Tpo -c -o ixfr.o `test -f 'signer/ixfr.c' || echo '$(srcdir)/'`signer/ixfr.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ixfr.Tpo $(DEPDIR)/ixfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/ixfr.c' object='ixfr.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) $(AM_CFLAGS) $(CFLAGS) -c -o ixfr.o `test -f 'signer/ixfr.c' || echo '$(srcdir)/'`signer/ixfr.c ixfr.obj: signer/ixfr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ixfr.obj -MD -MP -MF $(DEPDIR)/ixfr.Tpo -c -o ixfr.obj `if test -f 'signer/ixfr.c'; then $(CYGPATH_W) 'signer/ixfr.c'; else $(CYGPATH_W) '$(srcdir)/signer/ixfr.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ixfr.Tpo $(DEPDIR)/ixfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/ixfr.c' object='ixfr.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) $(AM_CFLAGS) $(CFLAGS) -c -o ixfr.obj `if test -f 'signer/ixfr.c'; then $(CYGPATH_W) 'signer/ixfr.c'; else $(CYGPATH_W) '$(srcdir)/signer/ixfr.c'; fi` keys.o: signer/keys.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keys.o -MD -MP -MF $(DEPDIR)/keys.Tpo -c -o keys.o `test -f 'signer/keys.c' || echo '$(srcdir)/'`signer/keys.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/keys.Tpo $(DEPDIR)/keys.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/keys.c' object='keys.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) $(AM_CFLAGS) $(CFLAGS) -c -o keys.o `test -f 'signer/keys.c' || echo '$(srcdir)/'`signer/keys.c keys.obj: signer/keys.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keys.obj -MD -MP -MF $(DEPDIR)/keys.Tpo -c -o keys.obj `if test -f 'signer/keys.c'; then $(CYGPATH_W) 'signer/keys.c'; else $(CYGPATH_W) '$(srcdir)/signer/keys.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/keys.Tpo $(DEPDIR)/keys.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/keys.c' object='keys.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) $(AM_CFLAGS) $(CFLAGS) -c -o keys.obj `if test -f 'signer/keys.c'; then $(CYGPATH_W) 'signer/keys.c'; else $(CYGPATH_W) '$(srcdir)/signer/keys.c'; fi` namedb.o: signer/namedb.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT namedb.o -MD -MP -MF $(DEPDIR)/namedb.Tpo -c -o namedb.o `test -f 'signer/namedb.c' || echo '$(srcdir)/'`signer/namedb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/namedb.Tpo $(DEPDIR)/namedb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/namedb.c' object='namedb.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) $(AM_CFLAGS) $(CFLAGS) -c -o namedb.o `test -f 'signer/namedb.c' || echo '$(srcdir)/'`signer/namedb.c namedb.obj: signer/namedb.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT namedb.obj -MD -MP -MF $(DEPDIR)/namedb.Tpo -c -o namedb.obj `if test -f 'signer/namedb.c'; then $(CYGPATH_W) 'signer/namedb.c'; else $(CYGPATH_W) '$(srcdir)/signer/namedb.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/namedb.Tpo $(DEPDIR)/namedb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/namedb.c' object='namedb.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) $(AM_CFLAGS) $(CFLAGS) -c -o namedb.obj `if test -f 'signer/namedb.c'; then $(CYGPATH_W) 'signer/namedb.c'; else $(CYGPATH_W) '$(srcdir)/signer/namedb.c'; fi` nsec3params.o: signer/nsec3params.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nsec3params.o -MD -MP -MF $(DEPDIR)/nsec3params.Tpo -c -o nsec3params.o `test -f 'signer/nsec3params.c' || echo '$(srcdir)/'`signer/nsec3params.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nsec3params.Tpo $(DEPDIR)/nsec3params.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/nsec3params.c' object='nsec3params.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) $(AM_CFLAGS) $(CFLAGS) -c -o nsec3params.o `test -f 'signer/nsec3params.c' || echo '$(srcdir)/'`signer/nsec3params.c nsec3params.obj: signer/nsec3params.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nsec3params.obj -MD -MP -MF $(DEPDIR)/nsec3params.Tpo -c -o nsec3params.obj `if test -f 'signer/nsec3params.c'; then $(CYGPATH_W) 'signer/nsec3params.c'; else $(CYGPATH_W) '$(srcdir)/signer/nsec3params.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nsec3params.Tpo $(DEPDIR)/nsec3params.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/nsec3params.c' object='nsec3params.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) $(AM_CFLAGS) $(CFLAGS) -c -o nsec3params.obj `if test -f 'signer/nsec3params.c'; then $(CYGPATH_W) 'signer/nsec3params.c'; else $(CYGPATH_W) '$(srcdir)/signer/nsec3params.c'; fi` rrset.o: signer/rrset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrset.o -MD -MP -MF $(DEPDIR)/rrset.Tpo -c -o rrset.o `test -f 'signer/rrset.c' || echo '$(srcdir)/'`signer/rrset.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rrset.Tpo $(DEPDIR)/rrset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/rrset.c' object='rrset.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) $(AM_CFLAGS) $(CFLAGS) -c -o rrset.o `test -f 'signer/rrset.c' || echo '$(srcdir)/'`signer/rrset.c rrset.obj: signer/rrset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrset.obj -MD -MP -MF $(DEPDIR)/rrset.Tpo -c -o rrset.obj `if test -f 'signer/rrset.c'; then $(CYGPATH_W) 'signer/rrset.c'; else $(CYGPATH_W) '$(srcdir)/signer/rrset.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rrset.Tpo $(DEPDIR)/rrset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/rrset.c' object='rrset.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) $(AM_CFLAGS) $(CFLAGS) -c -o rrset.obj `if test -f 'signer/rrset.c'; then $(CYGPATH_W) 'signer/rrset.c'; else $(CYGPATH_W) '$(srcdir)/signer/rrset.c'; fi` signconf.o: signer/signconf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconf.o -MD -MP -MF $(DEPDIR)/signconf.Tpo -c -o signconf.o `test -f 'signer/signconf.c' || echo '$(srcdir)/'`signer/signconf.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/signconf.Tpo $(DEPDIR)/signconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/signconf.c' object='signconf.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) $(AM_CFLAGS) $(CFLAGS) -c -o signconf.o `test -f 'signer/signconf.c' || echo '$(srcdir)/'`signer/signconf.c signconf.obj: signer/signconf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconf.obj -MD -MP -MF $(DEPDIR)/signconf.Tpo -c -o signconf.obj `if test -f 'signer/signconf.c'; then $(CYGPATH_W) 'signer/signconf.c'; else $(CYGPATH_W) '$(srcdir)/signer/signconf.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/signconf.Tpo $(DEPDIR)/signconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/signconf.c' object='signconf.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) $(AM_CFLAGS) $(CFLAGS) -c -o signconf.obj `if test -f 'signer/signconf.c'; then $(CYGPATH_W) 'signer/signconf.c'; else $(CYGPATH_W) '$(srcdir)/signer/signconf.c'; fi` stats.o: signer/stats.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stats.o -MD -MP -MF $(DEPDIR)/stats.Tpo -c -o stats.o `test -f 'signer/stats.c' || echo '$(srcdir)/'`signer/stats.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stats.Tpo $(DEPDIR)/stats.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/stats.c' object='stats.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) $(AM_CFLAGS) $(CFLAGS) -c -o stats.o `test -f 'signer/stats.c' || echo '$(srcdir)/'`signer/stats.c stats.obj: signer/stats.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stats.obj -MD -MP -MF $(DEPDIR)/stats.Tpo -c -o stats.obj `if test -f 'signer/stats.c'; then $(CYGPATH_W) 'signer/stats.c'; else $(CYGPATH_W) '$(srcdir)/signer/stats.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stats.Tpo $(DEPDIR)/stats.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/stats.c' object='stats.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) $(AM_CFLAGS) $(CFLAGS) -c -o stats.obj `if test -f 'signer/stats.c'; then $(CYGPATH_W) 'signer/stats.c'; else $(CYGPATH_W) '$(srcdir)/signer/stats.c'; fi` tools.o: signer/tools.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tools.o -MD -MP -MF $(DEPDIR)/tools.Tpo -c -o tools.o `test -f 'signer/tools.c' || echo '$(srcdir)/'`signer/tools.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tools.Tpo $(DEPDIR)/tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/tools.c' object='tools.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) $(AM_CFLAGS) $(CFLAGS) -c -o tools.o `test -f 'signer/tools.c' || echo '$(srcdir)/'`signer/tools.c tools.obj: signer/tools.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tools.obj -MD -MP -MF $(DEPDIR)/tools.Tpo -c -o tools.obj `if test -f 'signer/tools.c'; then $(CYGPATH_W) 'signer/tools.c'; else $(CYGPATH_W) '$(srcdir)/signer/tools.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tools.Tpo $(DEPDIR)/tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/tools.c' object='tools.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) $(AM_CFLAGS) $(CFLAGS) -c -o tools.obj `if test -f 'signer/tools.c'; then $(CYGPATH_W) 'signer/tools.c'; else $(CYGPATH_W) '$(srcdir)/signer/tools.c'; fi` zone.o: signer/zone.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zone.o -MD -MP -MF $(DEPDIR)/zone.Tpo -c -o zone.o `test -f 'signer/zone.c' || echo '$(srcdir)/'`signer/zone.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zone.Tpo $(DEPDIR)/zone.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/zone.c' object='zone.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) $(AM_CFLAGS) $(CFLAGS) -c -o zone.o `test -f 'signer/zone.c' || echo '$(srcdir)/'`signer/zone.c zone.obj: signer/zone.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zone.obj -MD -MP -MF $(DEPDIR)/zone.Tpo -c -o zone.obj `if test -f 'signer/zone.c'; then $(CYGPATH_W) 'signer/zone.c'; else $(CYGPATH_W) '$(srcdir)/signer/zone.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zone.Tpo $(DEPDIR)/zone.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/zone.c' object='zone.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) $(AM_CFLAGS) $(CFLAGS) -c -o zone.obj `if test -f 'signer/zone.c'; then $(CYGPATH_W) 'signer/zone.c'; else $(CYGPATH_W) '$(srcdir)/signer/zone.c'; fi` zonelist.o: signer/zonelist.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelist.o -MD -MP -MF $(DEPDIR)/zonelist.Tpo -c -o zonelist.o `test -f 'signer/zonelist.c' || echo '$(srcdir)/'`signer/zonelist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zonelist.Tpo $(DEPDIR)/zonelist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/zonelist.c' object='zonelist.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) $(AM_CFLAGS) $(CFLAGS) -c -o zonelist.o `test -f 'signer/zonelist.c' || echo '$(srcdir)/'`signer/zonelist.c zonelist.obj: signer/zonelist.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelist.obj -MD -MP -MF $(DEPDIR)/zonelist.Tpo -c -o zonelist.obj `if test -f 'signer/zonelist.c'; then $(CYGPATH_W) 'signer/zonelist.c'; else $(CYGPATH_W) '$(srcdir)/signer/zonelist.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/zonelist.Tpo $(DEPDIR)/zonelist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='signer/zonelist.c' object='zonelist.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) $(AM_CFLAGS) $(CFLAGS) -c -o zonelist.obj `if test -f 'signer/zonelist.c'; then $(CYGPATH_W) 'signer/zonelist.c'; else $(CYGPATH_W) '$(srcdir)/signer/zonelist.c'; fi` acl.o: wire/acl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT acl.o -MD -MP -MF $(DEPDIR)/acl.Tpo -c -o acl.o `test -f 'wire/acl.c' || echo '$(srcdir)/'`wire/acl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/acl.Tpo $(DEPDIR)/acl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/acl.c' object='acl.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) $(AM_CFLAGS) $(CFLAGS) -c -o acl.o `test -f 'wire/acl.c' || echo '$(srcdir)/'`wire/acl.c acl.obj: wire/acl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT acl.obj -MD -MP -MF $(DEPDIR)/acl.Tpo -c -o acl.obj `if test -f 'wire/acl.c'; then $(CYGPATH_W) 'wire/acl.c'; else $(CYGPATH_W) '$(srcdir)/wire/acl.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/acl.Tpo $(DEPDIR)/acl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/acl.c' object='acl.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) $(AM_CFLAGS) $(CFLAGS) -c -o acl.obj `if test -f 'wire/acl.c'; then $(CYGPATH_W) 'wire/acl.c'; else $(CYGPATH_W) '$(srcdir)/wire/acl.c'; fi` axfr.o: wire/axfr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT axfr.o -MD -MP -MF $(DEPDIR)/axfr.Tpo -c -o axfr.o `test -f 'wire/axfr.c' || echo '$(srcdir)/'`wire/axfr.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/axfr.Tpo $(DEPDIR)/axfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/axfr.c' object='axfr.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) $(AM_CFLAGS) $(CFLAGS) -c -o axfr.o `test -f 'wire/axfr.c' || echo '$(srcdir)/'`wire/axfr.c axfr.obj: wire/axfr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT axfr.obj -MD -MP -MF $(DEPDIR)/axfr.Tpo -c -o axfr.obj `if test -f 'wire/axfr.c'; then $(CYGPATH_W) 'wire/axfr.c'; else $(CYGPATH_W) '$(srcdir)/wire/axfr.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/axfr.Tpo $(DEPDIR)/axfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/axfr.c' object='axfr.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) $(AM_CFLAGS) $(CFLAGS) -c -o axfr.obj `if test -f 'wire/axfr.c'; then $(CYGPATH_W) 'wire/axfr.c'; else $(CYGPATH_W) '$(srcdir)/wire/axfr.c'; fi` buffer.o: wire/buffer.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.o -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.o `test -f 'wire/buffer.c' || echo '$(srcdir)/'`wire/buffer.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/buffer.c' object='buffer.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) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.o `test -f 'wire/buffer.c' || echo '$(srcdir)/'`wire/buffer.c buffer.obj: wire/buffer.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.obj -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.obj `if test -f 'wire/buffer.c'; then $(CYGPATH_W) 'wire/buffer.c'; else $(CYGPATH_W) '$(srcdir)/wire/buffer.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/buffer.c' object='buffer.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) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.obj `if test -f 'wire/buffer.c'; then $(CYGPATH_W) 'wire/buffer.c'; else $(CYGPATH_W) '$(srcdir)/wire/buffer.c'; fi` edns.o: wire/edns.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT edns.o -MD -MP -MF $(DEPDIR)/edns.Tpo -c -o edns.o `test -f 'wire/edns.c' || echo '$(srcdir)/'`wire/edns.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/edns.Tpo $(DEPDIR)/edns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/edns.c' object='edns.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) $(AM_CFLAGS) $(CFLAGS) -c -o edns.o `test -f 'wire/edns.c' || echo '$(srcdir)/'`wire/edns.c edns.obj: wire/edns.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT edns.obj -MD -MP -MF $(DEPDIR)/edns.Tpo -c -o edns.obj `if test -f 'wire/edns.c'; then $(CYGPATH_W) 'wire/edns.c'; else $(CYGPATH_W) '$(srcdir)/wire/edns.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/edns.Tpo $(DEPDIR)/edns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/edns.c' object='edns.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) $(AM_CFLAGS) $(CFLAGS) -c -o edns.obj `if test -f 'wire/edns.c'; then $(CYGPATH_W) 'wire/edns.c'; else $(CYGPATH_W) '$(srcdir)/wire/edns.c'; fi` listener.o: wire/listener.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT listener.o -MD -MP -MF $(DEPDIR)/listener.Tpo -c -o listener.o `test -f 'wire/listener.c' || echo '$(srcdir)/'`wire/listener.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/listener.Tpo $(DEPDIR)/listener.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/listener.c' object='listener.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) $(AM_CFLAGS) $(CFLAGS) -c -o listener.o `test -f 'wire/listener.c' || echo '$(srcdir)/'`wire/listener.c listener.obj: wire/listener.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT listener.obj -MD -MP -MF $(DEPDIR)/listener.Tpo -c -o listener.obj `if test -f 'wire/listener.c'; then $(CYGPATH_W) 'wire/listener.c'; else $(CYGPATH_W) '$(srcdir)/wire/listener.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/listener.Tpo $(DEPDIR)/listener.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/listener.c' object='listener.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) $(AM_CFLAGS) $(CFLAGS) -c -o listener.obj `if test -f 'wire/listener.c'; then $(CYGPATH_W) 'wire/listener.c'; else $(CYGPATH_W) '$(srcdir)/wire/listener.c'; fi` netio.o: wire/netio.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netio.o -MD -MP -MF $(DEPDIR)/netio.Tpo -c -o netio.o `test -f 'wire/netio.c' || echo '$(srcdir)/'`wire/netio.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/netio.Tpo $(DEPDIR)/netio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/netio.c' object='netio.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) $(AM_CFLAGS) $(CFLAGS) -c -o netio.o `test -f 'wire/netio.c' || echo '$(srcdir)/'`wire/netio.c netio.obj: wire/netio.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netio.obj -MD -MP -MF $(DEPDIR)/netio.Tpo -c -o netio.obj `if test -f 'wire/netio.c'; then $(CYGPATH_W) 'wire/netio.c'; else $(CYGPATH_W) '$(srcdir)/wire/netio.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/netio.Tpo $(DEPDIR)/netio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/netio.c' object='netio.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) $(AM_CFLAGS) $(CFLAGS) -c -o netio.obj `if test -f 'wire/netio.c'; then $(CYGPATH_W) 'wire/netio.c'; else $(CYGPATH_W) '$(srcdir)/wire/netio.c'; fi` notify.o: wire/notify.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT notify.o -MD -MP -MF $(DEPDIR)/notify.Tpo -c -o notify.o `test -f 'wire/notify.c' || echo '$(srcdir)/'`wire/notify.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/notify.Tpo $(DEPDIR)/notify.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/notify.c' object='notify.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) $(AM_CFLAGS) $(CFLAGS) -c -o notify.o `test -f 'wire/notify.c' || echo '$(srcdir)/'`wire/notify.c notify.obj: wire/notify.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT notify.obj -MD -MP -MF $(DEPDIR)/notify.Tpo -c -o notify.obj `if test -f 'wire/notify.c'; then $(CYGPATH_W) 'wire/notify.c'; else $(CYGPATH_W) '$(srcdir)/wire/notify.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/notify.Tpo $(DEPDIR)/notify.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/notify.c' object='notify.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) $(AM_CFLAGS) $(CFLAGS) -c -o notify.obj `if test -f 'wire/notify.c'; then $(CYGPATH_W) 'wire/notify.c'; else $(CYGPATH_W) '$(srcdir)/wire/notify.c'; fi` query.o: wire/query.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT query.o -MD -MP -MF $(DEPDIR)/query.Tpo -c -o query.o `test -f 'wire/query.c' || echo '$(srcdir)/'`wire/query.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/query.Tpo $(DEPDIR)/query.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/query.c' object='query.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) $(AM_CFLAGS) $(CFLAGS) -c -o query.o `test -f 'wire/query.c' || echo '$(srcdir)/'`wire/query.c query.obj: wire/query.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT query.obj -MD -MP -MF $(DEPDIR)/query.Tpo -c -o query.obj `if test -f 'wire/query.c'; then $(CYGPATH_W) 'wire/query.c'; else $(CYGPATH_W) '$(srcdir)/wire/query.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/query.Tpo $(DEPDIR)/query.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/query.c' object='query.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) $(AM_CFLAGS) $(CFLAGS) -c -o query.obj `if test -f 'wire/query.c'; then $(CYGPATH_W) 'wire/query.c'; else $(CYGPATH_W) '$(srcdir)/wire/query.c'; fi` sock.o: wire/sock.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sock.o -MD -MP -MF $(DEPDIR)/sock.Tpo -c -o sock.o `test -f 'wire/sock.c' || echo '$(srcdir)/'`wire/sock.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sock.Tpo $(DEPDIR)/sock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/sock.c' object='sock.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) $(AM_CFLAGS) $(CFLAGS) -c -o sock.o `test -f 'wire/sock.c' || echo '$(srcdir)/'`wire/sock.c sock.obj: wire/sock.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sock.obj -MD -MP -MF $(DEPDIR)/sock.Tpo -c -o sock.obj `if test -f 'wire/sock.c'; then $(CYGPATH_W) 'wire/sock.c'; else $(CYGPATH_W) '$(srcdir)/wire/sock.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sock.Tpo $(DEPDIR)/sock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/sock.c' object='sock.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) $(AM_CFLAGS) $(CFLAGS) -c -o sock.obj `if test -f 'wire/sock.c'; then $(CYGPATH_W) 'wire/sock.c'; else $(CYGPATH_W) '$(srcdir)/wire/sock.c'; fi` tcpset.o: wire/tcpset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcpset.o -MD -MP -MF $(DEPDIR)/tcpset.Tpo -c -o tcpset.o `test -f 'wire/tcpset.c' || echo '$(srcdir)/'`wire/tcpset.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tcpset.Tpo $(DEPDIR)/tcpset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/tcpset.c' object='tcpset.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) $(AM_CFLAGS) $(CFLAGS) -c -o tcpset.o `test -f 'wire/tcpset.c' || echo '$(srcdir)/'`wire/tcpset.c tcpset.obj: wire/tcpset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcpset.obj -MD -MP -MF $(DEPDIR)/tcpset.Tpo -c -o tcpset.obj `if test -f 'wire/tcpset.c'; then $(CYGPATH_W) 'wire/tcpset.c'; else $(CYGPATH_W) '$(srcdir)/wire/tcpset.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tcpset.Tpo $(DEPDIR)/tcpset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/tcpset.c' object='tcpset.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) $(AM_CFLAGS) $(CFLAGS) -c -o tcpset.obj `if test -f 'wire/tcpset.c'; then $(CYGPATH_W) 'wire/tcpset.c'; else $(CYGPATH_W) '$(srcdir)/wire/tcpset.c'; fi` tsig.o: wire/tsig.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig.o -MD -MP -MF $(DEPDIR)/tsig.Tpo -c -o tsig.o `test -f 'wire/tsig.c' || echo '$(srcdir)/'`wire/tsig.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tsig.Tpo $(DEPDIR)/tsig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/tsig.c' object='tsig.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) $(AM_CFLAGS) $(CFLAGS) -c -o tsig.o `test -f 'wire/tsig.c' || echo '$(srcdir)/'`wire/tsig.c tsig.obj: wire/tsig.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig.obj -MD -MP -MF $(DEPDIR)/tsig.Tpo -c -o tsig.obj `if test -f 'wire/tsig.c'; then $(CYGPATH_W) 'wire/tsig.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tsig.Tpo $(DEPDIR)/tsig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/tsig.c' object='tsig.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) $(AM_CFLAGS) $(CFLAGS) -c -o tsig.obj `if test -f 'wire/tsig.c'; then $(CYGPATH_W) 'wire/tsig.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig.c'; fi` tsig-openssl.o: wire/tsig-openssl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig-openssl.o -MD -MP -MF $(DEPDIR)/tsig-openssl.Tpo -c -o tsig-openssl.o `test -f 'wire/tsig-openssl.c' || echo '$(srcdir)/'`wire/tsig-openssl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tsig-openssl.Tpo $(DEPDIR)/tsig-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/tsig-openssl.c' object='tsig-openssl.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) $(AM_CFLAGS) $(CFLAGS) -c -o tsig-openssl.o `test -f 'wire/tsig-openssl.c' || echo '$(srcdir)/'`wire/tsig-openssl.c tsig-openssl.obj: wire/tsig-openssl.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig-openssl.obj -MD -MP -MF $(DEPDIR)/tsig-openssl.Tpo -c -o tsig-openssl.obj `if test -f 'wire/tsig-openssl.c'; then $(CYGPATH_W) 'wire/tsig-openssl.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig-openssl.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tsig-openssl.Tpo $(DEPDIR)/tsig-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/tsig-openssl.c' object='tsig-openssl.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) $(AM_CFLAGS) $(CFLAGS) -c -o tsig-openssl.obj `if test -f 'wire/tsig-openssl.c'; then $(CYGPATH_W) 'wire/tsig-openssl.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig-openssl.c'; fi` xfrd.o: wire/xfrd.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrd.o -MD -MP -MF $(DEPDIR)/xfrd.Tpo -c -o xfrd.o `test -f 'wire/xfrd.c' || echo '$(srcdir)/'`wire/xfrd.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xfrd.Tpo $(DEPDIR)/xfrd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/xfrd.c' object='xfrd.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) $(AM_CFLAGS) $(CFLAGS) -c -o xfrd.o `test -f 'wire/xfrd.c' || echo '$(srcdir)/'`wire/xfrd.c xfrd.obj: wire/xfrd.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrd.obj -MD -MP -MF $(DEPDIR)/xfrd.Tpo -c -o xfrd.obj `if test -f 'wire/xfrd.c'; then $(CYGPATH_W) 'wire/xfrd.c'; else $(CYGPATH_W) '$(srcdir)/wire/xfrd.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xfrd.Tpo $(DEPDIR)/xfrd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wire/xfrd.c' object='xfrd.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) $(AM_CFLAGS) $(CFLAGS) -c -o xfrd.obj `if test -f 'wire/xfrd.c'; then $(CYGPATH_W) 'wire/xfrd.c'; else $(CYGPATH_W) '$(srcdir)/wire/xfrd.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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) installdirs: for dir in "$(DESTDIR)$(sbindir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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-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-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-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS 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-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-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: opendnssec-1.4.3/signer/src/adapter/0000775000175000017500000000000012247571206014367 500000000000000opendnssec-1.4.3/signer/src/adapter/adapi.h0000664000175000017500000000662612055134674015551 00000000000000/* * $Id$ * * Copyright (c) 2009-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * * Adapter API. */ #ifndef ADAPTER_ADAPI_H #define ADAPTER_ADAPI_H #include "config.h" #include "shared/status.h" #include "signer/zone.h" #include /** * Get the inbound serial. * \param[in] zone zone * \return uint32_t inbound serial * */ uint32_t adapi_get_serial(zone_type* zone); /** * Set the inbound serial. * \param[in] zone zone * \param[in] serial inbound serial * */ void adapi_set_serial(zone_type* zone, uint32_t serial); /** * Get origin. * \param[in] zone zone * \return ldns_rdf* origin * */ ldns_rdf* adapi_get_origin(zone_type* zone); /** * Get class. * \param[in] zone zone * \return ldns_rr_class class * */ ldns_rr_class adapi_get_class(zone_type* zone); /** * Get ttl. * \param[in] zone zone * \return uint32_t ttl * */ uint32_t adapi_get_ttl(zone_type* zone); /* * Do full zone transaction. * \param[in] zone zone * \param[in] more_coming more transactions are possible * */ void adapi_trans_full(zone_type* zone, unsigned more_coming); /* * Do incremental zone transaction. * \param[in] zone zone * \param[in] more_coming more transactions are possible * */ void adapi_trans_diff(zone_type* zone, unsigned more_coming); /** * Add RR. * \param[in] zone zone * \param[in] rr RR * \param[in] backup from backup * \return ods_status status * */ ods_status adapi_add_rr(zone_type* zone, ldns_rr* rr, int backup); /** * Delete RR. * \param[in] zone zone * \param[in] rr RR * \param[in] backup from backup * \return ods_status status * */ ods_status adapi_del_rr(zone_type* zone, ldns_rr* rr, int backup); /** * Print zonefile. * \param[in] fd file descriptor * \param[in] zone zone * \return ods_status status * */ ods_status adapi_printzone(FILE* fd, zone_type* zone); /** * Print axfr. * \param[in] fd file descriptor * \param[in] zone zone * \return ods_status status * */ ods_status adapi_printaxfr(FILE* fd, zone_type* zone); /** * Print ixfr. * \param[in] fd file descriptor * \param[in] zone zone * \return ods_status status * */ ods_status adapi_printixfr(FILE* fd, zone_type* zone); #endif /* ADAPTER_ADAPI_H */ opendnssec-1.4.3/signer/src/adapter/adapter.h0000664000175000017500000000601511770566464016114 00000000000000/* * $Id: adapter.h 6449 2012-06-21 09:45:24Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Inbound and Outbound Adapters. * */ #ifndef ADAPTER_ADAPTER_H #define ADAPTER_ADAPTER_H #include "config.h" #include "adapter/addns.h" #include "adapter/adfile.h" #include "shared/allocator.h" #include "shared/status.h" #include /** Adapter mode. */ enum adapter_mode_enum { ADAPTER_FILE = 1, ADAPTER_DNS }; typedef enum adapter_mode_enum adapter_mode; /** * Adapter. * */ typedef struct adapter_struct adapter_type; struct adapter_struct { allocator_type* allocator; adapter_mode type; time_t config_last_modified; const char* configstr; void* config; unsigned inbound : 1; unsigned error : 1; }; /** * Create new adapter. * \param[in] str configuration string * \param[in] type type of adapter * \param[in] in inbound or not (thus outbound) * \return adapter_type* created adapter * */ adapter_type* adapter_create(const char* str, adapter_mode type, unsigned in); /** * Load configuration. * \param[in] adapter adapter * \return ods_status status * */ ods_status adapter_load_config(adapter_type* adapter); /** * Compare adapters. * \param[in] a1 adapter 1 * \param[in] a2 adapter 2 * \return int 0 on equal, -1 if a1 < a2, 1 if a1 > a2 * */ int adapter_compare(adapter_type* a1, adapter_type* a2); /** * Read zone from input adapter. * \param[in] zone zone * \return ods_status status * */ ods_status adapter_read(void* zone); /** * Write zone to output adapter. * \param[in] zone zone * \return ods_status status * */ ods_status adapter_write(void* zone); /** * Clean up adapter. * \param[in] adapter adapter to cleanup * */ void adapter_cleanup(adapter_type* adapter); #endif /* ADAPTER_ADAPTER_H */ opendnssec-1.4.3/signer/src/adapter/adutil.c0000664000175000017500000001362411732103213015726 00000000000000/* * $Id$ * * Copyright (c) 2009-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * * Adapter utilities. */ #include "config.h" #include "adapter/adutil.h" #include "shared/file.h" #include "shared/log.h" #include static const char* adapter_str = "adapter"; /** * Lookup SOA RR. * */ ldns_rr* adutil_lookup_soa_rr(FILE* fd) { ldns_rr *cur_rr = NULL; char line[SE_ADFILE_MAXLINE]; ldns_status status = LDNS_STATUS_OK; int line_len = 0; unsigned int l = 0; while (line_len >= 0) { line_len = adutil_readline_frm_file(fd, (char*) line, &l, 0); adutil_rtrim_line(line, &line_len); if (line_len > 0) { if (line[0] != ';') { status = ldns_rr_new_frm_str(&cur_rr, line, 0, NULL, NULL); if (status == LDNS_STATUS_OK) { if (ldns_rr_get_type(cur_rr) == LDNS_RR_TYPE_SOA) { return cur_rr; } else { ldns_rr_free(cur_rr); cur_rr = NULL; } } } } } return NULL; } /** * Read one line from zone file. * */ int adutil_readline_frm_file(FILE* fd, char* line, unsigned int* l, int keep_comments) { int i = 0; int li = 0; int in_string = 0; int depth = 0; int comments = 0; char c = 0; char lc = 0; for (i = 0; i < SE_ADFILE_MAXLINE; i++) { c = (char) ods_fgetc(fd, l); if (comments) { while (c != EOF && c != '\n') { c = (char) ods_fgetc(fd, l); } } if (c == EOF) { if (depth != 0) { ods_log_error("[%s] read line: bracket mismatch discovered at " "line %i, missing ')'", adapter_str, l&&*l?*l:0); } if (li > 0) { line[li] = '\0'; return li; } else { return -1; } } else if (c == '"' && lc != '\\') { in_string = 1 - in_string; /* swap status */ line[li] = c; li++; } else if (c == '(') { if (in_string) { line[li] = c; li++; } else if (lc != '\\') { depth++; line[li] = ' '; li++; } else { line[li] = c; li++; } } else if (c == ')') { if (in_string) { line[li] = c; li++; } else if (lc != '\\') { if (depth < 1) { ods_log_error("[%s] read line: bracket mismatch " "discovered at line %i, missing '('", adapter_str, l&&*l?*l:0); line[li] = '\0'; return li; } depth--; line[li] = ' '; li++; } else { line[li] = c; li++; } } else if (c == ';') { if (in_string) { line[li] = c; li++; } else if (lc != '\\' && !keep_comments) { comments = 1; } else { line[li] = c; li++; } } else if (c == '\n' && lc != '\\') { comments = 0; /* if no depth issue, we are done */ if (depth == 0) { break; } line[li] = ' '; li++; } else if (c == '\t' && lc != '\\') { line[li] = ' '; li++; } else { line[li] = c; li++; } /* continue with line */ lc = c; } /* done */ if (depth != 0) { ods_log_error("[%s] read line: bracket mismatch discovered at line %i," " missing ')'", adapter_str, l&&*l?*l:0); return li; } line[li] = '\0'; return li; } /* * Trim trailing whitespace. * */ void adutil_rtrim_line(char* line, int* line_len) { int i = strlen(line), nl = 0; int trimmed = 0; while (i>0) { --i; if (line[i] == '\n') { nl = 1; } if (line[i] == ' ' || line[i] == '\t' || line[i] == '\n') { line[i] = '\0'; trimmed++; } else { break; } } if (nl) { line[++i] = '\n'; } *line_len -= trimmed; return; } /** * Check for white space. * */ int adutil_whitespace_line(char* line, int line_len) { int i; for (i = 0; i < line_len; i++) { if (!isspace((int)line[i])) { return 0; } } return 1; } opendnssec-1.4.3/signer/src/adapter/addns.c0000664000175000017500000006511112205607427015547 00000000000000/* * $Id: addns.c 5237 2011-06-20 13:05:39Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * DNS Adapters. * */ #include "config.h" #include "adapter/adapi.h" #include "adapter/adapter.h" #include "adapter/addns.h" #include "adapter/adutil.h" #include "parser/addnsparser.h" #include "parser/confparser.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zone.h" #include "wire/notify.h" #include "wire/xfrd.h" #include #include #include static const char* adapter_str = "adapter"; static ods_status addns_read_pkt(FILE* fd, zone_type* zone); static ods_status addns_read_file(FILE* fd, zone_type* zone); /** * Read the next RR from zone file. * */ ldns_rr* addns_read_rr(FILE* fd, char* line, ldns_rdf** orig, ldns_rdf** prev, uint32_t* ttl, ldns_status* status, unsigned int* l) { ldns_rr* rr = NULL; int len = 0; uint32_t new_ttl = 0; addns_read_line: if (ttl) { new_ttl = *ttl; } len = adutil_readline_frm_file(fd, line, l, 1); adutil_rtrim_line(line, &len); if (len >= 0) { switch (line[0]) { /* no directives */ /* comments, empty lines */ case ';': case '\n': if (ods_strcmp(";;ENDPACKET", line) == 0) { /* end of pkt */ *status = LDNS_STATUS_OK; return NULL; } if (ods_strcmp(";;BEGINPACKET", line) == 0) { /* begin packet but previous not ended, rollback */ *status = LDNS_STATUS_OK; return NULL; } goto addns_read_line; /* perhaps next line is rr */ break; /* let's hope its a RR */ default: if (adutil_whitespace_line(line, len)) { goto addns_read_line; /* perhaps next line is rr */ break; } *status = ldns_rr_new_frm_str(&rr, line, new_ttl, *orig, prev); if (*status == LDNS_STATUS_OK) { return rr; } else if (*status == LDNS_STATUS_SYNTAX_EMPTY) { if (rr) { ldns_rr_free(rr); rr = NULL; } *status = LDNS_STATUS_OK; goto addns_read_line; /* perhaps next line is rr */ break; } else { ods_log_error("[%s] error parsing RR at line %i (%s): %s", adapter_str, l&&*l?*l:0, ldns_get_errorstr_by_id(*status), line); while (len >= 0) { len = adutil_readline_frm_file(fd, line, l, 0); } if (rr) { ldns_rr_free(rr); rr = NULL; } return NULL; } break; } } /* -1, EOF */ *status = LDNS_STATUS_OK; return NULL; } /** * Read pkt from file. * */ static ods_status addns_read_pkt(FILE* fd, zone_type* zone) { ldns_rr* rr = NULL; int len = 0; uint32_t new_serial = 0; uint32_t old_serial = 0; uint32_t tmp_serial = 0; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; uint32_t ttl = 0; size_t rr_count = 0; ods_status result = ODS_STATUS_OK; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned is_axfr = 0; unsigned del_mode = 0; unsigned soa_seen = 0; unsigned line_update_interval = 100000; unsigned line_update = line_update_interval; unsigned l = 0; ods_log_assert(fd); ods_log_assert(zone); ods_log_assert(zone->name); len = adutil_readline_frm_file(fd, line, &l, 1); if (len < 0) { /* -1 EOF */ return ODS_STATUS_EOF; } adutil_rtrim_line(line, &len); if (ods_strcmp(";;BEGINPACKET", line) != 0) { ods_log_error("[%s] bogus xfrd file zone %s, missing ;;BEGINPACKET (was %s)", adapter_str, zone->name, line); return ODS_STATUS_ERR; } begin_pkt: rr_count = 0; is_axfr = 0; del_mode = 0; soa_seen = 0; /* $ORIGIN */ dname = adapi_get_origin(zone); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } /* $TTL */ ttl = adapi_get_ttl(zone); /* read RRs */ while ((rr = addns_read_rr(fd, line, &orig, &prev, &ttl, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; break; } /* debug update */ if (l > line_update) { ods_log_debug("[%s] ...at line %i: %s", adapter_str, l, line); line_update += line_update_interval; } /* first RR: check if SOA and correct zone & serialno */ if (rr_count == 0) { rr_count++; if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad xfr, first rr is not soa", adapter_str); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; break; } soa_seen++; if (ldns_dname_compare(ldns_rr_owner(rr), zone->apex)) { ods_log_error("[%s] bad xfr, soa dname not equal to zone " "dname %s", adapter_str, zone->name); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; break; } tmp_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); old_serial = adapi_get_serial(zone); if (!util_serial_gt(tmp_serial, old_serial)) { ods_log_info("[%s] zone %s is already up to date, have " "serial %u, got serial %u", adapter_str, zone->name, old_serial, tmp_serial); new_serial = tmp_serial; ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_UPTODATE; while (len >= 0) { len = adutil_readline_frm_file(fd, line, &l, 1); if (len && ods_strcmp(";;ENDPACKET", line) == 0) { /* end of pkt */ break; } } break; } ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } /* second RR: if not soa, this is an AXFR */ if (rr_count == 1) { if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_verbose("[%s] detected axfr serial=%u for zone %s", adapter_str, tmp_serial, zone->name); new_serial = tmp_serial; is_axfr = 1; del_mode = 0; } else { ods_log_verbose("[%s] detected ixfr serial=%u for zone %s", adapter_str, tmp_serial, zone->name); new_serial = tmp_serial; tmp_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); ldns_rr_free(rr); rr = NULL; rr_count++; if (tmp_serial < new_serial) { del_mode = 1; result = ODS_STATUS_OK; continue; } else { ods_log_error("[%s] bad xfr for zone %s, bad soa serial", adapter_str, zone->name); result = ODS_STATUS_ERR; break; } } } /* soa means swap */ rr_count++; if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { if (!is_axfr) { tmp_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); if (tmp_serial <= new_serial) { if (tmp_serial == new_serial) { soa_seen++; } del_mode = !del_mode; ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else { ods_log_assert(tmp_serial > new_serial); ods_log_error("[%s] bad xfr for zone %s, bad soa serial", adapter_str, zone->name); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; break; } } else { /* for axfr */ soa_seen++; } } /* [add to/remove from] the zone */ if (!is_axfr && del_mode) { ods_log_deeebug("[%s] delete RR #%i at line %i: %s", adapter_str, rr_count, l, line); result = adapi_del_rr(zone, rr, 0); ldns_rr_free(rr); rr = NULL; } else { ods_log_deeebug("[%s] add RR #%i at line %i: %s", adapter_str, rr_count, l, line); result = adapi_add_rr(zone, rr, 0); } if (result == ODS_STATUS_UNCHANGED) { ods_log_debug("[%s] skipping RR at line %i (%s): %s", adapter_str, l, del_mode?"not found":"duplicate", line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else if (result != ODS_STATUS_OK) { ods_log_error("[%s] error %s RR at line %i: %s", adapter_str, del_mode?"deleting":"adding", l, line); ldns_rr_free(rr); rr = NULL; break; } } /* and done */ if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } /* check again */ if (ods_strcmp(";;ENDPACKET", line) == 0) { ods_log_verbose("[%s] xfr zone %s on disk complete, commit to db", adapter_str, zone->name); } else { ods_log_warning("[%s] xfr zone %s on disk incomplete, rollback", adapter_str, zone->name); namedb_rollback(zone->db, 1); if (ods_strcmp(";;BEGINPACKET", line) == 0) { result = ODS_STATUS_OK; goto begin_pkt; } else { result = ODS_STATUS_XFRINCOMPLETE; } } /* otherwise EOF */ if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } /* check the number of SOAs seen */ if (result == ODS_STATUS_OK) { if ((is_axfr && soa_seen != 2) || (!is_axfr && soa_seen != 3)) { ods_log_error("[%s] bad %s, wrong number of SOAs (%u)", adapter_str, is_axfr?"axfr":"ixfr", soa_seen); result = ODS_STATUS_ERR; } } /* input zone ok, set inbound serial and apply differences */ if (result == ODS_STATUS_OK) { adapi_set_serial(zone, new_serial); if (is_axfr) { adapi_trans_full(zone, 1); } else { adapi_trans_diff(zone, 1); } } if (result == ODS_STATUS_UPTODATE) { /* do a transaction for DNSKEY and NSEC3PARAM */ adapi_trans_diff(zone, 1); result = ODS_STATUS_OK; } return result; } /** * Read pkt from file. * */ static ods_status addns_read_file(FILE* fd, zone_type* zone) { ods_status status = ODS_STATUS_OK; while (status == ODS_STATUS_OK) { status = addns_read_pkt(fd, zone); } if (status == ODS_STATUS_EOF) { status = ODS_STATUS_OK; } return status; } /** * Create DNS input adapter. * */ dnsin_type* dnsin_create(void) { dnsin_type* addns = NULL; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create dnsin: allocator_create() " " failed", adapter_str); return NULL; } addns = (dnsin_type*) allocator_alloc(allocator, sizeof(dnsin_type)); if (!addns) { ods_log_error("[%s] unable to create dnsin: allocator_alloc() " " failed", adapter_str); allocator_cleanup(allocator); return NULL; } addns->allocator = allocator; addns->request_xfr = NULL; addns->allow_notify = NULL; addns->tsig = NULL; return addns; } /** * Create DNS output adapter. * */ dnsout_type* dnsout_create(void) { dnsout_type* addns = NULL; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create dnsout: allocator_create() " " failed", adapter_str); return NULL; } addns = (dnsout_type*) allocator_alloc(allocator, sizeof(dnsout_type)); if (!addns) { ods_log_error("[%s] unable to create dnsout: allocator_alloc() " " failed", adapter_str); allocator_cleanup(allocator); return NULL; } addns->allocator = allocator; addns->provide_xfr = NULL; addns->do_notify = NULL; addns->tsig = NULL; return addns; } /** * Read DNS input adapter. * */ static ods_status dnsin_read(dnsin_type* addns, const char* filename) { const char* rngfile = ODS_SE_RNGDIR "/addns.rng"; ods_status status = ODS_STATUS_OK; FILE* fd = NULL; if (!filename || !addns) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] read dnsin file %s", adapter_str, filename); status = parse_file_check(filename, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read dnsin: parse error in " "file %s (%s)", adapter_str, filename, ods_status2str(status)); return status; } fd = ods_fopen(filename, NULL, "r"); if (fd) { addns->tsig = parse_addns_tsig(addns->allocator, filename); addns->request_xfr = parse_addns_request_xfr(addns->allocator, filename, addns->tsig); addns->allow_notify = parse_addns_allow_notify(addns->allocator, filename, addns->tsig); ods_fclose(fd); return ODS_STATUS_OK; } ods_log_error("[%s] unable to read dnsout: failed to open file %s", adapter_str, filename); return ODS_STATUS_ERR; } /** * Update DNS input adapter. * */ ods_status dnsin_update(dnsin_type** addns, const char* filename, time_t* last_mod) { dnsin_type* new_addns = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; if (!filename || !addns || !last_mod) { return ODS_STATUS_UNCHANGED; } /* read the new signer configuration */ new_addns = dnsin_create(); if (!new_addns) { ods_log_error("[%s] unable to update dnsin: dnsin_create() " "failed", adapter_str); return ODS_STATUS_ERR; } status = dnsin_read(new_addns, filename); if (status == ODS_STATUS_OK) { *addns = new_addns; *last_mod = st_mtime; } else { ods_log_error("[%s] unable to update dnsin: dnsin_read(%s) " "failed (%s)", adapter_str, filename, ods_status2str(status)); dnsin_cleanup(new_addns); } return status; } /** * Read DNS output adapter. * */ static ods_status dnsout_read(dnsout_type* addns, const char* filename) { const char* rngfile = ODS_SE_RNGDIR "/addns.rng"; ods_status status = ODS_STATUS_OK; FILE* fd = NULL; if (!filename || !addns) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] read dnsout file %s", adapter_str, filename); status = parse_file_check(filename, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read dnsout: parse error in " "file %s (%s)", adapter_str, filename, ods_status2str(status)); return status; } fd = ods_fopen(filename, NULL, "r"); if (fd) { addns->tsig = parse_addns_tsig(addns->allocator, filename); addns->provide_xfr = parse_addns_provide_xfr(addns->allocator, filename, addns->tsig); addns->do_notify = parse_addns_do_notify(addns->allocator, filename, addns->tsig); ods_fclose(fd); return ODS_STATUS_OK; } ods_log_error("[%s] unable to read dnsout: failed to open file %s", adapter_str, filename); return ODS_STATUS_ERR; } /** * Update DNS output adapter. * */ ods_status dnsout_update(dnsout_type** addns, const char* filename, time_t* last_mod) { dnsout_type* new_addns = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; if (!filename || !addns || !last_mod) { return ODS_STATUS_UNCHANGED; } /* read the new signer configuration */ new_addns = dnsout_create(); if (!new_addns) { ods_log_error("[%s] unable to update dnsout: dnsout_create() " "failed", adapter_str); return ODS_STATUS_ERR; } status = dnsout_read(new_addns, filename); if (status == ODS_STATUS_OK) { *addns = new_addns; *last_mod = st_mtime; } else { ods_log_error("[%s] unable to update dnsout: dnsout_read(%s) " "failed (%s)", adapter_str, filename, ods_status2str(status)); dnsout_cleanup(new_addns); } return status; } /** * Send notifies. * */ static void dnsout_send_notify(void* zone) { zone_type* z = (zone_type*) zone; rrset_type* rrset = NULL; ldns_rr* soa = NULL; if (!z->notify) { ods_log_error("[%s] unable to send notify for zone %s: no notify " "handler", adapter_str, z->name); return; } ods_log_assert(z->adoutbound); ods_log_assert(z->adoutbound->config); ods_log_assert(z->adoutbound->type == ADAPTER_DNS); ods_log_assert(z->db); ods_log_assert(z->name); ods_log_debug("[%s] enable notify for zone %s serial %u", adapter_str, z->name, z->db->intserial); rrset = zone_lookup_rrset(z, z->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); soa = ldns_rr_clone(rrset->rrs[0].rr); notify_enable(z->notify, soa); return; } /** * Read zone from DNS Input Adapter. * */ ods_status addns_read(void* zone) { zone_type* z = (zone_type*) zone; ods_status status = ODS_STATUS_OK; char* xfrfile = NULL; char* file = NULL; FILE* fd = NULL; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->xfrd); ods_log_assert(z->db); ods_log_assert(z->adinbound); ods_log_assert(z->adinbound->type == ADAPTER_DNS); lock_basic_lock(&z->xfrd->rw_lock); lock_basic_lock(&z->xfrd->serial_lock); /* did we already store a new zone transfer on disk? */ if (!z->xfrd->serial_disk_acquired || z->xfrd->serial_disk_acquired <= z->xfrd->serial_xfr_acquired) { lock_basic_unlock(&z->xfrd->serial_lock); lock_basic_unlock(&z->xfrd->rw_lock); if (!z->xfrd->serial_disk_acquired) { return ODS_STATUS_XFR_NOT_READY; } /* do a transaction for DNSKEY and NSEC3PARAM */ adapi_trans_diff(z, 0); return ODS_STATUS_UNCHANGED; } /* copy zone transfers */ xfrfile = ods_build_path(z->name, ".xfrd", 0, 1); file = ods_build_path(z->name, ".xfrd.tmp", 0, 1); if (!xfrfile || !file) { ods_log_error("[%s] unable to build paths to xfrd files", adapter_str); return ODS_STATUS_MALLOC_ERR; } if (rename(xfrfile, file) != 0) { lock_basic_unlock(&z->xfrd->serial_lock); lock_basic_unlock(&z->xfrd->rw_lock); ods_log_error("[%s] unable to rename file %s to %s: %s", adapter_str, xfrfile, file, strerror(errno)); free((void*) xfrfile); free((void*) file); return ODS_STATUS_RENAME_ERR; } lock_basic_unlock(&z->xfrd->serial_lock); /* open copy of zone transfers to read */ fd = ods_fopen(file, NULL, "r"); free((void*) xfrfile); if (!fd) { lock_basic_unlock(&z->xfrd->rw_lock); free((void*) file); return ODS_STATUS_FOPEN_ERR; } status = addns_read_file(fd, z); if (status == ODS_STATUS_OK) { lock_basic_lock(&z->xfrd->serial_lock); z->xfrd->serial_xfr = adapi_get_serial(z); z->xfrd->serial_xfr_acquired = z->xfrd->serial_disk_acquired; lock_basic_unlock(&z->xfrd->serial_lock); /* clean up copy of zone transfer */ if (unlink((const char*) file) != 0) { ods_log_error("[%s] unable to unlink zone transfer copy file %s: " " %s", adapter_str, strerror(errno)); /* should be no issue */ } } free((void*) file); ods_fclose(fd); lock_basic_unlock(&z->xfrd->rw_lock); return status; } /** * Write to DNS Output Adapter. * */ ods_status addns_write(void* zone) { FILE* fd = NULL; char* atmpfile = NULL; char* axfrfile = NULL; char* itmpfile = NULL; char* ixfrfile = NULL; zone_type* z = (zone_type*) zone; int ret = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->adoutbound); ods_log_assert(z->adoutbound->type == ADAPTER_DNS); atmpfile = ods_build_path(z->name, ".axfr.tmp", 0, 1); if (!atmpfile) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(atmpfile, NULL, "w"); if (!fd) { free((void*) atmpfile); return ODS_STATUS_FOPEN_ERR; } status = adapi_printaxfr(fd, z); ods_fclose(fd); if (status != ODS_STATUS_OK) { free((void*) atmpfile); return status; } if (z->db->is_initialized) { itmpfile = ods_build_path(z->name, ".ixfr.tmp", 0, 1); if (!itmpfile) { free((void*) atmpfile); return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(itmpfile, NULL, "w"); if (!fd) { free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_FOPEN_ERR; } status = adapi_printixfr(fd, z); ods_fclose(fd); if (status != ODS_STATUS_OK) { free((void*) atmpfile); free((void*) itmpfile); return status; } } if (status == ODS_STATUS_OK) { if (z->adoutbound->error) { ods_log_error("[%s] unable to write zone %s axfr: one or " "more RR print failed", adapter_str, z->name); /* clear error */ z->adoutbound->error = 0; free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_FWRITE_ERR; } } /* lock and move */ axfrfile = ods_build_path(z->name, ".axfr", 0, 1); if (!axfrfile) { free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_MALLOC_ERR; } lock_basic_lock(&z->xfr_lock); ret = rename(atmpfile, axfrfile); if (ret != 0) { ods_log_error("[%s] unable to rename file %s to %s: %s", adapter_str, atmpfile, axfrfile, strerror(errno)); lock_basic_unlock(&z->xfr_lock); free((void*) atmpfile); free((void*) axfrfile); free((void*) itmpfile); return ODS_STATUS_RENAME_ERR; } free((void*) axfrfile); free((void*) atmpfile); if (z->db->is_initialized) { ixfrfile = ods_build_path(z->name, ".ixfr", 0, 1); if (!ixfrfile) { free((void*) axfrfile); free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_MALLOC_ERR; } ret = rename(itmpfile, ixfrfile); if (ret != 0) { ods_log_error("[%s] unable to rename file %s to %s: %s", adapter_str, itmpfile, ixfrfile, strerror(errno)); lock_basic_unlock(&z->xfr_lock); free((void*) itmpfile); free((void*) ixfrfile); return ODS_STATUS_RENAME_ERR; } free((void*) ixfrfile); } free((void*) itmpfile); lock_basic_unlock(&z->xfr_lock); dnsout_send_notify(zone); return ODS_STATUS_OK; } /** * Clean up DNS input adapter. * */ void dnsin_cleanup(dnsin_type* addns) { allocator_type* allocator = NULL; if (!addns) { return; } allocator = addns->allocator; acl_cleanup(addns->request_xfr, allocator); acl_cleanup(addns->allow_notify, allocator); tsig_cleanup(addns->tsig, allocator); allocator_deallocate(allocator, (void*) addns); allocator_cleanup(allocator); return; } /** * Clean up DNS output adapter. * */ void dnsout_cleanup(dnsout_type* addns) { allocator_type* allocator = NULL; if (!addns) { return; } allocator = addns->allocator; acl_cleanup(addns->provide_xfr, allocator); acl_cleanup(addns->do_notify, allocator); tsig_cleanup(addns->tsig, allocator); allocator_deallocate(allocator, (void*) addns); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/adapter/adfile.h0000664000175000017500000000371611732103213015676 00000000000000/* * $Id: adfile.h 6215 2012-03-20 13:30:51Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * File Adapters. * */ #ifndef ADAPTER_ADFILE_H #define ADAPTER_ADFILE_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include /** * File adapter. * */ /** NULL */ /** * Read zone from input file adapter. * \param[in] zone zone reference * \return ods_status status * */ ods_status adfile_read(void* zone); /** * Write zone to output file adapter. * \param[in] zone zone reference * \param[in] filename write to this specific file * \return ods_status status * */ ods_status adfile_write(void* zone, const char* filename); #endif /* ADAPTER_ADFILE_H */ opendnssec-1.4.3/signer/src/adapter/adfile.c0000664000175000017500000003054712157556321015711 00000000000000/* * $Id: adfile.c 7157 2013-06-17 09:54:25Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * File Adapters. * */ #include "config.h" #include "adapter/adapi.h" #include "adapter/adapter.h" #include "adapter/adfile.h" #include "adapter/adutil.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zone.h" #include #include #include static const char* adapter_str = "adapter"; static ods_status adfile_read_file(FILE* fd, zone_type* zone); /** * Read the next RR from zone file. * */ static ldns_rr* adfile_read_rr(FILE* fd, zone_type* zone, char* line, ldns_rdf** orig, ldns_rdf** prev, uint32_t* ttl, ldns_status* status, unsigned int* l) { ldns_rr* rr = NULL; ldns_rdf* tmp = NULL; FILE* fd_include = NULL; int len = 0; ods_status s = ODS_STATUS_OK; uint32_t new_ttl = 0; const char *endptr; /* unused */ int offset = 0; adfile_read_line: if (ttl) { new_ttl = *ttl; } len = adutil_readline_frm_file(fd, line, l, 0); adutil_rtrim_line(line, &len); if (len >= 0) { switch (line[0]) { /* directive */ case '$': if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((int)line[7])) { /* copy from ldns */ if (*orig) { ldns_rdf_deep_free(*orig); *orig = NULL; } offset = 8; while (isspace((int)line[offset])) { offset++; } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, line + offset); if (!tmp) { /* could not parse what next to $ORIGIN */ *status = LDNS_STATUS_SYNTAX_DNAME_ERR; return NULL; } *orig = tmp; /* end copy from ldns */ goto adfile_read_line; /* perhaps next line is rr */ break; } else if (strncmp(line, "$TTL", 4) == 0 && isspace((int)line[4])) { /* override default ttl */ offset = 5; while (isspace((int)line[offset])) { offset++; } if (ttl) { *ttl = ldns_str2period(line + offset, &endptr); new_ttl = *ttl; } goto adfile_read_line; /* perhaps next line is rr */ break; } else if (strncmp(line, "$INCLUDE", 8) == 0 && isspace((int)line[8])) { /* dive into this file */ offset = 9; while (isspace((int)line[offset])) { offset++; } fd_include = ods_fopen(line + offset, NULL, "r"); if (fd_include) { s = adfile_read_file(fd_include, zone); ods_fclose(fd_include); } else { ods_log_error("[%s] unable to open include file %s", adapter_str, (line+offset)); *status = LDNS_STATUS_SYNTAX_ERR; return NULL; } if (s != ODS_STATUS_OK) { *status = LDNS_STATUS_SYNTAX_ERR; ods_log_error("[%s] error in include file %s", adapter_str, (line+offset)); return NULL; } /* restore current ttl */ if (ttl) { *ttl = new_ttl; } goto adfile_read_line; /* perhaps next line is rr */ break; } goto adfile_read_rr; /* this can be an owner name */ break; /* comments, empty lines */ case ';': case '\n': goto adfile_read_line; /* perhaps next line is rr */ break; /* let's hope its a RR */ default: adfile_read_rr: if (adutil_whitespace_line(line, len)) { goto adfile_read_line; /* perhaps next line is rr */ break; } *status = ldns_rr_new_frm_str(&rr, line, new_ttl, *orig, prev); if (*status == LDNS_STATUS_OK) { return rr; } else if (*status == LDNS_STATUS_SYNTAX_EMPTY) { if (rr) { ldns_rr_free(rr); rr = NULL; } *status = LDNS_STATUS_OK; goto adfile_read_line; /* perhaps next line is rr */ break; } else { ods_log_error("[%s] error parsing RR at line %i (%s): %s", adapter_str, l&&*l?*l:0, ldns_get_errorstr_by_id(*status), line); while (len >= 0) { len = adutil_readline_frm_file(fd, line, l, 0); } if (rr) { ldns_rr_free(rr); rr = NULL; } return NULL; } break; } } /* -1, EOF */ *status = LDNS_STATUS_OK; return NULL; } /** * Read zone file. * */ static ods_status adfile_read_file(FILE* fd, zone_type* zone) { ods_status result = ODS_STATUS_OK; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; uint32_t ttl = 0; uint32_t new_serial = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned int line_update_interval = 100000; unsigned int line_update = line_update_interval; unsigned int l = 0; ods_log_assert(fd); ods_log_assert(zone); /* $ORIGIN */ dname = adapi_get_origin(zone); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } /* $TTL */ ttl = adapi_get_ttl(zone); /* read RRs */ while ((rr = adfile_read_rr(fd, zone, line, &orig, &prev, &ttl, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; break; } /* debug update */ if (l > line_update) { ods_log_debug("[%s] ...at line %i: %s", adapter_str, l, line); line_update += line_update_interval; } /* SOA? */ if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { new_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); } /* add to the database */ result = adapi_add_rr(zone, rr, 0); if (result == ODS_STATUS_UNCHANGED) { ods_log_debug("[%s] skipping RR at line %i (duplicate): %s", adapter_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else if (result != ODS_STATUS_OK) { ods_log_error("[%s] error adding RR at line %i: %s", adapter_str, l, line); ldns_rr_free(rr); rr = NULL; break; } } /* and done */ if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } /* input zone ok, set inbound serial and apply differences */ if (result == ODS_STATUS_OK) { result = namedb_examine(zone->db); if (result != ODS_STATUS_OK) { ods_log_error("[%s] unable to read file: zonefile contains errors", adapter_str); return result; } adapi_set_serial(zone, new_serial); } return result; } /** * Read zone from zonefile. * */ ods_status adfile_read(void* zone) { FILE* fd = NULL; zone_type* adzone = (zone_type*) zone; ods_status status = ODS_STATUS_OK; if (!adzone || !adzone->adinbound || !adzone->adinbound->configstr) { ods_log_error("[%s] unable to read file: no input adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } fd = ods_fopen(adzone->adinbound->configstr, NULL, "r"); if (!fd) { return ODS_STATUS_FOPEN_ERR; } status = adfile_read_file(fd, adzone); ods_fclose(fd); if (status == ODS_STATUS_OK) { adapi_trans_full(zone, 0); } return status; } /** * Write zonefile. * */ ods_status adfile_write(void* zone, const char* filename) { FILE* fd = NULL; char* tmpname = NULL; zone_type* adzone = (zone_type*) zone; ods_status status = ODS_STATUS_OK; /* [start] sanity parameter checking */ if (!adzone || !adzone->adoutbound) { ods_log_error("[%s] unable to write file: no output adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } if (!filename) { ods_log_error("[%s] unable to write file: no filename given", adapter_str); return ODS_STATUS_ASSERT_ERR; } /* [end] sanity parameter checking */ /* [start] write zone */ tmpname = ods_build_path(filename, ".tmp", 0, 0); if (!tmpname) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(tmpname, NULL, "w"); if (fd) { status = adapi_printzone(fd, adzone); ods_fclose(fd); if (status == ODS_STATUS_OK) { if (adzone->adoutbound->error) { ods_log_error("[%s] unable to write zone %s file %s: one or " "more RR print failed", adapter_str, adzone->name, filename); /* clear error */ adzone->adoutbound->error = 0; status = ODS_STATUS_FWRITE_ERR; } } } else { status = ODS_STATUS_FOPEN_ERR; } if (status == ODS_STATUS_OK) { if (rename((const char*) tmpname, filename) != 0) { ods_log_error("[%s] unable to write file: failed to rename %s " "to %s (%s)", adapter_str, tmpname, filename, strerror(errno)); status = ODS_STATUS_RENAME_ERR; } } free(tmpname); /* [end] write zone */ return status; } opendnssec-1.4.3/signer/src/adapter/adapi.c0000664000175000017500000002652012225214721015526 00000000000000/* * $Id$ * * Copyright (c) 2009-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * * Adapter API. */ #include "config.h" #include "adapter/adapi.h" #include "shared/duration.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zone.h" #include static const char* adapi_str = "adapter"; /** * Get the inbound serial. * */ uint32_t adapi_get_serial(zone_type* zone) { if (!zone || !zone->db) { return 0; } return zone->db->inbserial; } /** * Set the inbound serial. * */ void adapi_set_serial(zone_type* zone, uint32_t serial) { if (!zone || !zone->db) { return; } zone->db->inbserial = serial; return; } /** * Get origin. * */ ldns_rdf* adapi_get_origin(zone_type* zone) { if (!zone) { return NULL; } return zone->apex; } /** * Get class. * */ ldns_rr_class adapi_get_class(zone_type* zone) { if (!zone) { return LDNS_RR_CLASS_IN; } return zone->klass; } /** * Get ttl. * */ uint32_t adapi_get_ttl(zone_type* zone) { if (!zone) { return 0; } return zone->default_ttl; } /* * Do full zone transaction. * */ void adapi_trans_full(zone_type* zone, unsigned more_coming) { time_t start = 0; time_t end = 0; uint32_t num_added = 0; if (!zone || !zone->db) { return; } namedb_diff(zone->db, 0, more_coming); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->nsec_time = 0; zone->stats->nsec_count = 0; lock_basic_unlock(&zone->stats->stats_lock); } start = time(NULL); /* nsecify(3) */ namedb_nsecify(zone->db, &num_added); end = time(NULL); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (!zone->stats->start_time) { zone->stats->start_time = start; } zone->stats->nsec_time = (end-start); zone->stats->nsec_count = num_added; lock_basic_unlock(&zone->stats->stats_lock); } return; } /* * Do incremental zone transaction. * */ void adapi_trans_diff(zone_type* zone, unsigned more_coming) { time_t start = 0; time_t end = 0; uint32_t num_added = 0; if (!zone || !zone->db) { return; } namedb_diff(zone->db, 1, more_coming); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->nsec_time = 0; zone->stats->nsec_count = 0; lock_basic_unlock(&zone->stats->stats_lock); } start = time(NULL); /* nsecify(3) */ namedb_nsecify(zone->db, &num_added); end = time(NULL); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (!zone->stats->start_time) { zone->stats->start_time = start; } zone->stats->nsec_time = (end-start); zone->stats->nsec_count = num_added; lock_basic_unlock(&zone->stats->stats_lock); } return; } /** * Process SOA. * */ static ods_status adapi_process_soa(zone_type* zone, ldns_rr* rr, int add, int backup) { uint32_t tmp = 0; ldns_rdf* soa_rdata = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->signconf); if (backup) { /* no need to do processing */ return ODS_STATUS_OK; } if (zone->signconf->soa_ttl) { tmp = (uint32_t) duration2time(zone->signconf->soa_ttl); ods_log_verbose("[%s] zone %s set soa ttl to %u", adapi_str, zone->name, tmp); ldns_rr_set_ttl(rr, tmp); } if (zone->signconf->soa_min) { tmp = (uint32_t) duration2time(zone->signconf->soa_min); ods_log_verbose("[%s] zone %s set soa minimum to %u", adapi_str, zone->name, tmp); soa_rdata = ldns_rr_set_rdf(rr, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, tmp), SE_SOA_RDATA_MINIMUM); if (soa_rdata) { ldns_rdf_deep_free(soa_rdata); soa_rdata = NULL; } else { ods_log_error("[%s] unable to %s soa to zone %s: failed to replace " "soa minimum rdata", adapi_str, add?"add":"delete", zone->name); return ODS_STATUS_ASSERT_ERR; } } if (!add) { /* we are done */ return ODS_STATUS_OK; } tmp = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); status = namedb_update_serial(zone->db, zone->name, zone->signconf->soa_serial, tmp); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to add soa to zone %s: failed to replace " "soa serial rdata (%s)", adapi_str, zone->name, ods_status2str(status)); if (status == ODS_STATUS_CONFLICT_ERR) { ods_log_error("[%s] If this is the result of a key rollover, " "please increment the serial in the unsigned zone %s", adapi_str, zone->name); } return status; } ods_log_verbose("[%s] zone %s set soa serial to %u", adapi_str, zone->name, zone->db->intserial); soa_rdata = ldns_rr_set_rdf(rr, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, zone->db->intserial), SE_SOA_RDATA_SERIAL); if (soa_rdata) { ldns_rdf_deep_free(soa_rdata); soa_rdata = NULL; } else { ods_log_error("[%s] unable to add soa to zone %s: failed to replace " "soa serial rdata", adapi_str, zone->name); return ODS_STATUS_ERR; } zone->db->serial_updated = 1; return ODS_STATUS_OK; } /** * Process DNSKEY. * */ static void adapi_process_dnskey(zone_type* zone, ldns_rr* rr) { uint32_t tmp = 0; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->signconf); tmp = (uint32_t) duration2time(zone->signconf->dnskey_ttl); ods_log_verbose("[%s] zone %s set dnskey ttl to %u", adapi_str, zone->name, tmp); ldns_rr_set_ttl(rr, tmp); return; } /** * Process RR. * */ static ods_status adapi_process_rr(zone_type* zone, ldns_rr* rr, int add, int backup) { ods_status status = ODS_STATUS_OK; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); /* We only support IN class */ if (ldns_rr_get_class(rr) != LDNS_RR_CLASS_IN) { ods_log_warning("[%s] only class in is supported, changing class " "to in"); ldns_rr_set_class(rr, LDNS_RR_CLASS_IN); } /* RR processing */ if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { if (ldns_dname_compare(ldns_rr_owner(rr), zone->apex)) { ods_log_error("[%s] unable to %s rr to zone: soa record has " "invalid owner name", adapi_str, add?"add":"delete"); return ODS_STATUS_ERR; } status = adapi_process_soa(zone, rr, add, backup); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to %s rr: failed to process soa " "record", adapi_str, add?"add":"delete"); return status; } } else { if (ldns_dname_compare(ldns_rr_owner(rr), zone->apex) && !ldns_dname_is_subdomain(ldns_rr_owner(rr), zone->apex)) { ods_log_warning("[%s] zone %s contains out-of-zone data, " "skipping", adapi_str, zone->name); return ODS_STATUS_UNCHANGED; } else if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_DNSKEY) { adapi_process_dnskey(zone, rr); } else if (util_is_dnssec_rr(rr) && !backup) { ods_log_warning("[%s] zone %s contains dnssec data (type=%u), " "skipping", adapi_str, zone->name, (unsigned) ldns_rr_get_type(rr)); return ODS_STATUS_UNCHANGED; } } /* TODO: DNAME and CNAME checks */ /* TODO: NS and DS checks */ if (add) { return zone_add_rr(zone, rr, 1); } else { return zone_del_rr(zone, rr, 1); } /* not reached */ return ODS_STATUS_ERR; } /** * Add RR. * */ ods_status adapi_add_rr(zone_type* zone, ldns_rr* rr, int backup) { return adapi_process_rr(zone, rr, 1, backup); } /** * Delete RR. * */ ods_status adapi_del_rr(zone_type* zone, ldns_rr* rr, int backup) { return adapi_process_rr(zone, rr, 0, backup); } /** * Print zone. * */ ods_status adapi_printzone(FILE* fd, zone_type* zone) { ods_status status = ODS_STATUS_OK; if (!fd || !zone || !zone->db) { ods_log_error("[%s] unable to print zone: file descriptor, zone or " "name database missing", adapi_str); return ODS_STATUS_ASSERT_ERR; } namedb_export(fd, zone->db, &status); return status; } /** * Print axfr. * */ ods_status adapi_printaxfr(FILE* fd, zone_type* zone) { rrset_type* rrset = NULL; ods_status status = ODS_STATUS_OK; if (!fd || !zone || !zone->db) { ods_log_error("[%s] unable to print axfr: file descriptor, zone or " "name database missing", adapi_str); return ODS_STATUS_ASSERT_ERR; } namedb_export(fd, zone->db, &status); if (status == ODS_STATUS_OK) { rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); rrset_print(fd, rrset, 1, &status); } return status; } /** * Print ixfr. * */ ods_status adapi_printixfr(FILE* fd, zone_type* zone) { rrset_type* rrset = NULL; ods_status status = ODS_STATUS_OK; if (!fd || !zone || !zone->db || !zone->ixfr) { ods_log_error("[%s] unable to print ixfr: file descriptor, zone or " "name database missing", adapi_str); return ODS_STATUS_ASSERT_ERR; } if (!zone->db->is_initialized) { /* no ixfr yet */ return ODS_STATUS_OK; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); rrset_print(fd, rrset, 1, &status); if (status != ODS_STATUS_OK) { return status; } lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_print(fd, zone->ixfr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_print(fd, rrset, 1, &status); return status; } opendnssec-1.4.3/signer/src/adapter/addns.h0000664000175000017500000000742311716477614015567 00000000000000/* * $Id: addns.h 5867 2011-11-17 11:18:08Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * DNS Adapters. * */ #ifndef ADAPTER_ADDNS_H #define ADAPTER_ADDNS_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "wire/acl.h" #include "wire/tsig.h" #include #include #include /** * DNS input adapter. * */ typedef struct dnsin_struct dnsin_type; struct dnsin_struct { allocator_type* allocator; acl_type* request_xfr; acl_type* allow_notify; tsig_type* tsig; time_t last_modified; }; /** * DNS output adapter. * */ typedef struct dnsout_struct dnsout_type; struct dnsout_struct { allocator_type* allocator; acl_type* provide_xfr; acl_type* do_notify; tsig_type* tsig; time_t last_modified; }; /** * Create DNS input adapter. * \return dnsin_type* DNS input adapter * */ dnsin_type* dnsin_create(void); /** * Create DNS output adapter. * \return dnsout_type* DNS output adapter * */ dnsout_type* dnsout_create(void); /** * Update DNS input adapter. * \param[out] addns DNS input adapter * \param[in] filename filename * \param[out] last_mod last modified * \return ods_status status * */ ods_status dnsin_update(dnsin_type** addns, const char* filename, time_t* last_mod); /** * Update DNS output adapter. * \param[out] addns DNS output adapter * \param[in] filename filename * \param[out] last_mod last modified * \return ods_status status * */ ods_status dnsout_update(dnsout_type** addns, const char* filename, time_t* last_mod); /** * Read the next RR from zone file. * \param[in] fd file descriptor * \param[in] line read line * \param[in] orig origin * \param[in] prev previous name * \param[in] ttl default ttl * \param[in] status status * \param[out] l line count * \return ldns_rr* RR * */ ldns_rr* addns_read_rr(FILE* fd, char* line, ldns_rdf** orig, ldns_rdf** prev, uint32_t* ttl, ldns_status* status, unsigned int* l); /** * Read zone from DNS input adapter. * \param[in] zone zone reference * \return ods_status status * */ ods_status addns_read(void* zone); /** * Write zone to DNS output adapter. * \param[in] zone zone reference * \return ods_status status * */ ods_status addns_write(void* zone); /** * Clean up DNS input adapter. * \param[in] addns DNS input adapter * */ void dnsin_cleanup(dnsin_type* addns); /** * Clean up DNS output adapter. * \param[in] addns DNS output adapter * */ void dnsout_cleanup(dnsout_type* addns); #endif /* ADAPTER_ADDNS_H */ opendnssec-1.4.3/signer/src/adapter/adapter.c0000664000175000017500000002070511777741331016104 00000000000000/* * $Id: adapter.c 6478 2012-07-13 06:40:25Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * Inbound and Outbound Adapters. * */ #include "adapter/adapter.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/zone.h" #include static const char* adapter_str = "adapter"; /** * Create a new adapter. * */ adapter_type* adapter_create(const char* str, adapter_mode type, unsigned in) { adapter_type* adapter = NULL; allocator_type* allocator = NULL; allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create adapter: allocator_create() " "failed", adapter_str); return NULL; } adapter = (adapter_type*) allocator_alloc(allocator, sizeof(adapter_type)); if (!adapter) { ods_log_error("[%s] unable to create adapter: allocator_alloc() " "failed", adapter_str); allocator_cleanup(allocator); return NULL; } adapter->allocator = allocator; adapter->type = type; adapter->inbound = in; adapter->error = 0; adapter->config = NULL; adapter->config_last_modified = 0; adapter->configstr = allocator_strdup(allocator, str); if (!adapter->configstr) { ods_log_error("[%s] unable to create adapter: allocator_strdup() " "failed", adapter_str); adapter_cleanup(adapter); return NULL; } /* type specific */ switch(adapter->type) { case ADAPTER_FILE: break; case ADAPTER_DNS: if (adapter->inbound) { adapter->config = (void*) dnsin_create(); if (!adapter->config) { ods_log_error("[%s] unable to create adapter: " "dnsin_create() failed", adapter_str); adapter_cleanup(adapter); return NULL; } } else { adapter->config = (void*) dnsout_create(); if (!adapter->config) { ods_log_error("[%s] unable to create adapter: " "dnsout_create() failed", adapter_str); adapter_cleanup(adapter); return NULL; } } break; default: break; } return adapter; } /** * Load ACL. * */ ods_status adapter_load_config(adapter_type* adapter) { dnsin_type* dnsin = NULL; dnsout_type* dnsout = NULL; ods_status status = ODS_STATUS_OK; if (!adapter || !adapter->configstr) { return ODS_STATUS_ASSERT_ERR; } /* type specific */ switch(adapter->type) { case ADAPTER_FILE: break; case ADAPTER_DNS: ods_log_assert(adapter->config); if (adapter->inbound) { status = dnsin_update(&dnsin, adapter->configstr, &adapter->config_last_modified); if (status == ODS_STATUS_OK) { ods_log_assert(dnsin); dnsin_cleanup((dnsin_type*) adapter->config); adapter->config = (void*) dnsin; } else if (status != ODS_STATUS_UNCHANGED) { return status; } return ODS_STATUS_OK; } else { /* outbound */ status = dnsout_update(&dnsout, adapter->configstr, &adapter->config_last_modified); if (status == ODS_STATUS_OK) { ods_log_assert(dnsout); dnsout_cleanup((dnsout_type*) adapter->config); adapter->config = (void*) dnsout; } else if (status != ODS_STATUS_UNCHANGED) { return status; } } break; default: break; } return ODS_STATUS_OK; } /* * Read zone from input adapter. * */ ods_status adapter_read(void* zone) { zone_type* adzone = (zone_type*) zone; if (!adzone || !adzone->adinbound) { ods_log_error("[%s] unable to read zone: no input adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } ods_log_assert(adzone->adinbound->configstr); switch (adzone->adinbound->type) { case ADAPTER_FILE: ods_log_verbose("[%s] read zone %s from file input adapter %s", adapter_str, adzone->name, adzone->adinbound->configstr); return adfile_read(zone); break; case ADAPTER_DNS: ods_log_verbose("[%s] read zone %s from dns input adapter %s", adapter_str, adzone->name, adzone->adinbound->configstr); return addns_read(zone); break; default: ods_log_error("[%s] unable to read zone %s from adapter: unknown " "adapter", adapter_str, adzone->name); return ODS_STATUS_ERR; break; } /* not reached */ return ODS_STATUS_ERR; } /** * Write zone to output adapter. * */ ods_status adapter_write(void* zone) { zone_type* adzone = (zone_type*) zone; if (!adzone || !adzone->db || !adzone->adoutbound) { ods_log_error("[%s] unable to write zone: no output adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } ods_log_assert(adzone->name); ods_log_assert(adzone->adoutbound->configstr); switch(adzone->adoutbound->type) { case ADAPTER_FILE: ods_log_verbose("[%s] write zone %s serial %u to output file " "adapter %s", adapter_str, adzone->name, adzone->db->intserial, adzone->adoutbound->configstr); return adfile_write(zone, adzone->adoutbound->configstr); break; case ADAPTER_DNS: return addns_write(zone); break; default: ods_log_error("[%s] unable to write zone %s to adapter: unknown " "adapter", adapter_str, adzone->name); return ODS_STATUS_ERR; break; } /* not reached */ return ODS_STATUS_ERR; } /** * Compare adapters. * */ int adapter_compare(adapter_type* a1, adapter_type* a2) { if (!a1 && !a2) { return 0; } else if (!a1) { return -1; } else if (!a2) { return 1; } else if (a1->inbound != a2->inbound) { return a1->inbound - a2->inbound; } else if (a1->type != a2->type) { return a1->type - a2->type; } return ods_strcmp(a1->configstr, a2->configstr); } /** * Clean up adapter. * */ void adapter_cleanup(adapter_type* adapter) { allocator_type* allocator = NULL; if (!adapter) { return; } allocator = adapter->allocator; allocator_deallocate(allocator, (void*) adapter->configstr); switch(adapter->type) { case ADAPTER_FILE: break; case ADAPTER_DNS: if (adapter->inbound) { dnsin_cleanup((dnsin_type*) adapter->config); } else { /* outbound */ dnsout_cleanup((dnsout_type*) adapter->config); } break; default: break; } allocator_deallocate(allocator, (void*) adapter); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/adapter/adutil.h0000664000175000017500000000447411732103213015736 00000000000000/* * $Id$ * * Copyright (c) 2009-2011 NLNet Labs. 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, 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 ``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 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. * */ /** * * Adapter utilities. */ #ifndef ADAPTER_ADUTIL_H #define ADAPTER_ADUTIL_H #include "config.h" #include #include #define SE_ADFILE_MAXLINE 65535 /** * Lookup SOA RR. * \param[in] fd file descriptor * \return ldns_rr* SOA RR * */ ldns_rr* adutil_lookup_soa_rr(FILE* fd); /** * Read one line from file. * \param[in] fd file descriptor of zonefile * \param[out] line the one line * \param[out] l keeps track of line numbers * \param[in] keep_comments if true, keep comments * \return int number of characters read * */ int adutil_readline_frm_file(FILE* fd, char* line, unsigned int* l, int keep_comments); /* * Trim trailing whitespace. * \param[in] line line to be trimmed * \param[out] line_len maintain line length * */ void adutil_rtrim_line(char* line, int* line_len); /** * Check for white space. * \param[in] line line to be checked * \param[in] line_len line length * */ int adutil_whitespace_line(char* line, int line_len); #endif /* ADAPTER_ADUTIL_H */ opendnssec-1.4.3/signer/src/wire/0000775000175000017500000000000012247571207013716 500000000000000opendnssec-1.4.3/signer/src/wire/acl.h0000664000175000017500000000655511732110662014551 00000000000000/* * $Id: acl.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Access Control List. * */ #ifndef WIRE_ACL_H #define WIRE_ACL_H #include "config.h" #include "shared/allocator.h" #include "wire/listener.h" #include "wire/tsig.h" /** * Address range type. * */ enum acl_range_enum { ACL_RANGE_SINGLE = 0, /* single adress */ ACL_RANGE_MASK = 1, /* 10.20.30.40&255.255.255.0 */ ACL_RANGE_SUBNET = 2, /* 10.20.30.40/28 */ ACL_RANGE_MINMAX = 3 /* 10.20.30.40-10.20.30.60 (mask=max) */ }; typedef enum acl_range_enum acl_range_type; /** * ACL. * */ typedef struct acl_struct acl_type; struct acl_struct { acl_type* next; /* address */ char* address; unsigned int port; int family; union acl_addr_storage addr; union acl_addr_storage range_mask; acl_range_type range_type; /* tsig */ const char* tsig_name; tsig_type* tsig; /* cache */ time_t ixfr_disabled; }; /** * Create ACL. * \param[in] allocator memory allocator * \param[in] address IP address * \param[in] port port * \param[in] tsig_name TSIG name * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* acl_create(allocator_type* allocator, char* address, char* port, char* tsig_name, tsig_type* tsig); /** * Find ACL. * \param[in] acl ACL * \param[in] addr remote address storage * \param[in] tsig tsig credentials * \return acl_type* ACL that matches * */ acl_type* acl_find(acl_type* acl, struct sockaddr_storage* addr, tsig_rr_type* tsig); /** * Parse family from address. * \param[in] a address in string format * \return int address family * */ int acl_parse_family(const char* a); /** * Address storage to IP string. * \param[in] addr socket address storage * \param[out] ip ip address * \param[in] len max strlen of ip address * \return int 0 if failed, 1 otherwise * */ int addr2ip(struct sockaddr_storage addr, char* ip, size_t len); /** * Clean up ACL. * \param[in] acl ACL * \param[in] allocator memory allocator * */ void acl_cleanup(acl_type* acl, allocator_type* allocator); #endif /* WIRE_ACL_H */ opendnssec-1.4.3/signer/src/wire/tsig.h0000664000175000017500000001705712061343046014757 00000000000000/* * $Id: tsig.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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, 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 ``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 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. * */ /** * TSIG. * */ #ifndef WIRE_TSIG_H #define WIRE_TSIG_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "wire/buffer.h" #include #define TSIG_ERROR_BADSIG 16 #define TSIG_ERROR_BADKEY 17 #define TSIG_ERROR_BADTIME 18 #define TSIG_HMAC_MD5 157 #define TSIG_HMAC_SHA1 158 #define TSIG_HMAC_SHA256 159 /** * TSIG status. * */ enum tsig_status_enum { TSIG_NOT_PRESENT, TSIG_OK, TSIG_ERROR }; typedef enum tsig_status_enum tsig_status; /** * TSIG lookup table. * */ typedef struct tsig_lookup_table_struct tsig_lookup_table; struct tsig_lookup_table_struct { uint8_t id; const char* short_name; }; /** * TSIG key. * */ typedef struct tsig_key_struct tsig_key_type; struct tsig_key_struct { ldns_rdf* dname; size_t size; const uint8_t* data; }; /** * TSIG algorithm. * */ typedef struct tsig_algo_struct tsig_algo_type; struct tsig_algo_struct { const char* txt_name; ldns_rdf* wf_name; size_t max_digest_size; const void* data; /* create a new HMAC context */ void*(*hmac_create)(allocator_type* allocator); /* initialize an HMAC context */ void(*hmac_init)(void* context, tsig_algo_type* algo, tsig_key_type* key); /* update the HMAC context */ void(*hmac_update)(void* context, const void* data, size_t size); /* finalize digest */ void(*hmac_final)(void* context, uint8_t* digest, size_t* size); }; /** * TSIG configuration. * */ typedef struct tsig_struct tsig_type; struct tsig_struct { tsig_type* next; const char* name; const char* algorithm; const char* secret; tsig_key_type* key; }; /** * TSIG RR. * */ typedef struct tsig_rr_struct tsig_rr_type; struct tsig_rr_struct { allocator_type* allocator; tsig_status status; size_t position; size_t response_count; size_t update_since_last_prepare; void* context; tsig_algo_type* algo; tsig_key_type* key; size_t prior_mac_size; uint8_t* prior_mac_data; ldns_rdf* key_name; ldns_rdf* algo_name; uint16_t signed_time_high; uint32_t signed_time_low; uint16_t signed_time_fudge; uint16_t mac_size; uint8_t* mac_data; uint16_t original_query_id; uint16_t error_code; uint16_t other_size; uint8_t* other_data; }; /** * Initialize TSIG handler. * \param[in] allocator memory allocator * \return ods_status status * */ ods_status tsig_handler_init(allocator_type* allocator); /** * Clean up TSIG handler. * */ void tsig_handler_cleanup(void); /** * Add key to TSIG handler. * \param[in] key tsig key * */ void tsig_handler_add_key(tsig_key_type* key); /** * Add algorithm to TSIG handler. * \param[in] algo tsig algorithm * */ void tsig_handler_add_algo(tsig_algo_type* algo); /** * Create new TSIG. * \param[in] allocator memory allocator * \param[in] name tsig name * \param[in] algo tsig algorithm * \param[in] secret tsig secret * \return tsig_type* TSIG * */ tsig_type* tsig_create(allocator_type* allocator, char* name, char* algo, char* secret); /** * Lookup TSIG by key name. * \param[in] tsig TSIG list * \param[in] naem TSIG name * \return tsig_type* TSIG * */ tsig_type* tsig_lookup_by_name(tsig_type* tsig, const char* name); /** * Lookup TSIG algorithm by name. * \param[in] name algorithm name * \return tsig_algo_type* TSIG algorithm * */ tsig_algo_type* tsig_lookup_algo(const char* name); /** * Create new TSIG RR. * \param[in] allocator memory allocator * \return tsig_rr_type* TSIG RR * */ tsig_rr_type* tsig_rr_create(allocator_type* allocator); /** * Reset TSIG RR. * \param[in] trr TSIG RR * \param[in] algo tsig algorithm * \param[in] key tsig key * */ void tsig_rr_reset(tsig_rr_type* trr, tsig_algo_type* algo, tsig_key_type* key); /** * Find TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * \return int 1 if not present or present and valid, 0 otherwise. * */ int tsig_rr_find(tsig_rr_type* trr, buffer_type* buffer); /** * Parse TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * \return int 1 if not TSIG RR or TSIG RR and valid, 0 otherwise. * */ int tsig_rr_parse(tsig_rr_type* trr, buffer_type* buffer); /** * Lookup TSIG RR. * \param[in] trr TSIG RR * \return int 1 if succeeded, 0 if unknown * */ int tsig_rr_lookup(tsig_rr_type* trr); /** * Prepare TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_prepare(tsig_rr_type* trr); /** * Update TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * \param[in] length number of octets of buffer to add to the TSIG hash, * replacing the buffer's id with the original * query idfrom TSIG. * */ void tsig_rr_update(tsig_rr_type* trr, buffer_type* buffer, size_t length); /** * Sign TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_sign(tsig_rr_type* trr); /** * Verify TSIG RR. * \param[in] trr TSIG RR * \return int 1 if verified, 0 on error * */ int tsig_rr_verify(tsig_rr_type* trr); /** * Append TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * */ void tsig_rr_append(tsig_rr_type* trr, buffer_type* buffer); /* * The amount of space to reserve in the response for the TSIG data. * \param[in] trr TSIG RR * \return size_t reserved space size * */ size_t tsig_rr_reserved_space(tsig_rr_type *trr); /** * Reply with error TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_error(tsig_rr_type* trr); /** * Get human readable TSIG error code. * \param[in] status TSIG status * \return const char* TSIG status * */ const char* tsig_status2str(tsig_status status); /** * Get human readable TSIG error code. * \param[in] error TSIG error code * \return const char* readable error code * */ const char* tsig_strerror(uint16_t error); /** * Free TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_free(tsig_rr_type* trr); /** * Cleanup TSIG RR * \param[in] trr TSIG RR * */ void tsig_rr_cleanup(tsig_rr_type* trr); /** * Clean up TSIG. * \param[in] tsig TSIG * \param[in] allocator memory allocator * */ void tsig_cleanup(tsig_type* tsig, allocator_type* allocator); #endif /* WIRE_TSIG_H */ opendnssec-1.4.3/signer/src/wire/axfr.c0000664000175000017500000005411312226742760014747 00000000000000/* * $Id: axfr.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * AXFR. * */ #include "config.h" #include "adapter/addns.h" #include "adapter/adutil.h" #include "shared/file.h" #include "shared/util.h" #include "wire/axfr.h" #include "wire/buffer.h" #include "wire/edns.h" #include "wire/query.h" #include "wire/sock.h" #define AXFR_TSIG_SIGN_EVERY_NTH 96 /* tsig sign every N packets. */ const char* axfr_str = "axfr"; /** * Handle SOA request. * */ query_state soa_request(query_type* q, engine_type* engine) { char* xfrfile = NULL; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; uint32_t ttl = 0; time_t expire = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned l = 0; FILE* fd = NULL; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(q->zone); ods_log_assert(q->zone->name); ods_log_assert(engine); xfrfile = ods_build_path(q->zone->name, ".axfr", 0, 1); if (xfrfile) { fd = ods_fopen(xfrfile, NULL, "r"); } if (!fd) { ods_log_error("[%s] unable to open file %s for zone %s", axfr_str, xfrfile, q->zone->name); free((void*)xfrfile); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } free((void*)xfrfile); if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; /* sign first packet in stream */ } /* compression? */ /* add SOA RR */ rr = addns_read_rr(fd, line, &orig, &prev, &ttl, &status, &l); if (!rr) { /* no SOA no transfer */ ods_log_error("[%s] bad axfr zone %s, corrupted file", axfr_str, q->zone->name); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } /* first RR must be SOA */ if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad axfr zone %s, first rr is not soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } /* zone not expired? */ if (q->zone->xfrd) { expire = q->zone->xfrd->serial_xfr_acquired; expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE)); if (expire < time_now()) { ods_log_warning("[%s] zone %s expired, not serving soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_debug("[%s] set soa in response %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); ldns_rr_free(rr); rr = NULL; } else { ods_log_error("[%s] soa does not fit in response %s", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } ods_fclose(fd); buffer_pkt_set_ancount(q->buffer, 1); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); buffer_pkt_set_aa(q->buffer); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; } return QUERY_PROCESSED; } /** * Do AXFR. * */ query_state axfr(query_type* q, engine_type* engine, int fallback) { char* xfrfile = NULL; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; uint16_t total_added = 0; uint32_t ttl = 0; time_t expire = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned l = 0; long fpos = 0; size_t bufpos = 0; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(q->zone); ods_log_assert(q->zone->name); ods_log_assert(engine); if (q->axfr_is_done) { ods_log_debug("[%s] zone transfer %s completed", axfr_str, q->zone->name); return QUERY_PROCESSED; } if (q->maxlen > AXFR_MAX_MESSAGE_LEN) { q->maxlen = AXFR_MAX_MESSAGE_LEN; } /* prepare TSIG */ if (!fallback) { q->tsig_prepare_it = 0; q->tsig_update_it = 1; if (q->tsig_sign_it) { q->tsig_prepare_it = 1; q->tsig_sign_it = 0; } } ods_log_assert(q->tsig_rr); if (q->axfr_fd == NULL) { /* start AXFR */ xfrfile = ods_build_path(q->zone->name, ".axfr", 0, 1); if (xfrfile) { q->axfr_fd = ods_fopen(xfrfile, NULL, "r"); } if (!q->axfr_fd) { ods_log_error("[%s] unable to open axfr file %s for zone %s", axfr_str, xfrfile, q->zone->name); free((void*)xfrfile); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } free((void*)xfrfile); if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; /* sign first packet in stream */ } /* compression? */ /* add SOA RR */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read axfr for zone %s: " "ftell() failed (%s)", axfr_str, q->zone->name, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l); if (!rr) { /* no SOA no transfer */ ods_log_error("[%s] bad axfr zone %s, corrupted file", axfr_str, q->zone->name); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } /* first RR must be SOA */ if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad axfr zone %s, first rr is not soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } /* zone not expired? */ if (q->zone->xfrd) { expire = q->zone->xfrd->serial_xfr_acquired; expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE)); if (expire < time_now()) { ods_log_warning("[%s] zone %s expired, not transferring zone", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_debug("[%s] set soa in axfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; ldns_rr_free(rr); rr = NULL; bufpos = buffer_position(q->buffer); } else { ods_log_error("[%s] soa does not fit in axfr zone %s", axfr_str, q->zone->name); ldns_rr_free(rr); rr = NULL; buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } } else if (q->tcp) { /* subsequent AXFR packets */ ods_log_debug("[%s] subsequent axfr packet zone %s", axfr_str, q->zone->name); q->edns_rr->status = EDNS_NOT_PRESENT; buffer_set_limit(q->buffer, BUFFER_PKT_HEADER_SIZE); buffer_pkt_set_qdcount(q->buffer, 0); query_prepare(q); } /* add as many records as fit */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read axfr for zone %s: " "ftell() failed (%s)", axfr_str, q->zone->name, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } while ((rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l)) != NULL) { ods_log_deeebug("[%s] read rr at line %d", axfr_str, l); if (status != LDNS_STATUS_OK) { ldns_rr_free(rr); rr = NULL; ods_log_error("[%s] error reading rr at line %i (%s): %s", axfr_str, l, ldns_get_errorstr_by_id(status), line); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_deeebug("[%s] add rr at line %d", axfr_str, l); ldns_rr_free(rr); rr = NULL; fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read axfr for zone %s: " "ftell() failed (%s)", axfr_str, q->zone->name, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; } else { ods_log_deeebug("[%s] rr at line %d does not fit", axfr_str, l); ldns_rr_free(rr); rr = NULL; if (fseek(q->axfr_fd, fpos, SEEK_SET) != 0) { ods_log_error("[%s] unable to reset file position in axfr " "file: fseek() failed (%s)", axfr_str, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } else if (q->tcp) { goto return_axfr; } else { goto udp_overflow; } } } ods_log_debug("[%s] axfr zone %s is done", axfr_str, q->zone->name); q->tsig_sign_it = 1; /* sign last packet */ q->axfr_is_done = 1; ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return_axfr: if (q->tcp) { ods_log_debug("[%s] return part axfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, total_added); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { if (q->tsig_rr->update_since_last_prepare >= AXFR_TSIG_SIGN_EVERY_NTH) { q->tsig_sign_it = 1; } } return QUERY_AXFR; } ods_log_error("[%s] zone transfer %s not tcp", axfr_str, q->zone->name); udp_overflow: /* UDP Overflow */ ods_log_info("[%s] axfr udp overflow zone %s", axfr_str, q->zone->name); buffer_set_position(q->buffer, bufpos); buffer_pkt_set_ancount(q->buffer, 1); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; } ods_log_debug("[%s] zone transfer %s udp overflow", axfr_str, q->zone->name); return QUERY_PROCESSED; } /** * Do IXFR (equal to AXFR for now). * */ query_state ixfr(query_type* q, engine_type* engine) { char* xfrfile = NULL; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; uint16_t total_added = 0; uint32_t ttl = 0; time_t expire = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned l = 0; long fpos = 0; size_t bufpos = 0; uint32_t new_serial = 0; unsigned del_mode = 0; unsigned soa_found = 0; ods_log_assert(engine); ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(q->zone); ods_log_assert(q->zone->name); if (q->axfr_is_done) { return QUERY_PROCESSED; } if (q->maxlen > AXFR_MAX_MESSAGE_LEN) { q->maxlen = AXFR_MAX_MESSAGE_LEN; } /* prepare TSIG */ q->tsig_prepare_it = 0; q->tsig_update_it = 1; if (q->tsig_sign_it) { q->tsig_prepare_it = 1; q->tsig_sign_it = 0; } ods_log_assert(q->tsig_rr); if (q->axfr_fd == NULL) { /* start IXFR */ xfrfile = ods_build_path(q->zone->name, ".ixfr", 0, 1); if (xfrfile) { q->axfr_fd = ods_fopen(xfrfile, NULL, "r"); } if (!q->axfr_fd) { ods_log_error("[%s] unable to open ixfr file %s for zone %s", axfr_str, xfrfile, q->zone->name); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); free((void*)xfrfile); buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } free((void*)xfrfile); if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; /* sign first packet in stream */ } /* compression? */ /* add SOA RR */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read ixfr for zone %s: ftell() " "failed (%s)", axfr_str, q->zone->name, strerror(errno)); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l); if (!rr) { /* no SOA no transfer */ ods_log_error("[%s] bad ixfr zone %s, corrupted file", axfr_str, q->zone->name); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } /* first RR must be SOA */ if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad ixfr zone %s, first rr is not soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } /* zone not expired? */ if (q->zone->xfrd) { expire = q->zone->xfrd->serial_xfr_acquired; expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE)); if (expire < time_now()) { ods_log_warning("[%s] zone %s expired, not transferring zone", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } } /* newest serial */ new_serial = ldns_rdf2native_int32( ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); /* does it fit? */ buffer_set_position(q->buffer, q->startpos); if (query_add_rr(q, rr)) { ods_log_debug("[%s] set soa in ixfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; ldns_rr_free(rr); rr = NULL; bufpos = buffer_position(q->buffer); } else { ods_log_error("[%s] soa does not fit in ixfr zone %s", axfr_str, q->zone->name); ldns_rr_free(rr); rr = NULL; buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } if (util_serial_gt(q->serial, new_serial)) { goto axfr_fallback; } } else if (q->tcp) { /* subsequent IXFR packets */ ods_log_debug("[%s] subsequent ixfr packet zone %s", axfr_str, q->zone->name); buffer_set_limit(q->buffer, BUFFER_PKT_HEADER_SIZE); buffer_pkt_set_qdcount(q->buffer, 0); query_prepare(q); soa_found = 1; } /* add as many records as fit */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read ixfr for zone %s: ftell() failed " "(%s)", axfr_str, q->zone->name, strerror(errno)); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } while ((rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l)) != NULL) { ods_log_deeebug("[%s] read rr at line %d", axfr_str, l); if (status != LDNS_STATUS_OK) { ldns_rr_free(rr); rr = NULL; ods_log_error("[%s] error reading rr at line %i (%s): %s", axfr_str, l, ldns_get_errorstr_by_id(status), line); goto axfr_fallback; } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { del_mode = !del_mode; } if (!soa_found) { if (del_mode && ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA && q->serial == ldns_rdf2native_int32( ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL))) { soa_found = 1; } else { ods_log_deeebug("[%s] soa serial %u not found for rr at line %d", axfr_str, q->serial, l); continue; } } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_deeebug("[%s] add rr at line %d", axfr_str, l); ldns_rr_free(rr); rr = NULL; fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read ixfr for zone %s: ftell() " "failed (%s)", axfr_str, q->zone->name, strerror(errno)); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; } else { ods_log_deeebug("[%s] rr at line %d does not fit", axfr_str, l); ldns_rr_free(rr); rr = NULL; if (fseek(q->axfr_fd, fpos, SEEK_SET) != 0) { ods_log_error("[%s] unable to reset file position in ixfr " "file: fseek() failed (%s)", axfr_str, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } else if (q->tcp) { goto return_ixfr; } else { goto axfr_fallback; } } } if (!soa_found) { ods_log_warning("[%s] zone %s journal not found for serial %u", axfr_str, q->zone->name, q->serial); goto axfr_fallback; } ods_log_debug("[%s] ixfr zone %s is done", axfr_str, q->zone->name); q->tsig_sign_it = 1; /* sign last packet */ q->axfr_is_done = 1; ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return_ixfr: ods_log_debug("[%s] return part ixfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, total_added); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { if (q->tsig_rr->update_since_last_prepare >= AXFR_TSIG_SIGN_EVERY_NTH) { q->tsig_sign_it = 1; } } return QUERY_IXFR; axfr_fallback: if (q->tcp) { ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); if (q->axfr_fd) { ods_fclose(q->axfr_fd); q->axfr_fd = NULL; } buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } /* UDP Overflow */ ods_log_info("[%s] ixfr udp overflow zone %s", axfr_str, q->zone->name); buffer_set_position(q->buffer, bufpos); buffer_pkt_set_ancount(q->buffer, 1); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; } return QUERY_PROCESSED; } opendnssec-1.4.3/signer/src/wire/netio.c0000664000175000017500000002352311665406617015132 00000000000000/* * $Id: netio.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2001-2011, NLnet Labs. All rights reserved. * * See LICENSE for the license. * */ #include #include #include #include #include #include #include "shared/log.h" #include "wire/netio.h" #ifndef HAVE_PSELECT int pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, const struct timespec* timeout, const sigset_t* sigmask); #else #include #endif /* One second is 1e9 nanoseconds. */ #define NANOSECONDS_PER_SECOND 1000000000L static const char* netio_str = "netio"; /* * Create a new netio instance. * \return netio_type* netio instance * */ netio_type* netio_create(allocator_type* allocator) { netio_type* netio = NULL; if (!allocator) { return NULL; } netio = (netio_type*) allocator_alloc(allocator, sizeof(netio_type)); netio->allocator = allocator; netio->handlers = NULL; netio->deallocated = NULL; netio->dispatch_next = NULL; return netio; } /* * Add a new handler to netio. * */ void netio_add_handler(netio_type* netio, netio_handler_type* handler) { netio_handler_list_type* l = NULL; if (!netio || !handler) { return; } if (netio->deallocated) { l = netio->deallocated; netio->deallocated = l->next; } else { ods_log_assert(netio->allocator); l = (netio_handler_list_type*) allocator_alloc(netio->allocator, sizeof(netio_handler_list_type)); } l->next = netio->handlers; l->handler = handler; netio->handlers = l; ods_log_debug("[%s] handler added", netio_str); return; } /* * Remove the handler from netio. * */ void netio_remove_handler(netio_type* netio, netio_handler_type* handler) { netio_handler_list_type** lptr; if (!netio || !handler) { return; } for (lptr = &netio->handlers; *lptr; lptr = &(*lptr)->next) { if ((*lptr)->handler == handler) { netio_handler_list_type* next = (*lptr)->next; if ((*lptr) == netio->dispatch_next) netio->dispatch_next = next; (*lptr)->handler = NULL; (*lptr)->next = netio->deallocated; netio->deallocated = *lptr; *lptr = next; break; } } ods_log_debug("[%s] handler removed", netio_str); return; } /* * Convert timeval to timespec. * */ static void timeval_to_timespec(struct timespec* left, const struct timeval* right) { left->tv_sec = right->tv_sec; left->tv_nsec = 1000 * right->tv_usec; return; } /** * Compare timespec. * */ static int timespec_compare(const struct timespec* left, const struct timespec* right) { if (left->tv_sec < right->tv_sec) { return -1; } else if (left->tv_sec > right->tv_sec) { return 1; } else if (left->tv_nsec < right->tv_nsec) { return -1; } else if (left->tv_nsec > right->tv_nsec) { return 1; } return 0; } /** * Add timespecs. * */ void timespec_add(struct timespec* left, const struct timespec* right) { left->tv_sec += right->tv_sec; left->tv_nsec += right->tv_nsec; if (left->tv_nsec >= NANOSECONDS_PER_SECOND) { ++left->tv_sec; left->tv_nsec -= NANOSECONDS_PER_SECOND; } return; } /** * Substract timespecs. * */ static void timespec_subtract(struct timespec* left, const struct timespec* right) { left->tv_sec -= right->tv_sec; left->tv_nsec -= right->tv_nsec; if (left->tv_nsec < 0L) { --left->tv_sec; left->tv_nsec += NANOSECONDS_PER_SECOND; } return; } /* * Retrieve the current time (using gettimeofday(2)). * */ const struct timespec* netio_current_time(netio_type* netio) { struct timeval current_timeval; ods_log_assert(netio); if (!netio->have_current_time) { if (gettimeofday(¤t_timeval, NULL) == -1) { ods_log_crit("[%s] unable to get current time: " "gettimeofday() failed (%s)", netio_str, strerror(errno)); abort(); } timeval_to_timespec(&netio->cached_current_time, ¤t_timeval); netio->have_current_time = 1; } return &netio->cached_current_time; } /* * Check for events and dispatch them to the handlers. * */ int netio_dispatch(netio_type* netio, const struct timespec* timeout, const sigset_t* sigmask) { fd_set readfds, writefds, exceptfds; int max_fd; int have_timeout = 0; struct timespec minimum_timeout; netio_handler_type* timeout_handler = NULL; netio_handler_list_type* l = NULL; int rc = 0; int result = 0; if (!netio || !netio->handlers) { return 0; } /* Clear the cached current time */ netio->have_current_time = 0; /* Initialize the minimum timeout with the timeout parameter */ if (timeout) { have_timeout = 1; memcpy(&minimum_timeout, timeout, sizeof(struct timespec)); } /* Initialize the fd_sets and timeout based on the handler * information */ max_fd = -1; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); for (l = netio->handlers; l; l = l->next) { netio_handler_type* handler = l->handler; if (handler->fd >= 0 && handler->fd < (int) FD_SETSIZE) { if (handler->fd > max_fd) { max_fd = handler->fd; } if (handler->event_types & NETIO_EVENT_READ) { FD_SET(handler->fd, &readfds); } if (handler->event_types & NETIO_EVENT_WRITE) { FD_SET(handler->fd, &writefds); } if (handler->event_types & NETIO_EVENT_EXCEPT) { FD_SET(handler->fd, &exceptfds); } } if (handler->timeout && (handler->event_types & NETIO_EVENT_TIMEOUT)) { struct timespec relative; relative.tv_sec = handler->timeout->tv_sec; relative.tv_nsec = handler->timeout->tv_nsec; timespec_subtract(&relative, netio_current_time(netio)); if (!have_timeout || timespec_compare(&relative, &minimum_timeout) < 0) { have_timeout = 1; minimum_timeout.tv_sec = relative.tv_sec; minimum_timeout.tv_nsec = relative.tv_nsec; timeout_handler = handler; } } } if (have_timeout && minimum_timeout.tv_sec < 0) { /* * On negative timeout for a handler, immediately * dispatch the timeout event without checking for other events. */ ods_log_debug("[%s] dispatch timeout event without checking for " "other events", netio_str); if (timeout_handler && (timeout_handler->event_types & NETIO_EVENT_TIMEOUT)) { timeout_handler->event_handler(netio, timeout_handler, NETIO_EVENT_TIMEOUT); } return result; } /* Check for events. */ rc = pselect(max_fd + 1, &readfds, &writefds, &exceptfds, have_timeout ? &minimum_timeout : NULL, sigmask); if (rc == -1) { if(errno == EINVAL || errno == EACCES || errno == EBADF) { ods_fatal_exit("[%s] fatal error pselect: %s", netio_str, strerror(errno)); } return -1; } /* Clear the cached current_time (pselect(2) may block for * some time so the cached value is likely to be old). */ netio->have_current_time = 0; if (rc == 0) { ods_log_debug("[%s] no events before the minimum timeout " "expired", netio_str); /* * No events before the minimum timeout expired. * Dispatch to handler if interested. */ if (timeout_handler && (timeout_handler->event_types & NETIO_EVENT_TIMEOUT)) { timeout_handler->event_handler(netio, timeout_handler, NETIO_EVENT_TIMEOUT); } } else { /* * Dispatch all the events to interested handlers * based on the fd_sets. Note that a handler might * deinstall itself, so store the next handler before * calling the current handler! */ ods_log_assert(netio->dispatch_next == NULL); for (l = netio->handlers; l && rc; ) { netio_handler_type* handler = l->handler; netio->dispatch_next = l->next; if (handler->fd >= 0 && handler->fd < (int) FD_SETSIZE) { netio_events_type event_types = NETIO_EVENT_NONE; if (FD_ISSET(handler->fd, &readfds)) { event_types |= NETIO_EVENT_READ; FD_CLR(handler->fd, &readfds); rc--; } if (FD_ISSET(handler->fd, &writefds)) { event_types |= NETIO_EVENT_WRITE; FD_CLR(handler->fd, &writefds); rc--; } if (FD_ISSET(handler->fd, &exceptfds)) { event_types |= NETIO_EVENT_EXCEPT; FD_CLR(handler->fd, &exceptfds); rc--; } if (event_types & handler->event_types) { handler->event_handler(netio, handler, event_types & handler->event_types); ++result; } } l = netio->dispatch_next; } netio->dispatch_next = NULL; } return result; } /** * Clean up netio instance * */ void netio_cleanup(netio_type* netio) { allocator_type* allocator = NULL; if (!netio) { return; } allocator = netio->allocator; allocator_deallocate(allocator, (void*)netio->handlers); allocator_deallocate(allocator, (void*)netio->deallocated); allocator_deallocate(allocator, (void*)netio); return; } opendnssec-1.4.3/signer/src/wire/edns.h0000664000175000017500000000630611756437501014747 00000000000000/* * $Id: edns.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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, 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 ``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 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. * */ /** * EDNS. * */ #ifndef WIRE_EDNS_H #define WIRE_EDNS_H #include "config.h" #include "shared/allocator.h" #include "wire/buffer.h" #include #define OPT_LEN 9U /* length of the NSD EDNS response record minus 2 */ #define OPT_RDATA 2 /* holds the rdata length comes after OPT_LEN */ #define DNSSEC_OK_MASK 0x8000U /* do bit mask */ #define EDNS_MAX_MESSAGE_LEN 4096 /** * EDNS data. * */ typedef struct edns_data_struct edns_data_type; struct edns_data_struct { unsigned char ok[OPT_LEN]; unsigned char error[OPT_LEN]; unsigned char rdata_none[OPT_RDATA]; }; /** * EDNS status. * */ enum edns_status_enum { EDNS_NOT_PRESENT, EDNS_OK, EDNS_ERROR }; typedef enum edns_status_enum edns_status; /** * EDNS RR. * */ typedef struct edns_rr_struct edns_rr_type; struct edns_rr_struct { allocator_type* allocator; edns_status status; size_t position; size_t maxlen; int dnssec_ok; }; /** * Initialize EDNS. * \param[in] data EDNS data. * \param[in] max_length maximum length. * */ void edns_init(edns_data_type* data, uint16_t max_length); /** * Create new EDNS RR. * \param[in] allocator memory allocator. * \return edns_rr_type* EDNS RR. * */ edns_rr_type* edns_rr_create(allocator_type* allocator); /** * Reset EDNS OPT RR. * \param[in] err EDNS record. * */ void edns_rr_reset(edns_rr_type* err); /** * Parse EDNS OPT RR. * \param[in] err EDNS record. * \param[in] buffer packet buffer. * \return int 1 if EDNS and valid, 0 otherwise. * */ int edns_rr_parse(edns_rr_type* err, buffer_type* buffer); /** * The amount of space to reserve in the response for the EDNS data. * \param[in] err EDNS record. * \return size_t amount of space to reserve. * */ size_t edns_rr_reserved_space(edns_rr_type* err); #endif /* WIRE_EDNS_H */ opendnssec-1.4.3/signer/src/wire/listener.c0000664000175000017500000001457412005520472015630 00000000000000/* * $Id: listener.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Listener. * */ #include "config.h" #include "shared/log.h" #include "wire/listener.h" static const char* listener_str = "listener"; /** * Create listener. * */ listener_type* listener_create(allocator_type* allocator) { listener_type* listener = NULL; if (!allocator) { return NULL; } listener = (listener_type*) allocator_alloc(allocator, sizeof(listener_type)); if (!listener) { ods_log_error("[%s] create listener failed: allocator_alloc() failed", listener_str); return NULL; } listener->allocator = allocator; listener->count = 0; listener->interfaces = NULL; return listener; } /** * Push an interface to the listener. * */ interface_type* listener_push(listener_type* listener, char* address, int family, char* port) { interface_type* ifs_old = NULL; ods_log_assert(listener); ods_log_assert(address); ifs_old = listener->interfaces; listener->interfaces = (interface_type*) allocator_alloc( listener->allocator, (listener->count + 1) * sizeof(interface_type)); if (!listener->interfaces) { ods_fatal_exit("[%s] fatal unable to add interface: allocator_alloc() failed", listener_str); } if (ifs_old) { memcpy(listener->interfaces, ifs_old, (listener->count) * sizeof(interface_type)); } allocator_deallocate(listener->allocator, (void*) ifs_old); listener->count++; listener->interfaces[listener->count -1].address = allocator_strdup(listener->allocator, address); listener->interfaces[listener->count -1].family = family; if (port) { listener->interfaces[listener->count -1].port = allocator_strdup(listener->allocator, port); } else{ listener->interfaces[listener->count -1].port = NULL; } memset(&listener->interfaces[listener->count -1].addr, 0, sizeof(union acl_addr_storage)); if (listener->interfaces[listener->count -1].family == AF_INET6 && strlen(listener->interfaces[listener->count -1].address) > 0) { if (inet_pton(listener->interfaces[listener->count -1].family, listener->interfaces[listener->count -1].address, &listener->interfaces[listener->count -1].addr.addr6) != 1) { ods_log_error("[%s] bad ip address '%s'", listener->interfaces[listener->count -1].address); return NULL; } } else if (listener->interfaces[listener->count -1].family == AF_INET && strlen(listener->interfaces[listener->count -1].address) > 0) { if (inet_pton(listener->interfaces[listener->count -1].family, listener->interfaces[listener->count -1].address, &listener->interfaces[listener->count -1].addr.addr) != 1) { ods_log_error("[%s] bad ip address '%s'", listener->interfaces[listener->count -1].address); return NULL; } } return &listener->interfaces[listener->count -1]; } /** * Print interface. * */ static void interface_print(FILE* fd, interface_type* i) { if (!fd || !i) { return; } fprintf(fd, ""); if (i->family == AF_INET && i->address) { fprintf(fd, "%s", i->address); } else if (i->family == AF_INET6 && i->address) { fprintf(fd, "%s", i->address); } if (i->port) { fprintf(fd, "%s", i->port); } fprintf(fd, "\n"); return; } /** * Print listener. * */ void listener_print(FILE* fd, listener_type* listener) { uint16_t i = 0; if (!fd || !listener || listener->count <= 0) { return; } fprintf(fd, "\n"); for (i=0; i < listener->count; i++) { interface_print(fd, &listener->interfaces[i]); } fprintf(fd, "\n"); return; } /** * Log interface. * */ static void interface_log(interface_type* i) { if (!i) { return; } ods_log_debug("[%s] FAMILY[%s] ADDRESS[%s] PORT[%s]", listener_str, i->family==AF_INET6?"IPv6":"IPv4", i->address?i->address:"localhost", i->port?i->port:DNS_PORT_STRING); return; } /** * Log listener. * */ void listener_log(listener_type* listener) { uint16_t i = 0; if (!listener || listener->count <= 0) { return; } for (i=0; i < listener->count; i++) { interface_log(&listener->interfaces[i]); } return; } /** * Clean up interface. * */ void interface_cleanup(interface_type* i) { if (!i) { return; } free((void*)i->port); free((void*)i->address); return; } /** * Clean up listener. * */ void listener_cleanup(listener_type* listener) { uint16_t i = 0; allocator_type* allocator = NULL; if (!listener) { return; } for (i=0; i < listener->count; i++) { interface_cleanup(&listener->interfaces[i]); } allocator = listener->allocator; allocator_deallocate(allocator, (void*) listener->interfaces); allocator_deallocate(allocator, (void*) listener); return; } opendnssec-1.4.3/signer/src/wire/edns.c0000664000175000017500000001147411756437501014744 00000000000000/* * $Id: edns.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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, 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 ``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 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. * */ /** * TSIG. * */ #include "config.h" #include "compat.h" #include "wire/buffer.h" #include "wire/edns.h" #include static const char* edns_str = "edns"; /** * Create new EDNS RR. * */ edns_rr_type* edns_rr_create(allocator_type* allocator) { edns_rr_type* err = NULL; if (!allocator) { return NULL; } err = (edns_rr_type*) allocator_alloc(allocator, sizeof(edns_rr_type)); if (!err) { ods_log_error("[%s] unable to create edns rr: allocator_alloc() " "failed", edns_str); return NULL; } err->allocator = allocator; edns_rr_reset(err); return err; } /** * Initialize EDNS. * */ void edns_init(edns_data_type* data, uint16_t max_length) { if (!data) { return; } memset(data, 0, sizeof(edns_data_type)); /* record type: OPT */ data->ok[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8; /* type_hi */ data->ok[2] = LDNS_RR_TYPE_OPT & 0x00ff; /* type_lo */ /* udp payload size */ data->ok[3] = (max_length & 0xff00) >> 8; /* size_hi */ data->ok[4] = max_length & 0x00ff; /* size_lo */ data->error[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8; /* type_hi */ data->error[2] = LDNS_RR_TYPE_OPT & 0x00ff; /* type_lo */ data->error[3] = (max_length & 0xff00) >> 8; /* size_hi */ data->error[4] = max_length & 0x00ff; /* size_lo */ data->error[5] = 1; /* Extended RCODE=BAD VERS */ return; } /** * Reset EDNS OPT RR. * */ void edns_rr_reset(edns_rr_type* err) { if (!err) { return; } err->status = EDNS_NOT_PRESENT; err->position = 0; err->maxlen = 0; err->dnssec_ok = 0; return; } /** * Parse EDNS OPT RR. * */ int edns_rr_parse(edns_rr_type* err, buffer_type* buffer) { /* OPT record type... */ uint8_t opt_owner; uint16_t opt_type; uint16_t opt_class; uint8_t opt_version; uint16_t opt_flags; if (!err || !buffer) { ods_log_debug("[%s] parse: no edns rr or no packet buffer available", edns_str); return 0; } err->position = buffer_position(buffer); if (!buffer_available(buffer, (OPT_LEN + OPT_RDATA))) { ods_log_debug("[%s] parse: edns rr too small", edns_str); return 0; } opt_owner = buffer_read_u8(buffer); opt_type = buffer_read_u16(buffer); if (opt_owner != 0 || opt_type != LDNS_RR_TYPE_OPT) { /* Not EDNS. */ ods_log_debug("[%s] parse: not OPT: owner=%02x, type=%02x", edns_str, opt_owner, opt_type); buffer_set_position(buffer, err->position); return 0; } opt_class = buffer_read_u16(buffer); (void)buffer_read_u8(buffer); /* opt_extended_rcode */ opt_version = buffer_read_u8(buffer); opt_flags = buffer_read_u16(buffer); (void)buffer_read_u16(buffer); /* opt_rdlen */ if (opt_version != 0) { /* The only error is VERSION not implemented */ ods_log_debug("[%s] parse: wrong edns version", edns_str); err->status = EDNS_ERROR; return 1; } err->status = EDNS_OK; err->maxlen = opt_class; err->dnssec_ok = opt_flags & DNSSEC_OK_MASK; return 1; } /** * The amount of space to reserve in the response for the EDNS data. * */ size_t edns_rr_reserved_space(edns_rr_type* err) { if (!err) { return 0; } return err->status == EDNS_NOT_PRESENT ? 0 : (OPT_LEN + OPT_RDATA); } opendnssec-1.4.3/signer/src/wire/tcpset.h0000664000175000017500000000702011665406617015315 00000000000000/* * $Id: tcpset.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * TCP connections. * */ #ifndef WIRE_TCPSET_H #define WIRE_TCPSET_H #include "config.h" #include "shared/allocator.h" #include "wire/buffer.h" #include "wire/xfrd.h" #include #define TCPSET_MAX 50 /** * tcp connection. * */ typedef struct tcp_conn_struct tcp_conn_type; struct tcp_conn_struct { int fd; /* how many bytes have been read/written - total, incl. tcp length bytes */ uint32_t total_bytes; /* msg len bytes */ uint16_t msglen; /* packet buffer of connection */ buffer_type* packet; /* state: reading or writing */ unsigned is_reading : 1; }; /* * Set of tcp connections. * */ typedef struct tcp_set_struct tcp_set_type; struct tcp_set_struct { tcp_conn_type* tcp_conn[TCPSET_MAX]; xfrd_type* tcp_waiting_first; xfrd_type* tcp_waiting_last; size_t tcp_count; }; /** * Create a tcp connection. * \param[in] allocator memory allocator * \return tcp_conn_type* TCP connection. * */ tcp_conn_type* tcp_conn_create(allocator_type* allocator); /** * Create a set of tcp connections. * \param[in] allocator memory allocator * \return tcp_set_type* set of tcp connection. * */ tcp_set_type* tcp_set_create(allocator_type* allocator); /** * Make tcp connection ready for reading. * \param[in] tcp tcp connection * */ void tcp_conn_ready(tcp_conn_type* tcp); /* * Read from a tcp connection. * On first call, make sure total_bytes = 0, msglen=0, buffer clear, * and the packet and fd need to be set. * \param[in] tcp tcp connection * \return int -1 on error, * 0 on short read, * 1 on completed read. * */ int tcp_conn_read(tcp_conn_type* tcp); /* * Write to a tcp connection. * On first call, make sure total_bytes=0, msglen=limit, buffer filled, * and the packet and fd need to be set. * \param[in] tcp tcp connection * \return int -1 on error, * 0 on short write, * 1 on completed write. * */ int tcp_conn_write(tcp_conn_type* tcp); /** * Clean up set of tcp connections. * \param[in] set set of tcp connections * \param[in] allocator memory allocator * */ void tcp_set_cleanup(tcp_set_type* set, allocator_type* allocator); #endif /* WIRE_TCPSET_H */ opendnssec-1.4.3/signer/src/wire/buffer.c0000664000175000017500000005704612173474626015274 00000000000000/* * $Id: buffer.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Packet buffer. * * 1 1 1 1 1 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 01 | ID | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 23 |QR| Opcode |AA|TC|RD|RA| Z|AD|CD| RCODE | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 45 | QDCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 67 | ANCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 89 | NSCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 01 | ARCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * */ #include "config.h" #include "shared/log.h" #include "wire/buffer.h" #include static const char* buffer_str = "buffer"; ods_lookup_table ods_rcode_str[] = { { LDNS_RCODE_NOERROR, "NOERROR" }, { LDNS_RCODE_FORMERR, "FORMERR" }, { LDNS_RCODE_SERVFAIL, "SERVFAIL" }, { LDNS_RCODE_NXDOMAIN, "NXDOMAIN" }, { LDNS_RCODE_NOTIMPL, "NOTIMPL" }, { LDNS_RCODE_REFUSED, "REFUSED" }, { LDNS_RCODE_YXDOMAIN, "YXDOMAIN" }, { LDNS_RCODE_YXRRSET, "YXRRSET" }, { LDNS_RCODE_NXRRSET, "NXRRSET" }, { LDNS_RCODE_NOTAUTH, "NOTAUTH" }, { LDNS_RCODE_NOTZONE, "NOTZONE" }, { 0, NULL } }; /** * Create a new buffer with the specified capacity. * */ buffer_type* buffer_create(allocator_type* allocator, size_t capacity) { buffer_type* buffer = NULL; if (!allocator || !capacity) { return NULL; } buffer = (buffer_type *) allocator_alloc(allocator, sizeof(buffer_type)); if (!buffer) { return NULL; } buffer->data = (uint8_t*) calloc(capacity, sizeof(uint8_t)); buffer->position = 0; buffer->limit = capacity; buffer->capacity = capacity; buffer->fixed = 0; return buffer; } /** * Create a buffer with the specified data. * */ void buffer_create_from(buffer_type* buffer, void* data, size_t size) { ods_log_assert(buffer); buffer->data = (uint8_t*) data; buffer->position = 0; buffer->limit = size; buffer->capacity = size; buffer->fixed = 1; return; } /** * Clear the buffer and make it ready for writing. * */ void buffer_clear(buffer_type* buffer) { ods_log_assert(buffer); buffer->position = 0; buffer->limit = buffer->capacity; return; } /** * Flip the buffer and make it ready for reading. * */ void buffer_flip(buffer_type* buffer) { ods_log_assert(buffer); buffer->limit = buffer->position; buffer->position = 0; return; } /** * Make the buffer ready for re-reading the data. * */ void buffer_rewind(buffer_type* buffer) { ods_log_assert(buffer); buffer->position = 0; return; } /** * Get the buffer's position. * */ size_t buffer_position(buffer_type* buffer) { ods_log_assert(buffer); return buffer->position; } /** * Set the buffer's position. * */ void buffer_set_position(buffer_type* buffer, size_t pos) { ods_log_assert(buffer); ods_log_assert(pos <= buffer->limit); buffer->position = pos; return; } /** * Change the buffer's position. * */ void buffer_skip(buffer_type* buffer, ssize_t count) { ods_log_assert(buffer); ods_log_assert(buffer->position + count <= buffer->limit); buffer->position += count; return; } /** * Get bit. * */ static int get_bit(uint8_t bits[], size_t index) { return bits[index / 8] & (1 << (7 - index % 8)); } /** * Set bit. * */ static void set_bit(uint8_t bits[], size_t index) { bits[index / 8] |= (1 << (7 - index % 8)); return; } /** * Is pointer label> * */ static int label_is_pointer(const uint8_t* label) { ods_log_assert(label); return (label[0] & 0xc0) == 0xc0; } /** * Pointer label location. * */ static uint16_t label_pointer_location(const uint8_t* label) { ods_log_assert(label); ods_log_assert(label_is_pointer(label)); return ((uint16_t) (label[0] & ~0xc0) << 8) | (uint16_t) label[1]; } /** * Is normal label? * */ static int label_is_normal(const uint8_t* label) { ods_log_assert(label); return (label[0] & 0xc0) == 0; } /* * Is root label? * */ static inline int label_is_root(const uint8_t* label) { ods_log_assert(label); return label[0] == 0; } /* * Label length. * */ static uint8_t label_length(const uint8_t* label) { ods_log_assert(label); ods_log_assert(label_is_normal(label)); return label[0]; } /** * Read dname from buffer. * */ size_t buffer_read_dname(buffer_type* buffer, uint8_t* dname, unsigned allow_pointers) { int done = 0; uint8_t visited[(MAX_PACKET_SIZE+7)/8]; size_t dname_length = 0; const uint8_t *label = NULL; ssize_t mark = -1; ods_log_assert(buffer); memset(visited, 0, (buffer_limit(buffer)+7)/8); while (!done) { if (!buffer_available(buffer, 1)) { return 0; } if (get_bit(visited, buffer_position(buffer))) { ods_log_error("[%s] dname loop!", buffer_str); return 0; } set_bit(visited, buffer_position(buffer)); label = buffer_current(buffer); if (label_is_pointer(label)) { size_t pointer = 0; if (!allow_pointers) { return 0; } if (!buffer_available(buffer, 2)) { return 0; } pointer = label_pointer_location(label); if (pointer >= buffer_limit(buffer)) { return 0; } buffer_skip(buffer, 2); if (mark == -1) { mark = buffer_position(buffer); } buffer_set_position(buffer, pointer); } else if (label_is_normal(label)) { size_t length = label_length(label) + 1; done = label_is_root(label); if (!buffer_available(buffer, length)) { return 0; } if (dname_length + length >= MAXDOMAINLEN+1) { return 0; } buffer_read(buffer, dname + dname_length, length); dname_length += length; } else { return 0; } } if (mark != -1) { buffer_set_position(buffer, mark); } return dname_length; } /** * Change the buffer's position so that one dname is skipped. * */ int buffer_skip_dname(buffer_type* buffer) { ods_log_assert(buffer); while (1) { uint8_t label_size = 0; if (!buffer_available(buffer, 1)) { return 0; } label_size = buffer_read_u8(buffer); if (label_size == 0) { break; } else if ((label_size & 0xc0) != 0) { if (!buffer_available(buffer, 1)) { return 0; } buffer_skip(buffer, 1); break; } else if (!buffer_available(buffer, label_size)) { return 0; } else { buffer_skip(buffer, label_size); } } return 1; } /** * Change the buffer's position so that one RR is skipped. * */ int buffer_skip_rr(buffer_type* buffer, unsigned qrr) { if (!buffer_skip_dname(buffer)) { return 0; } if (qrr) { if (!buffer_available(buffer, 4)) { return 0; } buffer_skip(buffer, 4); } else { uint16_t rdata_size; if (!buffer_available(buffer, 10)) { return 0; } buffer_skip(buffer, 8); rdata_size = buffer_read_u16(buffer); if (!buffer_available(buffer, rdata_size)) { return 0; } buffer_skip(buffer, rdata_size); } return 1; } /** * Get the buffer's limit. * */ size_t buffer_limit(buffer_type* buffer) { ods_log_assert(buffer); return buffer->limit; } /** * Set the buffer's limit. * */ void buffer_set_limit(buffer_type* buffer, size_t limit) { ods_log_assert(buffer); ods_log_assert(limit <= buffer->capacity); buffer->limit = limit; if (buffer->position > buffer->limit) { buffer->position = buffer->limit; } return; } /** * Get the buffer's capacity. * */ size_t buffer_capacity(buffer_type* buffer) { ods_log_assert(buffer); return buffer->capacity; } /** * Return a pointer to the data at the indicated position. * */ uint8_t* buffer_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); ods_log_assert(at <= buffer->limit); return buffer->data + at; } /** * Return a pointer to the data at the beginning of the buffer. * */ uint8_t* buffer_begin(buffer_type* buffer) { ods_log_assert(buffer); return buffer_at(buffer, 0); } /** * Return a pointer to the data at the end of the buffer. * */ uint8_t* buffer_end(buffer_type* buffer) { ods_log_assert(buffer); return buffer_at(buffer, buffer->limit); } /** * Return a pointer to the data at the buffer's current position. * */ uint8_t* buffer_current(buffer_type* buffer) { ods_log_assert(buffer); return buffer_at(buffer, buffer->position); } /** * The number of bytes remaining between the at and limit. * */ static size_t buffer_remaining_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); ods_log_assert(at <= buffer->limit); return buffer->limit - at; } /** * The number of bytes remaining between the buffer's position and limit. * */ size_t buffer_remaining(buffer_type* buffer) { ods_log_assert(buffer); return buffer_remaining_at(buffer, buffer->position); } /** * Check if the buffer has enough bytes available at indicated position. * */ static int buffer_available_at(buffer_type *buffer, size_t at, size_t count) { ods_log_assert(buffer); return count <= buffer_remaining_at(buffer, at); } /** * Check if the buffer has enough bytes available. * */ int buffer_available(buffer_type *buffer, size_t count) { ods_log_assert(buffer); return buffer_available_at(buffer, buffer->position, count); } /** * Write to buffer at indicated position. * */ static void buffer_write_u8_at(buffer_type* buffer, size_t at, uint8_t data) { ods_log_assert(buffer); ods_log_assert(buffer_available_at(buffer, at, sizeof(data))); buffer->data[at] = data; return; } /** * Write to buffer at indicated position. * */ void buffer_write_u16_at(buffer_type* buffer, size_t at, uint16_t data) { ods_log_assert(buffer); ods_log_assert(buffer_available_at(buffer, at, sizeof(data))); write_uint16(buffer->data + at, data); return; } /** * Write to buffer at indicated position. * */ static void buffer_write_u32_at(buffer_type* buffer, size_t at, uint32_t data) { ods_log_assert(buffer); ods_log_assert(buffer_available_at(buffer, at, sizeof(data))); write_uint32(buffer->data + at, data); return; } /** * Write to buffer. * */ void buffer_write(buffer_type* buffer, const void* data, size_t count) { ods_log_assert(buffer); ods_log_assert(buffer_available(buffer, count)); memcpy(buffer->data + buffer->position, data, count); buffer->position += count; return; } /** * Write uint8_t to buffer. * */ void buffer_write_u8(buffer_type* buffer, uint8_t data) { ods_log_assert(buffer); buffer_write_u8_at(buffer, buffer->position, data); buffer->position += sizeof(data); return; } /** * Write uint16_t to buffer. * */ void buffer_write_u16(buffer_type* buffer, uint16_t data) { ods_log_assert(buffer); buffer_write_u16_at(buffer, buffer->position, data); buffer->position += sizeof(data); return; } /** * Write uint32_t to buffer. * */ void buffer_write_u32(buffer_type* buffer, uint32_t data) { ods_log_assert(buffer); buffer_write_u32_at(buffer, buffer->position, data); buffer->position += sizeof(data); return; } /** * Write rdf to buffer. * */ void buffer_write_rdf(buffer_type* buffer, ldns_rdf* rdf) { ods_log_assert(buffer); ods_log_assert(rdf); buffer_write(buffer, ldns_rdf_data(rdf), ldns_rdf_size(rdf)); /* position updated by buffer_write() */ return; } /** * Write rr to buffer. * */ int buffer_write_rr(buffer_type* buffer, ldns_rr* rr) { size_t i = 0; size_t tc_mark = 0; size_t rdlength_pos = 0; uint16_t rdlength = 0; ods_log_assert(buffer); ods_log_assert(rr); /* set truncation mark, in case rr does not fit */ tc_mark = buffer_position(buffer); /* owner type class ttl */ if (!buffer_available(buffer, ldns_rdf_size(ldns_rr_owner(rr)))) { goto buffer_tc; } buffer_write_rdf(buffer, ldns_rr_owner(rr)); if (!buffer_available(buffer, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(rdlength))) { goto buffer_tc; } buffer_write_u16(buffer, (uint16_t) ldns_rr_get_type(rr)); buffer_write_u16(buffer, (uint16_t) ldns_rr_get_class(rr)); buffer_write_u32(buffer, (uint32_t) ldns_rr_ttl(rr)); /* skip rdlength */ rdlength_pos = buffer_position(buffer); buffer_skip(buffer, sizeof(rdlength)); /* write rdata */ for (i=0; i < ldns_rr_rd_count(rr); i++) { if (!buffer_available(buffer, ldns_rdf_size(ldns_rr_rdf(rr, i)))) { goto buffer_tc; } buffer_write_rdf(buffer, ldns_rr_rdf(rr, i)); } /* write rdlength */ rdlength = buffer_position(buffer) - rdlength_pos - sizeof(rdlength); buffer_write_u16_at(buffer, rdlength_pos, rdlength); /* position updated by buffer_write() */ return 1; buffer_tc: buffer_set_position(buffer, tc_mark); return 0; } /** * Read uint8_t from buffer at indicated position. * */ static uint8_t buffer_read_u8_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); ods_log_assert(at < buffer->capacity); return buffer->data[at]; } /** * Read uint16_t from buffer at indicated position. * */ static uint16_t buffer_read_u16_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); return read_uint16(buffer->data + at); } /** * Read uint32_t from buffer at indicated position. * */ static uint32_t buffer_read_u32_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); return read_uint32(buffer->data + at); } /** * Read from buffer. * */ void buffer_read(buffer_type* buffer, void* data, size_t count) { ods_log_assert(buffer); ods_log_assert(buffer_available(buffer, count)); memcpy(data, buffer->data + buffer->position, count); buffer->position += count; return; } /** * Read uint8_t from buffer. * */ uint8_t buffer_read_u8(buffer_type* buffer) { uint16_t result = 0; ods_log_assert(buffer); result = buffer_read_u8_at(buffer, buffer->position); buffer->position += sizeof(uint8_t); return result; } /** * Read uint16_t from buffer. * */ uint16_t buffer_read_u16(buffer_type* buffer) { uint16_t result = 0; ods_log_assert(buffer); result = buffer_read_u16_at(buffer, buffer->position); buffer->position += sizeof(uint16_t); return result; } /** * Read uint32_t from buffer. * */ uint32_t buffer_read_u32(buffer_type* buffer) { uint32_t result = 0; ods_log_assert(buffer); result = buffer_read_u32_at(buffer, buffer->position); buffer->position += sizeof(uint32_t); return result; } /** * Get query id from buffer. * */ uint16_t buffer_pkt_id(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 0); } /** * Get a random query id. * */ static uint16_t random_id(void) { return ldns_get_random(); } /** * Set random query id in buffer. * */ void buffer_pkt_set_random_id(buffer_type* buffer) { uint16_t qid = 0; ods_log_assert(buffer); qid = random_id(); buffer_write_u16_at(buffer, 0, qid); return; } /** * Get flags from buffer. * */ uint16_t buffer_pkt_flags(buffer_type* buffer) { ods_log_assert(buffer); return (uint16_t) buffer_read_u16_at(buffer, 2); } /** * Set flags in buffer. * */ void buffer_pkt_set_flags(buffer_type* buffer, uint16_t flags) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 2, flags); return; } /** * Get QR bit from buffer. * */ int buffer_pkt_qr(buffer_type* buffer) { ods_log_assert(buffer); return (int) QR(buffer); } /** * Set QR bit in buffer. * */ void buffer_pkt_set_qr(buffer_type* buffer) { ods_log_assert(buffer); QR_SET(buffer); return; } /** * Clear QR bit in buffer. * */ void buffer_pkt_clear_qr(buffer_type* buffer) { ods_log_assert(buffer); QR_CLR(buffer); return; } /** * Get OPCODE from buffer. * */ ldns_pkt_opcode buffer_pkt_opcode(buffer_type* buffer) { ods_log_assert(buffer); return (ldns_pkt_opcode) OPCODE(buffer); } /** * Set OPCODE in buffer. * */ void buffer_pkt_set_opcode(buffer_type* buffer, ldns_pkt_opcode opcode) { ods_log_assert(buffer); OPCODE_SET(buffer, opcode); return; } /** * Get AA bit from buffer. * */ int buffer_pkt_aa(buffer_type* buffer) { ods_log_assert(buffer); return (int) AA(buffer); } /** * Set AA bit in buffer. * */ void buffer_pkt_set_aa(buffer_type* buffer) { ods_log_assert(buffer); AA_SET(buffer); return; } /** * Get TC bit from buffer. * */ int buffer_pkt_tc(buffer_type* buffer) { ods_log_assert(buffer); return (int) TC(buffer); } /** * Get RD bit from buffer. * */ int buffer_pkt_rd(buffer_type* buffer) { ods_log_assert(buffer); return (int) RD(buffer); } /** * Get RA bit from buffer. * */ int buffer_pkt_ra(buffer_type* buffer) { ods_log_assert(buffer); return (int) RA(buffer); } /** * Get AD bit from buffer. * */ int buffer_pkt_ad(buffer_type* buffer) { ods_log_assert(buffer); return (int) AD(buffer); } /** * Get CD bit from buffer. * */ int buffer_pkt_cd(buffer_type* buffer) { ods_log_assert(buffer); return (int) CD(buffer); } /** * Get RCODE from buffer. * */ ldns_pkt_rcode buffer_pkt_rcode(buffer_type* buffer) { ods_log_assert(buffer); return (ldns_pkt_rcode) RCODE(buffer); } /** * Set RCODE in buffer. * */ void buffer_pkt_set_rcode(buffer_type* buffer, ldns_pkt_rcode rcode) { ods_log_assert(buffer); RCODE_SET(buffer, rcode); return; } /** * Look up a descriptive text by each rcode. * */ const char* buffer_rcode2str(ldns_pkt_rcode rcode) { ods_lookup_table *lt; lt = ods_lookup_by_id(ods_rcode_str, rcode); if (lt) { return lt->name; } return NULL; } /** * Get QDCOUNT from buffer. * */ uint16_t buffer_pkt_qdcount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 4); } /** * Set QDCOUNT in buffer. * */ void buffer_pkt_set_qdcount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 4, count); return; } /** * Get ANCOUNT from buffer. * */ uint16_t buffer_pkt_ancount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 6); } /** * Set ANCOUNT in buffer. * */ void buffer_pkt_set_ancount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 6, count); return; } /** * Get NSCOUNT from buffer. * */ uint16_t buffer_pkt_nscount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 8); } /** * Set NSCOUNT in buffer. * */ void buffer_pkt_set_nscount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 8, count); return; } /** * Get ARCOUNT from buffer. * */ uint16_t buffer_pkt_arcount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 10); } /** * Set ARCOUNT in buffer. * */ void buffer_pkt_set_arcount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 10, count); return; } /** * Make a new packet. * */ static void buffer_pkt_new(buffer_type* buffer, ldns_rdf* qname, ldns_rr_type qtype, ldns_rr_class qclass, ldns_pkt_opcode opcode) { ods_log_assert(buffer); ods_log_assert(qname); ods_log_assert(qtype); ods_log_assert(qclass); /* The header */ buffer_clear(buffer); buffer_pkt_set_random_id(buffer); buffer_pkt_set_opcode(buffer, opcode); buffer_pkt_clear_qr(buffer); buffer_pkt_set_rcode(buffer, LDNS_RCODE_NOERROR); buffer_pkt_set_qdcount(buffer, 1); buffer_pkt_set_ancount(buffer, 0); buffer_pkt_set_nscount(buffer, 0); buffer_pkt_set_arcount(buffer, 0); buffer_skip(buffer, BUFFER_PKT_HEADER_SIZE); /* The question record */ buffer_write_rdf(buffer, qname); buffer_write_u16(buffer, qtype); buffer_write_u16(buffer, qclass); return; } /** * Make a new query. * */ void buffer_pkt_query(buffer_type* buffer, ldns_rdf* qname, ldns_rr_type qtype, ldns_rr_class qclass) { buffer_pkt_new(buffer, qname, qtype, qclass, LDNS_PACKET_QUERY); buffer_pkt_set_flags(buffer, 0); return; } /** * Make a new notify. * */ void buffer_pkt_notify(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass) { buffer_pkt_new(buffer, qname, LDNS_RR_TYPE_SOA, qclass, LDNS_PACKET_NOTIFY); return; } /** * Make a new axfr. * */ void buffer_pkt_axfr(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass) { buffer_pkt_new(buffer, qname, LDNS_RR_TYPE_AXFR, qclass, LDNS_PACKET_QUERY); buffer_pkt_set_qr(buffer); return; } /** * Print packet buffer. * */ void buffer_pkt_print(FILE* fd, buffer_type* buffer) { ldns_status status = LDNS_STATUS_OK; ldns_pkt* pkt = NULL; ods_log_assert(fd); ods_log_assert(buffer); status = ldns_wire2pkt(&pkt, buffer_begin(buffer), buffer_remaining(buffer)); if (status == LDNS_STATUS_OK) { ods_log_assert(pkt); ldns_pkt_print(fd, pkt); ldns_pkt_free(pkt); } else { fprintf(fd, ";;\n"); fprintf(fd, ";; Bogus packet: %s\n", ldns_get_errorstr_by_id(status)); fprintf(fd, ";;\n"); fprintf(fd, ";;\n"); fprintf(fd, "\n"); } return; } /** * Clean up buffer. * */ void buffer_cleanup(buffer_type* buffer, allocator_type* allocator) { if (!buffer || !allocator) { return; } free((void*)buffer->data); allocator_deallocate(allocator, (void*) buffer); return; } opendnssec-1.4.3/signer/src/wire/acl.c0000664000175000017500000003274512061343046014544 00000000000000/* * $Id: acl.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Access Control List. * */ #include "config.h" #include "shared/log.h" #include "shared/file.h" #include "shared/status.h" #include "wire/acl.h" static const char* acl_str = "acl"; /** * Returns range type. * mask is the 2nd part of the range. * */ static acl_range_type acl_parse_range_type(char* ip, char** mask) { char *p; if((p=strchr(ip, '&'))!=0) { *p = 0; *mask = p+1; return ACL_RANGE_MASK; } if((p=strchr(ip, '/'))!=0) { *p = 0; *mask = p+1; return ACL_RANGE_SUBNET; } if((p=strchr(ip, '-'))!=0) { *p = 0; *mask = p+1; return ACL_RANGE_MINMAX; } *mask = 0; return ACL_RANGE_SINGLE; } /** * Parses subnet mask, fills 0 mask as well * */ static ods_status acl_parse_range_subnet(char* p, void* addr, int maxbits) { int subnet_bits = atoi(p); uint8_t* addr_bytes = (uint8_t*)addr; if (subnet_bits == 0 && strcmp(p, "0")!=0) { return ODS_STATUS_ACL_SUBNET_BAD_RANGE; } if (subnet_bits < 0 || subnet_bits > maxbits) { return ODS_STATUS_ACL_SUBNET_OUT_RANGE; } /* fill addr with n bits of 1s (struct has been zeroed) */ while(subnet_bits >= 8) { *addr_bytes++ = 0xff; subnet_bits -= 8; } if(subnet_bits > 0) { uint8_t shifts[] = {0x0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; *addr_bytes = shifts[subnet_bits]; } return ODS_STATUS_OK; } /** * Parse family from address. * */ int acl_parse_family(const char* a) { /* see if addr is ipv6 or ipv4 -- by : and . */ while (*a) { if (*a == '.') { return AF_INET; } if (*a == ':') { return AF_INET6; } ++a; } /* default to v4 */ return AF_INET; } /** * Create ACL. * */ acl_type* acl_create(allocator_type* allocator, char* address, char* port, char* tsig_name, tsig_type* tsig) { ods_status status = ODS_STATUS_OK; acl_type* acl = NULL; char* p = NULL; if (!allocator) { return NULL; } acl = (acl_type*) allocator_alloc(allocator, sizeof(acl_type)); if (!acl) { ods_log_error("[%s] unable to create acl: allocator_alloc() " "failed", acl_str); return NULL; } acl->address = NULL; acl->next = NULL; acl->tsig = NULL; if (tsig_name) { acl->tsig = tsig_lookup_by_name(tsig, tsig_name); if (!acl->tsig) { ods_log_error("[%s] unable to create acl: tsig %s not found", acl_str, tsig_name); acl_cleanup(acl, allocator); return NULL; } } acl->port = 0; if (port) { acl->port = atoi((const char*) port); } memset(&acl->addr, 0, sizeof(union acl_addr_storage)); memset(&acl->range_mask, 0, sizeof(union acl_addr_storage)); if (address) { acl->family = acl_parse_family(address); acl->range_type = acl_parse_range_type(address, &p); acl->address = allocator_strdup(allocator, address); if (!acl->address) { ods_log_error("[%s] unable to create acl: allocator_strdup() " "failed", acl_str); acl_cleanup(acl, allocator); return NULL; } if (acl->family == AF_INET6) { if (inet_pton(AF_INET6, acl->address, &acl->addr.addr6) != 1) { ods_log_error("[%s] unable to create acl: bad ipv6 address " "(%s)", acl_str, acl->address); acl_cleanup(acl, allocator); return NULL; } if (acl->range_type == ACL_RANGE_MASK || acl->range_type == ACL_RANGE_MINMAX) { if (inet_pton(AF_INET6, p, &acl->range_mask.addr6) != 1) { ods_log_error("[%s] unable to create acl: bad ipv6 address" " mask (%s)", acl_str, p); acl_cleanup(acl, allocator); return NULL; } } else if (acl->range_type == ACL_RANGE_SUBNET) { status = acl_parse_range_subnet(p, &acl->range_mask.addr6, 128); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to create acl: %s (%s)", acl_str, ods_status2str(status), p); acl_cleanup(acl, allocator); return NULL; } } } else if (acl->family == AF_INET) { if (inet_pton(AF_INET, acl->address, &acl->addr.addr) != 1) { ods_log_error("[%s] unable to create acl: bad ipv4 address " "(%s)", acl_str, acl->address); acl_cleanup(acl, allocator); return NULL; } if (acl->range_type == ACL_RANGE_MASK || acl->range_type == ACL_RANGE_MINMAX) { if (inet_pton(AF_INET, p, &acl->range_mask.addr) != 1) { ods_log_error("[%s] unable to create acl: bad ipv4 address" " mask (%s)", acl_str, p); acl_cleanup(acl, allocator); return NULL; } } else if (acl->range_type == ACL_RANGE_SUBNET) { status = acl_parse_range_subnet(p, &acl->range_mask.addr, 32); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to create acl: %s (%s)", acl_str, ods_status2str(status), p); acl_cleanup(acl, allocator); return NULL; } } } } acl->ixfr_disabled = 0; return acl; } /** * ACL matches address mask. * */ static int acl_addr_matches_mask(uint32_t* a, uint32_t* b, uint32_t* mask, size_t sz) { size_t i = 0; ods_log_assert(sz % 4 == 0); sz /= 4; for (i=0; i x[i]) { return 0; } if (checkmax && maxval[i] < x[i]) { return 0; } /* if x is equal to a bound, that bound needs further checks */ if (checkmin && minval[i] != x[i]) { checkmin = 0; } if (checkmax && maxval[i]!=x[i]) { checkmax = 0; } if (!checkmin && !checkmax) { return 1; /* will always match */ } } return 1; } /** * ACL matches address. * */ static int acl_addr_matches(acl_type* acl, struct sockaddr_storage* addr) { if (!acl) { return 0; } if (!acl->address) { /* all addresses match */ return 1; } if (acl->family == AF_INET6) { struct sockaddr_in6* addr6 = (struct sockaddr_in6*) addr; if (addr->ss_family != AF_INET6) { return 0; } if (acl->port != 0 && acl->port != ntohs(addr6->sin6_port)) { return 0; } switch(acl->range_type) { case ACL_RANGE_MASK: case ACL_RANGE_SUBNET: if (!acl_addr_matches_mask((uint32_t*)&acl->addr.addr6, (uint32_t*)&addr6->sin6_addr, (uint32_t*)&acl->range_mask.addr6, sizeof(struct in6_addr))) { return 0; } break; case ACL_RANGE_MINMAX: if (!acl_addr_matches_range((uint32_t*)&acl->addr.addr6, (uint32_t*)&addr6->sin6_addr, (uint32_t*)&acl->range_mask.addr6, sizeof(struct in6_addr))) { return 0; } break; case ACL_RANGE_SINGLE: default: if (memcmp(&addr6->sin6_addr, &acl->addr.addr6, sizeof(struct in6_addr)) != 0) { return 0; } break; } return 1; } else { struct sockaddr_in* addr4 = (struct sockaddr_in*)addr; if (addr4->sin_family != AF_INET) { return 0; } if (acl->port != 0 && acl->port != ntohs(addr4->sin_port)) { return 0; } switch (acl->range_type) { case ACL_RANGE_MASK: case ACL_RANGE_SUBNET: if (!acl_addr_matches_mask((uint32_t*)&acl->addr.addr, (uint32_t*)&addr4->sin_addr, (uint32_t*)&acl->range_mask.addr, sizeof(struct in_addr))) { return 0; } break; case ACL_RANGE_MINMAX: if (!acl_addr_matches_range((uint32_t*)&acl->addr.addr, (uint32_t*)&addr4->sin_addr, (uint32_t*)&acl->range_mask.addr, sizeof(struct in_addr))) { return 0; } break; case ACL_RANGE_SINGLE: default: if (memcmp(&addr4->sin_addr, &acl->addr.addr, sizeof(struct in_addr)) != 0) { return 0; } break; } return 1; } /* not reached */ return 0; } /** * ACL matches TSIG. * */ static int acl_tsig_matches(acl_type* acl, tsig_rr_type* tsig) { if (!acl || !tsig) { ods_log_debug("[%s] no match: no acl or tsig", acl_str); return 0; /* missing required elements */ } if (!acl->tsig) { if (tsig->status == TSIG_NOT_PRESENT) { return 1; } ods_log_debug("[%s] no match: tsig present but no config", acl_str); return 0; /* TSIG present but no config */ } if (tsig->status != TSIG_OK) { ods_log_debug("[%s] no match: tsig %s", acl_str, tsig_status2str(tsig->status)); return 0; /* query has no TSIG */ } if (tsig->error_code != LDNS_RCODE_NOERROR) { ods_log_debug("[%s] no match: tsig error %d", acl_str, tsig->error_code); return 0; /* query has bork TSIG */ } if (!tsig->key_name || !tsig->algo) { ods_log_debug("[%s] no match: missing key/algo", acl_str); return 0; } if (!acl->tsig->key) { ods_log_debug("[%s] no match: no config", acl_str); return 0; /* missing TSIG config */ } if (ldns_dname_compare(tsig->key_name, acl->tsig->key->dname) != 0) { ods_log_debug("[%s] no match: key names not the same", acl_str); return 0; /* wrong key name */ } if (ods_strlowercmp(tsig->algo->txt_name, acl->tsig->algorithm) != 0) { ods_log_debug("[%s] no match: algorithms not the same", acl_str); return 0; /* wrong algorithm name */ } /* tsig matches */ return 1; } /** * Address storage to IP string. * */ int addr2ip(struct sockaddr_storage addr, char* ip, size_t len) { if (addr.ss_family == AF_INET6) { if (!inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr, ip, len)) { return 0; } } else { if (!inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, ip, len)) return 0; } return 1; } /** * Find ACL. * */ acl_type* acl_find(acl_type* acl, struct sockaddr_storage* addr, tsig_rr_type* trr) { acl_type* find = acl; while (find) { if (acl_addr_matches(find, addr) && acl_tsig_matches(find, trr)) { ods_log_debug("[%s] match %s", acl_str, find->address); return find; } find = find->next; } return NULL; } /** * Clean up ACL. * */ void acl_cleanup(acl_type* acl, allocator_type* allocator) { if (!acl || !allocator) { return; } acl_cleanup(acl->next, allocator); allocator_deallocate(allocator, (void*) acl->address); allocator_deallocate(allocator, (void*) acl); return; } opendnssec-1.4.3/signer/src/wire/tsig-openssl.h0000664000175000017500000000364111665406617016447 00000000000000/* * $Id: tsig-openssl.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Interface to OpenSSL for TSIG support. * */ #ifndef WIRE_TSIG_OPENSSL_H #define WIRE_TSIG_OPENSSL_H #ifdef HAVE_SSL #include "shared/allocator.h" #include "shared/status.h" #include #include /** * Initialize OpenSSL support for TSIG. * \param[in] allocator memory allocator * \return ods_status status * */ ods_status tsig_handler_openssl_init(allocator_type* allocator); /** * Finalize OpenSSL support for TSIG. * */ void tsig_handler_openssl_finalize(void); #endif /* HAVE_SSL */ #endif /* WIRE_TSIG_OPENSSL_H */ opendnssec-1.4.3/signer/src/wire/query.c0000664000175000017500000007432512226742760015163 00000000000000/* * $Id: query.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Query. * */ #include "config.h" #include "daemon/dnshandler.h" #include "daemon/engine.h" #include "shared/file.h" #include "shared/util.h" #include "wire/axfr.h" #include "wire/query.h" const char* query_str = "query"; /** * Create query. * */ query_type* query_create(void) { allocator_type* allocator = NULL; query_type* q = NULL; allocator = allocator_create(malloc, free); if (!allocator) { return NULL; } q = (query_type*) allocator_alloc(allocator, sizeof(query_type)); if (!q) { allocator_cleanup(allocator); return NULL; } q->allocator = allocator; q->buffer = NULL; q->tsig_rr = NULL; q->axfr_fd = NULL; q->buffer = buffer_create(allocator, PACKET_BUFFER_SIZE); if (!q->buffer) { query_cleanup(q); return NULL; } q->tsig_rr = tsig_rr_create(allocator); if (!q->tsig_rr) { query_cleanup(q); return NULL; } q->edns_rr = edns_rr_create(allocator); if (!q->edns_rr) { query_cleanup(q); return NULL; } query_reset(q, UDP_MAX_MESSAGE_LEN, 0); return q; } /** * Reset query. * */ void query_reset(query_type* q, size_t maxlen, int is_tcp) { if (!q) { return; } q->addrlen = sizeof(q->addr); q->maxlen = maxlen; q->reserved_space = 0; buffer_clear(q->buffer); tsig_rr_reset(q->tsig_rr, NULL, NULL); edns_rr_reset(q->edns_rr); q->tsig_prepare_it = 1; q->tsig_update_it = 1; q->tsig_sign_it = 1; q->tcp = is_tcp; /* qname, qtype, qclass */ q->zone = NULL; /* domain, opcode, cname count, delegation, compression, temp */ q->axfr_is_done = 0; if (q->axfr_fd) { ods_fclose(q->axfr_fd); q->axfr_fd = NULL; } q->serial = 0; q->startpos = 0; return; } /** * Error. * */ static query_state query_error(query_type* q, ldns_pkt_rcode rcode) { size_t limit = 0; if (!q) { return QUERY_DISCARDED; } limit = buffer_limit(q->buffer); buffer_clear(q->buffer); buffer_pkt_set_qr(q->buffer); buffer_pkt_set_rcode(q->buffer, rcode); buffer_pkt_set_ancount(q->buffer, 0); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); buffer_set_position(q->buffer, limit); return QUERY_PROCESSED; } /** * FORMERR. * */ static query_state query_formerr(query_type* q) { ldns_pkt_opcode opcode = LDNS_PACKET_QUERY; if (!q) { return QUERY_DISCARDED; } opcode = buffer_pkt_opcode(q->buffer); /* preserve the RD flag, clear the rest */ buffer_pkt_set_flags(q->buffer, buffer_pkt_flags(q->buffer) & 0x0100U); buffer_pkt_set_opcode(q->buffer, opcode); buffer_pkt_set_qdcount(q->buffer, 0); ods_log_debug("[%s] formerr", query_str); return query_error(q, LDNS_RCODE_FORMERR); } /** * SERVFAIL. * */ static query_state query_servfail(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] servfail", query_str); buffer_set_position(q->buffer, 0); buffer_set_limit(q->buffer, BUFFER_PKT_HEADER_SIZE); buffer_pkt_set_qdcount(q->buffer, 0); return query_error(q, LDNS_RCODE_SERVFAIL); } /** * NOTIMPL. * */ static query_state query_notimpl(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] notimpl", query_str); return query_error(q, LDNS_RCODE_NOTIMPL); } /** * REFUSED. * */ static query_state query_refused(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] refused", query_str); return query_error(q, LDNS_RCODE_REFUSED); } /** * NOTAUTH. * */ static query_state query_notauth(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] notauth", query_str); return query_error(q, LDNS_RCODE_NOTAUTH); } /** * Parse SOA RR in packet. * (kind of similar to xfrd_parse_soa) * */ static int query_parse_soa(buffer_type* buffer, uint32_t* serial) { ldns_rr_type type = 0; ods_log_assert(buffer); if (!buffer_available(buffer, 10)) { ods_log_error("[%s] bad soa: packet too short", query_str); return 0; } type = (ldns_rr_type) buffer_read_u16(buffer); if (type != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad soa: rr is not soa (%d)", query_str, type); return 0; } (void)buffer_read_u16(buffer); (void)buffer_read_u32(buffer); /* rdata length */ if (!buffer_available(buffer, buffer_read_u16(buffer))) { ods_log_error("[%s] bad soa: missing rdlength", query_str); return 0; } /* MNAME */ if (!buffer_skip_dname(buffer)) { ods_log_error("[%s] bad soa: missing mname", query_str); return 0; } /* RNAME */ if (!buffer_skip_dname(buffer)) { ods_log_error("[%s] bad soa: missing rname", query_str); return 0; } if (serial) { *serial = buffer_read_u32(buffer); } return 1; } /** * NOTIFY. * */ static query_state query_process_notify(query_type* q, ldns_rr_type qtype, void* engine) { engine_type* e = (engine_type*) engine; dnsin_type* dnsin = NULL; uint16_t count = 0; uint16_t rrcount = 0; uint32_t serial = 0; size_t pos = 0; char address[128]; if (!e || !q || !q->zone) { return QUERY_DISCARDED; } ods_log_assert(e->dnshandler); ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming notify for zone %s", query_str, q->zone->name); if (buffer_pkt_rcode(q->buffer) != LDNS_RCODE_NOERROR || buffer_pkt_qr(q->buffer) || !buffer_pkt_aa(q->buffer) || buffer_pkt_tc(q->buffer) || buffer_pkt_rd(q->buffer) || buffer_pkt_ra(q->buffer) || buffer_pkt_ad(q->buffer) || buffer_pkt_cd(q->buffer) || buffer_pkt_qdcount(q->buffer) != 1 || buffer_pkt_ancount(q->buffer) > 1 || qtype != LDNS_RR_TYPE_SOA) { return query_formerr(q); } if (!q->zone->adinbound || q->zone->adinbound->type != ADAPTER_DNS) { ods_log_error("[%s] zone %s is not configured to have input dns " "adapter", query_str, q->zone->name); return query_notauth(q); } ods_log_assert(q->zone->adinbound->config); dnsin = (dnsin_type*) q->zone->adinbound->config; if (!acl_find(dnsin->allow_notify, &q->addr, q->tsig_rr)) { if (addr2ip(q->addr, address, sizeof(address))) { ods_log_info("[%s] unauthorized notify for zone %s from client %s: " "no acl matches", query_str, q->zone->name, address); } else { ods_log_info("[%s] unauthorized notify for zone %s from unknown " "client: no acl matches", query_str, q->zone->name); } return query_notauth(q); } ods_log_assert(q->zone->xfrd); /* skip header and question section */ buffer_skip(q->buffer, BUFFER_PKT_HEADER_SIZE); count = buffer_pkt_qdcount(q->buffer); for (rrcount = 0; rrcount < count; rrcount++) { if (!buffer_skip_rr(q->buffer, 1)) { ods_log_error("[%s] dropped packet: zone %s received bad notify " "(bad question section)", query_str, q->zone->name); return QUERY_DISCARDED; } } pos = buffer_position(q->buffer); /* examine answer section */ count = buffer_pkt_ancount(q->buffer); if (count) { if (!buffer_skip_dname(q->buffer) || !query_parse_soa(q->buffer, &serial)) { ods_log_error("[%s] dropped packet: zone %s received bad notify " "(bad soa in answer section)", query_str, q->zone->name); return QUERY_DISCARDED; } lock_basic_lock(&q->zone->xfrd->serial_lock); q->zone->xfrd->serial_notify = serial; q->zone->xfrd->serial_notify_acquired = time_now(); if (!util_serial_gt(q->zone->xfrd->serial_notify, q->zone->xfrd->serial_disk)) { ods_log_debug("[%s] ignore notify: already got zone %s serial " "%u on disk", query_str, q->zone->name, q->zone->xfrd->serial_notify); lock_basic_unlock(&q->zone->xfrd->serial_lock); goto send_notify_ok; } lock_basic_unlock(&q->zone->xfrd->serial_lock); } else { lock_basic_lock(&q->zone->xfrd->serial_lock); q->zone->xfrd->serial_notify = 0; q->zone->xfrd->serial_notify_acquired = 0; lock_basic_unlock(&q->zone->xfrd->serial_lock); } /* forward notify to xfrd */ xfrd_set_timer_now(q->zone->xfrd); dnshandler_fwd_notify(e->dnshandler, buffer_begin(q->buffer), buffer_remaining(q->buffer)); send_notify_ok: /* send notify ok */ buffer_pkt_set_qr(q->buffer); buffer_pkt_set_aa(q->buffer); buffer_pkt_set_ancount(q->buffer, 0); buffer_clear(q->buffer); /* lim = pos, pos = 0; */ buffer_set_position(q->buffer, pos); buffer_set_limit(q->buffer, buffer_capacity(q->buffer)); q->reserved_space = edns_rr_reserved_space(q->edns_rr); q->reserved_space += tsig_rr_reserved_space(q->tsig_rr); return QUERY_PROCESSED; } /** * IXFR. * */ static query_state query_process_ixfr(query_type* q) { uint16_t count = 0; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(buffer_pkt_qdcount(q->buffer) == 1); /* skip header and question section */ buffer_skip(q->buffer, BUFFER_PKT_HEADER_SIZE); if (!buffer_skip_rr(q->buffer, 1)) { ods_log_error("[%s] dropped packet: zone %s received bad ixfr " "request (bad question section)", query_str, q->zone->name); return QUERY_DISCARDED; } /* answer section is empty */ ods_log_assert(buffer_pkt_ancount(q->buffer) == 0); /* examine auth section */ q->startpos = buffer_position(q->buffer); count = buffer_pkt_nscount(q->buffer); if (count) { if (!buffer_skip_dname(q->buffer) || !query_parse_soa(q->buffer, &(q->serial))) { ods_log_error("[%s] dropped packet: zone %s received bad ixfr " "request (bad soa in auth section)", query_str, q->zone->name); return QUERY_DISCARDED; } ods_log_debug("[%s] found ixfr request zone %s serial=%u", query_str, q->zone->name, q->serial); return QUERY_PROCESSED; } ods_log_debug("[%s] ixfr request zone %s has no auth section", query_str, q->zone->name); q->serial = 0; return QUERY_PROCESSED; } /** * Add RRset to response. * */ static int response_add_rrset(response_type* r, rrset_type* rrset, ldns_pkt_section section) { if (!r || !rrset || !section) { return 0; } /* duplicates? */ r->sections[r->rrset_count] = section; r->rrsets[r->rrset_count] = rrset; ++r->rrset_count; return 1; } /** * Encode RR. * */ static int response_encode_rr(query_type* q, ldns_rr* rr, ldns_pkt_section section) { uint8_t *data = NULL; size_t size = 0; ldns_status status = LDNS_STATUS_OK; ods_log_assert(q); ods_log_assert(rr); ods_log_assert(section); status = ldns_rr2wire(&data, rr, section, &size); if (status != LDNS_STATUS_OK) { ods_log_error("[%s] unable to send good response: ldns_rr2wire() " "failed (%s)", query_str, ldns_get_errorstr_by_id(status)); return 0; } buffer_write(q->buffer, (const void*) data, size); LDNS_FREE(data); return 1; } /** * Encode RRset. * */ static uint16_t response_encode_rrset(query_type* q, rrset_type* rrset, ldns_pkt_section section) { uint16_t i = 0; uint16_t added = 0; ods_log_assert(q); ods_log_assert(rrset); ods_log_assert(section); for (i = 0; i < rrset->rr_count; i++) { added += response_encode_rr(q, rrset->rrs[i].rr, section); } if (q->edns_rr && q->edns_rr->dnssec_ok) { for (i = 0; i < rrset->rrsig_count; i++) { added += response_encode_rr(q, rrset->rrsigs[i].rr, section); } } /* truncation? */ return added; } /** * Encode response. * */ static void response_encode(query_type* q, response_type* r) { uint16_t counts[LDNS_SECTION_ANY]; ldns_pkt_section s = LDNS_SECTION_QUESTION; size_t i = 0; ods_log_assert(q); ods_log_assert(r); for (s = LDNS_SECTION_ANSWER; s < LDNS_SECTION_ANY; s++) { counts[s] = 0; } for (s = LDNS_SECTION_ANSWER; s < LDNS_SECTION_ANY; s++) { for (i = 0; i < r->rrset_count; i++) { if (r->sections[i] == s) { counts[s] += response_encode_rrset(q, r->rrsets[i], s); } } } buffer_pkt_set_ancount(q->buffer, counts[LDNS_SECTION_ANSWER]); buffer_pkt_set_nscount(q->buffer, counts[LDNS_SECTION_AUTHORITY]); buffer_pkt_set_arcount(q->buffer, counts[LDNS_SECTION_ADDITIONAL]); buffer_pkt_set_qr(q->buffer); buffer_pkt_set_aa(q->buffer); return; } /** * Query response. * */ static query_state query_response(query_type* q, ldns_rr_type qtype) { rrset_type* rrset = NULL; response_type r; if (!q || !q->zone) { return QUERY_DISCARDED; } r.rrset_count = 0; lock_basic_lock(&q->zone->zone_lock); rrset = zone_lookup_rrset(q->zone, q->zone->apex, qtype); if (rrset) { if (!response_add_rrset(&r, rrset, LDNS_SECTION_ANSWER)) { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } /* NS RRset goes into Authority Section */ rrset = zone_lookup_rrset(q->zone, q->zone->apex, LDNS_RR_TYPE_NS); if (rrset) { if (!response_add_rrset(&r, rrset, LDNS_SECTION_AUTHORITY)) { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } } } else if (qtype != LDNS_RR_TYPE_SOA) { rrset = zone_lookup_rrset(q->zone, q->zone->apex, LDNS_RR_TYPE_SOA); if (rrset) { if (!response_add_rrset(&r, rrset, LDNS_SECTION_AUTHORITY)) { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } } } else { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } lock_basic_unlock(&q->zone->zone_lock); response_encode(q, &r); /* compression */ return QUERY_PROCESSED; } /** * Prepare response. * */ void query_prepare(query_type* q) { uint16_t limit = 0; uint16_t flags = 0; ods_log_assert(q); ods_log_assert(q->buffer); limit = buffer_limit(q->buffer); flags = buffer_pkt_flags(q->buffer); flags &= 0x0100U; /* preserve the rd flag */ flags |= 0x8000U; /* set the qr flag */ buffer_pkt_set_flags(q->buffer, flags); buffer_clear(q->buffer); buffer_set_position(q->buffer, limit); buffer_set_limit(q->buffer, buffer_capacity(q->buffer)); q->reserved_space = edns_rr_reserved_space(q->edns_rr); q->reserved_space += tsig_rr_reserved_space(q->tsig_rr); return; } /** * QUERY. * */ static query_state query_process_query(query_type* q, ldns_rr_type qtype, engine_type* engine) { dnsout_type* dnsout = NULL; if (!q || !q->zone) { return QUERY_DISCARDED; } ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming query qtype=%s for zone %s", query_str, rrset_type2str(qtype), q->zone->name); /* sanity checks */ if (buffer_pkt_qdcount(q->buffer) != 1 || buffer_pkt_tc(q->buffer)) { buffer_pkt_set_flags(q->buffer, 0); return query_formerr(q); } if (buffer_pkt_ancount(q->buffer) != 0 || (qtype != LDNS_RR_TYPE_IXFR && buffer_pkt_nscount(q->buffer) != 0)) { buffer_pkt_set_flags(q->buffer, 0); return query_formerr(q); } /* acl */ if (!q->zone->adoutbound || q->zone->adoutbound->type != ADAPTER_DNS) { ods_log_error("[%s] zone %s is not configured to have output dns " "adapter", query_str, q->zone->name); return query_refused(q); } ods_log_assert(q->zone->adoutbound->config); dnsout = (dnsout_type*) q->zone->adoutbound->config; /* acl also in use for soa and other queries */ if (!acl_find(dnsout->provide_xfr, &q->addr, q->tsig_rr)) { ods_log_debug("[%s] zone %s acl query refused", query_str, q->zone->name); return query_refused(q); } /* ixfr? */ if (qtype == LDNS_RR_TYPE_IXFR) { if (query_process_ixfr(q) != QUERY_PROCESSED) { buffer_pkt_set_flags(q->buffer, 0); return query_formerr(q); } query_prepare(q); ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming ixfr request serial=%u for zone %s", query_str, q->serial, q->zone->name); return ixfr(q, engine); } query_prepare(q); /* axfr? */ if (qtype == LDNS_RR_TYPE_AXFR) { ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming axfr request for zone %s", query_str, q->zone->name); return axfr(q, engine, 0); } /* (soa) query */ if (qtype == LDNS_RR_TYPE_SOA) { ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming soa request for zone %s", query_str, q->zone->name); return soa_request(q, engine); } /* other qtypes */ return query_response(q, qtype); } /** * UPDATE. * */ static query_state query_process_update(query_type* q) { if (!q || !q->zone) { return QUERY_DISCARDED; } ods_log_debug("[%s] dynamic update not implemented", query_str); return query_notimpl(q); } /** * Process TSIG RR. * */ static ldns_pkt_rcode query_process_tsig(query_type* q) { if (!q || !q->tsig_rr) { return LDNS_RCODE_SERVFAIL; } if (q->tsig_rr->status == TSIG_ERROR) { return LDNS_RCODE_FORMERR; } if (q->tsig_rr->status == TSIG_OK) { if (!tsig_rr_lookup(q->tsig_rr)) { ods_log_debug("[%s] tsig unknown key/algorithm", query_str); return LDNS_RCODE_REFUSED; } buffer_set_limit(q->buffer, q->tsig_rr->position); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer)-1); tsig_rr_prepare(q->tsig_rr); tsig_rr_update(q->tsig_rr, q->buffer, buffer_limit(q->buffer)); if (!tsig_rr_verify(q->tsig_rr)) { ods_log_debug("[%s] bad tsig signature", query_str); return LDNS_RCODE_NOTAUTH; } } return LDNS_RCODE_NOERROR; } /** * Process EDNS OPT RR. * */ static ldns_pkt_rcode query_process_edns(query_type* q) { if (!q || !q->edns_rr) { return LDNS_RCODE_SERVFAIL; } if (q->edns_rr->status == EDNS_ERROR) { /* The only error is VERSION not implemented */ return LDNS_RCODE_FORMERR; } if (q->edns_rr->status == EDNS_OK) { /* Only care about UDP size larger than normal... */ if (!q->tcp && q->edns_rr->maxlen > UDP_MAX_MESSAGE_LEN) { if (q->edns_rr->maxlen < EDNS_MAX_MESSAGE_LEN) { q->maxlen = q->edns_rr->maxlen; } else { q->maxlen = EDNS_MAX_MESSAGE_LEN; } } /* Strip the OPT resource record off... */ buffer_set_position(q->buffer, q->edns_rr->position); buffer_set_limit(q->buffer, q->edns_rr->position); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer) - 1); } return LDNS_RCODE_NOERROR; } /** * Find TSIG RR. * */ static int query_find_tsig(query_type* q) { size_t saved_pos = 0; size_t rrcount = 0; size_t i = 0; ods_log_assert(q); ods_log_assert(q->tsig_rr); ods_log_assert(q->buffer); if (buffer_pkt_arcount(q->buffer) == 0) { q->tsig_rr->status = TSIG_NOT_PRESENT; return 1; } saved_pos = buffer_position(q->buffer); rrcount = buffer_pkt_qdcount(q->buffer) + buffer_pkt_ancount(q->buffer) + buffer_pkt_nscount(q->buffer); buffer_set_position(q->buffer, BUFFER_PKT_HEADER_SIZE); for (i=0; i < rrcount; i++) { if (!buffer_skip_rr(q->buffer, i < buffer_pkt_qdcount(q->buffer))) { buffer_set_position(q->buffer, saved_pos); return 0; } } rrcount = buffer_pkt_arcount(q->buffer); ods_log_assert(rrcount != 0); if (!tsig_rr_parse(q->tsig_rr, q->buffer)) { ods_log_debug("[%s] got bad tsig", query_str); return 0; } if (q->tsig_rr->status != TSIG_NOT_PRESENT) { --rrcount; } if (rrcount) { if (edns_rr_parse(q->edns_rr, q->buffer)) { --rrcount; } } if (rrcount && q->tsig_rr->status == TSIG_NOT_PRESENT) { /* see if tsig is after the edns record */ if (!tsig_rr_parse(q->tsig_rr, q->buffer)) { ods_log_debug("[%s] got bad tsig", query_str); return 0; } if (q->tsig_rr->status != TSIG_NOT_PRESENT) { --rrcount; } } if (rrcount > 0) { ods_log_debug("[%s] too many additional rrs", query_str); return 0; } buffer_set_position(q->buffer, saved_pos); return 1; } /** * Process query. * */ query_state query_process(query_type* q, void* engine) { ldns_status status = LDNS_STATUS_OK; ldns_pkt* pkt = NULL; ldns_rr* rr = NULL; ldns_pkt_rcode rcode = LDNS_RCODE_NOERROR; ldns_pkt_opcode opcode = LDNS_PACKET_QUERY; ldns_rr_type qtype = LDNS_RR_TYPE_SOA; engine_type* e = (engine_type*) engine; ods_log_assert(e); ods_log_assert(q); ods_log_assert(q->buffer); if (!e || !q || !q->buffer) { ods_log_error("[%s] drop query: assertion error", query_str); return QUERY_DISCARDED; /* should not happen */ } if (buffer_limit(q->buffer) < BUFFER_PKT_HEADER_SIZE) { ods_log_debug("[%s] drop query: packet too small", query_str); return QUERY_DISCARDED; /* too small */ } if (buffer_pkt_qr(q->buffer)) { ods_log_debug("[%s] drop query: qr bit set", query_str); return QUERY_DISCARDED; /* not a query */ } /* parse packet */ status = ldns_wire2pkt(&pkt, buffer_current(q->buffer), buffer_remaining(q->buffer)); if (status != LDNS_STATUS_OK) { ods_log_debug("[%s] got bad packet: %s", query_str, ldns_get_errorstr_by_id(status)); return query_formerr(q); } rr = ldns_rr_list_rr(ldns_pkt_question(pkt), 0); lock_basic_lock(&e->zonelist->zl_lock); /* we can just lookup the zone, because we will only handle SOA queries, zone transfers, updates and notifies */ q->zone = zonelist_lookup_zone_by_dname(e->zonelist, ldns_rr_owner(rr), ldns_rr_get_class(rr)); /* don't answer for zones that are just added */ if (q->zone && q->zone->zl_status == ZONE_ZL_ADDED) { ods_log_warning("[%s] zone %s just added, don't answer for now", query_str, q->zone->name); q->zone = NULL; } lock_basic_unlock(&e->zonelist->zl_lock); if (!q->zone) { ods_log_debug("[%s] zone not found", query_str); return query_servfail(q); } /* see if it is tsig signed */ if (!query_find_tsig(q)) { return query_formerr(q); } /* else: valid tsig, or no tsig present */ ods_log_debug("[%s] tsig %s", query_str, tsig_status2str(q->tsig_rr->status)); rcode = query_process_tsig(q); if (rcode != LDNS_RCODE_NOERROR) { return query_error(q, rcode); } /* process edns */ rcode = query_process_edns(q); if (rcode != LDNS_RCODE_NOERROR) { /* We should not return FORMERR, but BADVERS (=16). * BADVERS is created with Ext. RCODE, followed by RCODE. * Ext. RCODE is set to 1, RCODE must be 0 (getting 0x10 = 16). * Thus RCODE = NOERROR = NSD_RC_OK. */ return query_error(q, LDNS_RCODE_NOERROR); } /* handle incoming request */ opcode = ldns_pkt_get_opcode(pkt); qtype = ldns_rr_get_type(rr); ldns_pkt_free(pkt); switch (opcode) { case LDNS_PACKET_NOTIFY: return query_process_notify(q, qtype, engine); case LDNS_PACKET_QUERY: return query_process_query(q, qtype, engine); case LDNS_PACKET_UPDATE: return query_process_update(q); default: break; } return query_notimpl(q); } /** * Check if query does not overflow. * */ static int query_overflow(query_type* q) { ods_log_assert(q); ods_log_assert(q->buffer); return buffer_position(q->buffer) > (q->maxlen - q->reserved_space); } /** * Add optional RRs to query. * */ void query_add_optional(query_type* q, void* engine) { engine_type* e = (engine_type*) engine; edns_data_type* edns = NULL; if (!q || !e) { return; } /** First EDNS */ if (q->edns_rr) { edns = &e->edns; switch (q->edns_rr->status) { case EDNS_NOT_PRESENT: break; case EDNS_OK: ods_log_debug("[%s] add edns opt ok", query_str); if (q->edns_rr->dnssec_ok) { edns->ok[7] = 0x80; } else { edns->ok[7] = 0x00; } buffer_write(q->buffer, edns->ok, OPT_LEN); /* fill with NULLs */ buffer_write(q->buffer, edns->rdata_none, OPT_RDATA); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer) + 1); break; case EDNS_ERROR: ods_log_debug("[%s] add edns opt err", query_str); if (q->edns_rr->dnssec_ok) { edns->ok[7] = 0x80; } else { edns->ok[7] = 0x00; } buffer_write(q->buffer, edns->error, OPT_LEN); buffer_write(q->buffer, edns->rdata_none, OPT_RDATA); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer) + 1); break; default: break; } } /** Then TSIG */ if (!q->tsig_rr) { return; } if (q->tsig_rr->status != TSIG_NOT_PRESENT) { if (q->tsig_rr->status == TSIG_ERROR || q->tsig_rr->error_code != LDNS_RCODE_NOERROR) { ods_log_debug("[%s] add tsig err", query_str); tsig_rr_error(q->tsig_rr); tsig_rr_append(q->tsig_rr, q->buffer); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer)+1); } else if (q->tsig_rr->status == TSIG_OK && q->tsig_rr->error_code == LDNS_RCODE_NOERROR) { ods_log_debug("[%s] add tsig ok", query_str); if (q->tsig_prepare_it) tsig_rr_prepare(q->tsig_rr); if (q->tsig_update_it) tsig_rr_update(q->tsig_rr, q->buffer, buffer_position(q->buffer)); if (q->tsig_sign_it) { tsig_rr_sign(q->tsig_rr); tsig_rr_append(q->tsig_rr, q->buffer); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer)+1); } } } return; } /** * Add RR to query. * */ int query_add_rr(query_type* q, ldns_rr* rr) { size_t i = 0; size_t tc_mark = 0; size_t rdlength_pos = 0; uint16_t rdlength = 0; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(rr); /* set truncation mark, in case rr does not fit */ tc_mark = buffer_position(q->buffer); /* owner type class ttl */ if (!buffer_available(q->buffer, ldns_rdf_size(ldns_rr_owner(rr)))) { goto query_add_rr_tc; } buffer_write_rdf(q->buffer, ldns_rr_owner(rr)); if (!buffer_available(q->buffer, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(rdlength))) { goto query_add_rr_tc; } buffer_write_u16(q->buffer, (uint16_t) ldns_rr_get_type(rr)); buffer_write_u16(q->buffer, (uint16_t) ldns_rr_get_class(rr)); buffer_write_u32(q->buffer, (uint32_t) ldns_rr_ttl(rr)); /* skip rdlength */ rdlength_pos = buffer_position(q->buffer); buffer_skip(q->buffer, sizeof(rdlength)); /* write rdata */ for (i=0; i < ldns_rr_rd_count(rr); i++) { if (!buffer_available(q->buffer, ldns_rdf_size(ldns_rr_rdf(rr, i)))) { goto query_add_rr_tc; } buffer_write_rdf(q->buffer, ldns_rr_rdf(rr, i)); } if (!query_overflow(q)) { /* write rdlength */ rdlength = buffer_position(q->buffer) - rdlength_pos - sizeof(rdlength); buffer_write_u16_at(q->buffer, rdlength_pos, rdlength); /* position updated by buffer_write() */ return 1; } query_add_rr_tc: buffer_set_position(q->buffer, tc_mark); ods_log_assert(!query_overflow(q)); return 0; } /** * Cleanup query. * */ void query_cleanup(query_type* q) { allocator_type* allocator = NULL; if (!q) { return; } allocator = q->allocator; if (q->axfr_fd) { ods_fclose(q->axfr_fd); q->axfr_fd = NULL; } buffer_cleanup(q->buffer, allocator); tsig_rr_cleanup(q->tsig_rr); allocator_deallocate(allocator, (void*)q); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/wire/listener.h0000664000175000017500000000646211732110662015634 00000000000000/* * $Id: listener.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Listener. * */ #ifndef WIRE_LISTENER_H #define WIRE_LISTENER_H #include "config.h" #include "shared/allocator.h" #include #include #include #include #include #include #include #include #include #include #include #include #define DNS_PORT_STRING "53" #define INBUF_SIZE 4096 /* max size for incoming queries */ #define MAX_INTERFACES 32 /** * Access control. * */ union acl_addr_storage { struct in_addr addr; struct in6_addr addr6; }; /** * Interface. * */ typedef struct interface_struct interface_type; struct interface_struct { char* port; char* address; int family; union acl_addr_storage addr; }; /** * Listener. * */ typedef struct listener_struct listener_type; struct listener_struct { allocator_type* allocator; interface_type* interfaces; size_t count; }; /** * Create listener. * \param[in] allocator memory allocator * \return listener_type* listener * */ listener_type* listener_create(allocator_type* allocator); /** * Push an interface to the listener. * \param[in] listener listener * \param[in] address IP address * \param[in] family address family * \param[in] port port or NULL * \return interface_type* added interface * */ interface_type* listener_push(listener_type* list, char* address, int family, char* port); /** * Print listener. * \param[in] fd file descriptor * \param[in] listener listener to print * */ void listener_print(FILE* fd, listener_type* listener); /** * Log listener. * \param[in] listener listener * */ void listener_log(listener_type* listener); /** * Clean up interface. * \param[in] i interface * */ void interface_cleanup(interface_type* i); /** * Clean up listener. * \param[in] listener listener to clean up * */ void listener_cleanup(listener_type* listener); #endif /* WIRE_LISTENER_H */ opendnssec-1.4.3/signer/src/wire/sock.h0000664000175000017500000000755711665406617014771 00000000000000/* * $Id: sock.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Sockets. * */ #ifndef WIRE_SOCK_H #define WIRE_SOCK_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "wire/listener.h" #include "wire/netio.h" #include "wire/query.h" /** * Socket. * */ typedef struct sock_struct sock_type; struct sock_struct { struct addrinfo* addr; int s; }; /** * List of sockets. * */ typedef struct socklist_struct socklist_type; struct socklist_struct { sock_type tcp[MAX_INTERFACES]; sock_type udp[MAX_INTERFACES]; }; /** * Data for udp handlers. * */ struct udp_data { void* engine; sock_type* socket; query_type* query; }; /** * Data for tcp accept handlers. * */ struct tcp_accept_data { void* engine; sock_type* socket; size_t tcp_accept_handler_count; netio_handler_type* tcp_accept_handlers; }; /** * Data for tcp handlers. * */ struct tcp_data { allocator_type* allocator; void* engine; query_type* query; size_t tcp_accept_handler_count; netio_handler_type* tcp_accept_handlers; query_state qstate; size_t bytes_transmitted; }; /** * Create sockets and listen. * \param[out] sockets sockets * \param[in] listener interfaces * \return ods_status status * */ ods_status sock_listen(socklist_type* sockets, listener_type* listener); /** * Handle incoming udp queries. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_udp(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Handle incoming tcp connections. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_tcp_accept(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Handle incoming tcp queries. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_tcp_read(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Handle outgoing tcp responses. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_tcp_write(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); #endif /* WIRE_SOCK_H */ opendnssec-1.4.3/signer/src/wire/query.h0000664000175000017500000000742711756437622015174 00000000000000/* * $Id: query.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Query. * */ #ifndef WIRE_QUERY_H #define WIRE_QUERY_H #include "config.h" #include "shared/allocator.h" #include "signer/zone.h" #include "wire/buffer.h" #include "wire/edns.h" #include "wire/tsig.h" #define UDP_MAX_MESSAGE_LEN 512 #define TCP_MAX_MESSAGE_LEN 65535 #define QUERY_RESPONSE_MAX_RRSET 10 /* should be enough */ enum query_enum { QUERY_PROCESSED = 0, QUERY_DISCARDED, QUERY_AXFR, QUERY_IXFR }; typedef enum query_enum query_state; /** * Query. * */ typedef struct query_struct query_type; struct query_struct { /* Memory allocator */ allocator_type* allocator; /* Query from addres */ struct sockaddr_storage addr; socklen_t addrlen; /* Maximum supported query size */ size_t maxlen; size_t reserved_space; /* TSIG */ tsig_rr_type* tsig_rr; /* EDNS */ edns_rr_type* edns_rr; /* TCP */ int tcp; uint16_t tcplen; buffer_type* buffer; /* QNAME, QTYPE, QCLASS */ /* Zone */ zone_type* zone; /* Compression */ /* AXFR IXFR */ FILE* axfr_fd; uint32_t serial; size_t startpos; /* Bits */ unsigned axfr_is_done : 1; unsigned tsig_prepare_it : 1; unsigned tsig_update_it : 1; unsigned tsig_sign_it : 1; }; /** * Response. * */ typedef struct response_struct response_type; struct response_struct { size_t rrset_count; ldns_pkt_section sections[QUERY_RESPONSE_MAX_RRSET]; rrset_type* rrsets[QUERY_RESPONSE_MAX_RRSET]; }; /** * Create query. * \return query_type* query * */ query_type* query_create(void); /** * Prepare response. * \param[in] q query * */ void query_prepare(query_type* q); /** * Process query. * \param[in] q query * \param[in] engine signer engine * \return query_state state of the query * */ query_state query_process(query_type* q, void* engine); /** * Reset query. * \param[in] q query * \param[in] maxlen maximum message length * \param[in] is_tcp 1 if tcp query * */ void query_reset(query_type* q, size_t maxlen, int is_tcp); /** * Add optional RRs to query. * \param[in] q query * \param[in] engine signer engine * */ void query_add_optional(query_type* q, void* engine); /** * Add RR to query. * \param[in] q query * \param[in] rr RR * \return int 1 if ok, 0 if overflow. * */ int query_add_rr(query_type* q, ldns_rr* rr); /** * Cleanup query. * \param[in] q query * */ void query_cleanup(query_type* q); #endif /* WIRE_QUERY_H */ opendnssec-1.4.3/signer/src/wire/tsig-openssl.c0000664000175000017500000001360711763120423016430 00000000000000/* * $Id: tsig-openssl.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Interface to OpenSSL for TSIG support. * */ #include "config.h" #ifdef HAVE_SSL #include "shared/log.h" #include "wire/tsig.h" #include "wire/tsig-openssl.h" static const char* tsig_str = "tsig-ssl"; /** allocator */ static allocator_type* tsig_allocator = NULL; /** helper funcgtions */ static void *create_context(allocator_type* allocator); static void init_context(void *context, tsig_algo_type *algorithm, tsig_key_type *key); static void update(void *context, const void *data, size_t size); static void final(void *context, uint8_t *digest, size_t *size); typedef struct tsig_cleanup_table_struct tsig_cleanup_table_type; struct tsig_cleanup_table_struct { tsig_cleanup_table_type* next; void* cleanup; }; static tsig_cleanup_table_type* tsig_cleanup_table = NULL; /** * Initiallize algorithm. * */ static int tsig_openssl_init_algorithm(allocator_type* allocator, const char* digest, const char* name, const char* wireformat) { tsig_algo_type* algorithm = NULL; const EVP_MD *hmac_algorithm = NULL; ods_log_assert(allocator); ods_log_assert(digest); ods_log_assert(name); ods_log_assert(wireformat); hmac_algorithm = EVP_get_digestbyname(digest); if (!hmac_algorithm) { ods_log_error("[%s] %s digest not available", tsig_str, digest); return 0; } algorithm = (tsig_algo_type *) allocator_alloc(allocator, sizeof(tsig_algo_type)); algorithm->txt_name = name; algorithm->wf_name = ldns_dname_new_frm_str(wireformat); if (!algorithm->wf_name) { ods_log_error("[%s] unable to parse %s algorithm", tsig_str, wireformat); return 0; } algorithm->max_digest_size = EVP_MAX_MD_SIZE; algorithm->data = hmac_algorithm; algorithm->hmac_create = create_context; algorithm->hmac_init = init_context; algorithm->hmac_update = update; algorithm->hmac_final = final; tsig_handler_add_algo(algorithm); return 1; } /** * Initialize OpenSSL support for TSIG. * */ ods_status tsig_handler_openssl_init(allocator_type* allocator) { tsig_cleanup_table = NULL; tsig_allocator = allocator; OpenSSL_add_all_digests(); ods_log_debug("[%s] add md5", tsig_str); if (!tsig_openssl_init_algorithm(allocator, "md5", "hmac-md5", "hmac-md5.sig-alg.reg.int.")) { return ODS_STATUS_ERR; } #ifdef HAVE_EVP_SHA1 ods_log_debug("[%s] add sha1", tsig_str); if (!tsig_openssl_init_algorithm(allocator, "sha1", "hmac-sha1", "hmac-sha1.")) { return ODS_STATUS_ERR; } #endif /* HAVE_EVP_SHA1 */ #ifdef HAVE_EVP_SHA256 ods_log_debug("[%s] add sha256", tsig_str); if (!tsig_openssl_init_algorithm(allocator, "sha256", "hmac-sha256", "hmac-sha256.")) { return ODS_STATUS_ERR; } #endif /* HAVE_EVP_SHA256 */ return ODS_STATUS_OK; } static void cleanup_context(void *data) { HMAC_CTX* context = (HMAC_CTX*) data; HMAC_CTX_cleanup(context); return; } static void context_add_cleanup(void* context) { tsig_cleanup_table_type* entry = NULL; if (!context) { return; } entry = (tsig_cleanup_table_type *) allocator_alloc(tsig_allocator, sizeof(tsig_cleanup_table_type)); if (entry) { entry->cleanup = context; entry->next = tsig_cleanup_table; tsig_cleanup_table = entry; } return; } static void* create_context(allocator_type* allocator) { HMAC_CTX* context = (HMAC_CTX*) allocator_alloc(allocator, sizeof(HMAC_CTX)); HMAC_CTX_init(context); context_add_cleanup(context); return context; } static void init_context(void* context, tsig_algo_type *algorithm, tsig_key_type *key) { HMAC_CTX* ctx = (HMAC_CTX*) context; const EVP_MD* md = (const EVP_MD*) algorithm->data; HMAC_Init_ex(ctx, key->data, key->size, md, NULL); return; } static void update(void* context, const void* data, size_t size) { HMAC_CTX* ctx = (HMAC_CTX*) context; HMAC_Update(ctx, (unsigned char*) data, (int) size); return; } static void final(void* context, uint8_t* digest, size_t* size) { HMAC_CTX* ctx = (HMAC_CTX*) context; unsigned len = (unsigned) *size; HMAC_Final(ctx, digest, &len); *size = (size_t) len; return; } /** * Finalize OpenSSL support for TSIG. * */ void tsig_handler_openssl_finalize(void) { tsig_cleanup_table_type* entry = tsig_cleanup_table; while (entry) { cleanup_context(entry->cleanup); entry = entry->next; } EVP_cleanup(); return; } #endif /* HAVE_SSL */ opendnssec-1.4.3/signer/src/wire/tcpset.c0000664000175000017500000001633612040226115015277 00000000000000/* * $Id: tcpset.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * TCP connections. * */ #include "config.h" #include "wire/tcpset.h" #include static const char* tcp_str = "tcp"; /** * Create a tcp connection. * */ tcp_conn_type* tcp_conn_create(allocator_type* allocator) { tcp_conn_type* tcp_conn = NULL; if (!allocator) { return NULL; } tcp_conn = (tcp_conn_type*) allocator_alloc(allocator, sizeof(tcp_conn_type)); if (!tcp_conn) { return NULL; } memset(tcp_conn, 0, sizeof(tcp_conn_type)); tcp_conn->packet = buffer_create(allocator, PACKET_BUFFER_SIZE); if (!tcp_conn->packet) { allocator_deallocate(allocator, (void*)tcp_conn); return NULL; } tcp_conn->msglen = 0; tcp_conn->total_bytes = 0; tcp_conn->fd = -1; return tcp_conn; } /** * Create a set of tcp connections. * */ tcp_set_type* tcp_set_create(allocator_type* allocator) { size_t i = 0; tcp_set_type* tcp_set = NULL; tcp_set = (tcp_set_type*) allocator_alloc(allocator, sizeof(tcp_set_type)); memset(tcp_set, 0, sizeof(tcp_set_type)); tcp_set->tcp_count = 0; for (i=0; i < TCPSET_MAX; i++) { tcp_set->tcp_conn[i] = tcp_conn_create(allocator); } tcp_set->tcp_waiting_first = NULL; tcp_set->tcp_waiting_last = NULL; return tcp_set; } /** * Make tcp connection ready for reading. * \param[in] tcp tcp connection * */ void tcp_conn_ready(tcp_conn_type* tcp) { ods_log_assert(tcp); tcp->total_bytes = 0; tcp->msglen = 0; buffer_clear(tcp->packet); return; } /* * Read from a tcp connection. * */ int tcp_conn_read(tcp_conn_type* tcp) { ssize_t received = 0; ods_log_assert(tcp); ods_log_assert(tcp->fd != -1); /* receive leading packet length bytes */ if (tcp->total_bytes < sizeof(tcp->msglen)) { received = read(tcp->fd, (char*) &tcp->msglen + tcp->total_bytes, sizeof(tcp->msglen) - tcp->total_bytes); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, try later */ return 0; } else { if (errno != ECONNRESET) { ods_log_error("[%s] error read() sz: %s", tcp_str, strerror(errno)); } return -1; } } else if (received == 0) { /* EOF */ return -1; } tcp->total_bytes += received; if (tcp->total_bytes < sizeof(tcp->msglen)) { /* not complete yet, try later */ return 0; } ods_log_assert(tcp->total_bytes == sizeof(tcp->msglen)); tcp->msglen = ntohs(tcp->msglen); if (tcp->msglen > buffer_capacity(tcp->packet)) { /* packet to big, drop connection */ ods_log_error("[%s] packet too big, dropping connection", tcp_str); return 0; } buffer_set_limit(tcp->packet, tcp->msglen); } ods_log_assert(buffer_remaining(tcp->packet) > 0); received = read(tcp->fd, buffer_current(tcp->packet), buffer_remaining(tcp->packet)); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, try later */ return 0; } else { if (errno != ECONNRESET) { ods_log_error("[%s] error read(): %s", tcp_str, strerror(errno)); } return -1; } } else if (received == 0) { /* EOF */ return -1; } tcp->total_bytes += received; buffer_skip(tcp->packet, received); if (buffer_remaining(tcp->packet) > 0) { /* not complete yet, wait for more */ return 0; } /* completed */ ods_log_assert(buffer_position(tcp->packet) == tcp->msglen); return 1; } /* * Write to a tcp connection. * */ int tcp_conn_write(tcp_conn_type* tcp) { ssize_t sent = 0; ods_log_assert(tcp); ods_log_assert(tcp->fd != -1); if (tcp->total_bytes < sizeof(tcp->msglen)) { uint16_t sendlen = htons(tcp->msglen); sent = write(tcp->fd, (const char*)&sendlen + tcp->total_bytes, sizeof(tcp->msglen) - tcp->total_bytes); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, try later */ return 0; } else { return -1; } } tcp->total_bytes += sent; if (tcp->total_bytes < sizeof(tcp->msglen)) { /* incomplete write, resume later */ return 0; } ods_log_assert(tcp->total_bytes == sizeof(tcp->msglen)); } ods_log_assert(tcp->total_bytes < tcp->msglen + sizeof(tcp->msglen)); sent = write(tcp->fd, buffer_current(tcp->packet), buffer_remaining(tcp->packet)); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, try later */ return 0; } else { return -1; } } buffer_skip(tcp->packet, sent); tcp->total_bytes += sent; if (tcp->total_bytes < tcp->msglen + sizeof(tcp->msglen)) { /* more to write when socket becomes writable again */ return 0; } ods_log_assert(tcp->total_bytes == tcp->msglen + sizeof(tcp->msglen)); return 1; } /** * Clean up tcp connection. * */ static void tcp_conn_cleanup(tcp_conn_type* conn, allocator_type* allocator) { if (!conn || !allocator) { return; } buffer_cleanup(conn->packet, allocator); allocator_deallocate(allocator, (void*) conn); return; } /** * Clean up set of tcp connections. * */ void tcp_set_cleanup(tcp_set_type* set, allocator_type* allocator) { size_t i = 0; if (!set || !allocator) { return; } for (i=0; i < TCPSET_MAX; i++) { tcp_conn_cleanup(set->tcp_conn[i], allocator); } allocator_deallocate(allocator, (void*) set); return; } opendnssec-1.4.3/signer/src/wire/notify.c0000664000175000017500000004233612173474626015327 00000000000000/* * $Id: notify.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Notify sending. * */ #include "config.h" #include "adapter/addns.h" #include "daemon/xfrhandler.h" #include "signer/domain.h" #include "signer/zone.h" #include "wire/notify.h" #include "wire/xfrd.h" #include static const char* notify_str = "notify"; static void notify_handle_zone(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Get time. * */ static time_t notify_time(notify_type* notify) { ods_log_assert(notify); ods_log_assert(notify->xfrhandler); return xfrhandler_time((xfrhandler_type*) notify->xfrhandler); } /** * Set timer. * */ static void notify_set_timer(notify_type* notify, time_t t) { if (!notify || !notify->xfrhandler) { return; } /** * Randomize the time, within 90%-100% of original. * Not later so zones cannot expire too late. */ if(t > notify_time(notify) + 10) { time_t extra = t - notify_time(notify); time_t base = extra*9/10; t = notify_time(notify) + base + random()%(extra-base); } notify->handler.timeout = ¬ify->timeout; notify->timeout.tv_sec = t; notify->timeout.tv_nsec = 0; return; } /** * Create notify structure. * */ notify_type* notify_create(void* xfrhandler, void* zone) { notify_type* notify = NULL; allocator_type* allocator = NULL; if (!xfrhandler || !zone) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create notify structure: " "allocator_create() failed", notify_str); return NULL; } notify = (notify_type*) allocator_alloc(allocator, sizeof(notify_type)); if (!notify) { ods_log_error("[%s] unable to create notify structure: " " allocator_alloc() failed", notify_str); allocator_cleanup(allocator); return NULL; } notify->allocator = allocator; notify->zone = zone; notify->xfrhandler = xfrhandler; notify->waiting_next = NULL; notify->secondary = NULL; notify->soa = NULL; notify->tsig_rr = tsig_rr_create(allocator); if (!notify->tsig_rr) { notify_cleanup(notify); return NULL; } notify->retry = 0; notify->query_id = 0; notify->is_waiting = 0; notify->handler.fd = -1; notify->timeout.tv_sec = 0; notify->timeout.tv_nsec = 0; notify->handler.timeout = NULL; notify->handler.user_data = notify; notify->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; notify->handler.event_handler = notify_handle_zone; return notify; } /** * Setup notify. * */ static void notify_setup(notify_type* notify) { zone_type* zone = NULL; dnsout_type* dnsout = NULL; if (!notify) { return; } zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->adoutbound); ods_log_assert(zone->adoutbound->config); ods_log_assert(zone->adoutbound->type == ADAPTER_DNS); dnsout = (dnsout_type*) zone->adoutbound->config; notify->retry = 0; notify->secondary = dnsout->do_notify; ods_log_debug("[%s] setup notify for zone %s", notify_str, zone->name); notify_set_timer(notify, notify_time(notify)); return; } /** * Disable notify. * */ static void notify_disable(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; if (!notify) { return; } xfrhandler = (xfrhandler_type*) notify->xfrhandler; ods_log_assert(xfrhandler); zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->name); notify->secondary = NULL; notify->handler.timeout = NULL; if (notify->handler.fd != -1) { close(notify->handler.fd); notify->handler.fd = -1; } if (xfrhandler->notify_udp_num == NOTIFY_MAX_UDP) { while (xfrhandler->notify_waiting_first) { notify_type* wn = xfrhandler->notify_waiting_first; ods_log_assert(wn->is_waiting); wn->is_waiting = 0; xfrhandler->notify_waiting_first = wn->waiting_next; if (xfrhandler->notify_waiting_last == wn) { xfrhandler->notify_waiting_last = NULL; } if (wn->secondary) { ods_log_debug("[%s] zone %s notify off waiting list", notify_str, zone->name); notify_setup(wn); return; } } } ods_log_debug("[%s] notify for zone %s disabled", notify_str, zone->name); xfrhandler->notify_udp_num--; return; } /** * Next secondary. * */ static void notify_next(notify_type* notify) { if (!notify || !notify->secondary) { return; } notify->secondary = notify->secondary->next; notify->retry = 0; if (!notify->secondary) { zone_type* zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] zone %s no more secondaries, disable notify", notify_str, zone->name); notify_disable(notify); } return; } /** * Read packet from udp. * */ static int notify_udp_read_packet(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; ssize_t received = 0; ods_log_assert(notify); xfrhandler = (xfrhandler_type*) notify->xfrhandler; ods_log_assert(xfrhandler); buffer_clear(xfrhandler->packet); received = recvfrom(notify->handler.fd, buffer_begin(xfrhandler->packet), buffer_remaining(xfrhandler->packet), 0, NULL, NULL); if (received == -1) { ods_log_error("[%s] unable to read packet: recvfrom() failed fd %d " "(%s)", notify_str, notify->handler.fd, strerror(errno)); return 0; } buffer_set_limit(xfrhandler->packet, received); return 1; } /** * Handle notify reply. * */ static int notify_handle_reply(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; ods_log_assert(notify); ods_log_assert(notify->secondary); ods_log_assert(notify->secondary->address); xfrhandler = (xfrhandler_type*) notify->xfrhandler; zone = (zone_type*) notify->zone; ods_log_assert(xfrhandler); ods_log_assert(zone); ods_log_assert(zone->name); if ((buffer_pkt_opcode(xfrhandler->packet) != LDNS_PACKET_NOTIFY) || (buffer_pkt_qr(xfrhandler->packet) == 0)) { ods_log_error("[%s] zone %s received bad notify reply opcode/qr", notify_str, zone->name); return 0; } if (buffer_pkt_id(xfrhandler->packet) != notify->query_id) { ods_log_error("[%s] zone %s received bad notify reply id", notify_str, zone->name); return 0; } /* could check tsig */ if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOERROR) { const char* str = buffer_rcode2str(buffer_pkt_rcode(xfrhandler->packet)); ods_log_error("[%s] zone %s received bad notify rcode %s", notify_str, zone->name, str?str:"UNKNOWN" ); if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOTIMPL) { return 1; } return 0; } ods_log_debug("[%s] zone %s secondary %s notify reply ok", notify_str, zone->name, notify->secondary->address); return 1; } /** * Send notify over udp. * */ static int notify_send_udp(notify_type* notify, buffer_type* buffer) { struct sockaddr_storage to; socklen_t to_len = 0; int fd = -1; int family = PF_INET; ssize_t nb = 0; ods_log_assert(buffer); ods_log_assert(notify); ods_log_assert(notify->secondary); ods_log_assert(notify->secondary->address); /* this will set the remote port to acl->port or TCP_PORT */ to_len = xfrd_acl_sockaddr_to(notify->secondary, &to); /* get the address family of the remote host */ if (notify->secondary->family == AF_INET6) { family = PF_INET6; } /* create socket */ fd = socket(family, SOCK_DGRAM, IPPROTO_UDP); if (fd == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "socket() failed (%s)", notify_str, notify->secondary->address, strerror(errno)); return -1; } /* bind it? */ /* send it (udp) */ ods_log_deeebug("[%s] send %d bytes over udp to %s", notify_str, buffer_remaining(buffer), notify->secondary->address); nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0, (struct sockaddr*)&to, to_len); if (nb == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "sendto() failed (%s)", notify_str, notify->secondary->address, strerror(errno)); close(fd); return -1; } return fd; } /** * Sign notify. * */ static void notify_tsig_sign(notify_type* notify, buffer_type* buffer) { tsig_algo_type* algo = NULL; if (!notify || !notify->tsig_rr || !notify->secondary || !notify->secondary->tsig || !notify->secondary->tsig->key || !buffer) { return; /* no tsig configured */ } algo = tsig_lookup_algo(notify->secondary->tsig->algorithm); if (!algo) { ods_log_error("[%s] unable to sign notify: tsig unknown algorithm " "%s", notify_str, notify->secondary->tsig->algorithm); return; } ods_log_assert(algo); tsig_rr_reset(notify->tsig_rr, algo, notify->secondary->tsig->key); notify->tsig_rr->original_query_id = buffer_pkt_id(buffer); notify->tsig_rr->algo_name = ldns_rdf_clone(notify->tsig_rr->algo->wf_name); notify->tsig_rr->key_name = ldns_rdf_clone(notify->tsig_rr->key->dname); log_dname(notify->tsig_rr->key_name, "tsig sign notify with key", LOG_DEBUG); log_dname(notify->tsig_rr->algo_name, "tsig sign notify with algorithm", LOG_DEBUG); tsig_rr_prepare(notify->tsig_rr); tsig_rr_update(notify->tsig_rr, buffer, buffer_position(buffer)); tsig_rr_sign(notify->tsig_rr); ods_log_debug("[%s] tsig append rr to notify id=%u", notify_str, buffer_pkt_id(buffer)); tsig_rr_append(notify->tsig_rr, buffer); buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1); tsig_rr_prepare(notify->tsig_rr); return; } /** * Send notify. * */ void notify_send(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; ods_log_assert(notify); ods_log_assert(notify->secondary); ods_log_assert(notify->secondary->address); xfrhandler = (xfrhandler_type*) notify->xfrhandler; zone = (zone_type*) notify->zone; ods_log_assert(xfrhandler); ods_log_assert(zone); ods_log_assert(zone->name); if (notify->handler.fd != -1) { close(notify->handler.fd); } notify->handler.fd = -1; notify->timeout.tv_sec = notify_time(notify) + NOTIFY_RETRY_TIMEOUT; buffer_pkt_notify(xfrhandler->packet, zone->apex, LDNS_RR_CLASS_IN); notify->query_id = buffer_pkt_id(xfrhandler->packet); buffer_pkt_set_aa(xfrhandler->packet); /* add current SOA to answer section */ if (notify->soa) { if (buffer_write_rr(xfrhandler->packet, notify->soa)) { buffer_pkt_set_ancount(xfrhandler->packet, 1); } } if (notify->secondary->tsig) { notify_tsig_sign(notify, xfrhandler->packet); } buffer_flip(xfrhandler->packet); notify->handler.fd = notify_send_udp(notify, xfrhandler->packet); if (notify->handler.fd == -1) { ods_log_error("[%s] unable to send notify retry %u for zone %s to " "%s: notify_send_udp() failed", notify_str, notify->retry, zone->name, notify->secondary->address); return; } ods_log_verbose("[%s] notify retry %u for zone %s sent to %s", notify_str, notify->retry, zone->name, notify->secondary->address); return; } /** * Handle notify. * */ static void notify_handle_zone(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { notify_type* notify = NULL; xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; if (!handler) { return; } notify = (notify_type*) handler->user_data; ods_log_assert(notify); xfrhandler = (xfrhandler_type*) notify->xfrhandler; zone = (zone_type*) notify->zone; ods_log_assert(xfrhandler); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] handle notify for zone %s", notify_str, zone->name); if (notify->is_waiting) { ods_log_debug("[%s] already waiting, skipping notify for zone %s", notify_str, zone->name); ods_log_assert(notify->handler.fd == -1); return; } if (event_types & NETIO_EVENT_READ) { ods_log_debug("[%s] read notify ok for zone %s", notify_str, zone->name); ods_log_assert(notify->handler.fd != -1); if (notify_udp_read_packet(notify)) { if (notify_handle_reply(notify)) { notify_next(notify); } } } else if(event_types & NETIO_EVENT_TIMEOUT) { ods_log_debug("[%s] notify timeout for zone %s", notify_str, zone->name); /* timeout, try again */ } /* see if notify is still enabled */ if (notify->secondary) { ods_log_assert(notify->secondary->address); notify->retry++; if (notify->retry > NOTIFY_MAX_RETRY) { ods_log_verbose("[%s] notify max retry for zone %s, %s unreachable", notify_str, zone->name, notify->secondary->address); notify_next(notify); } else { notify_send(notify); } } return; } /** * Update current SOA. * */ static void notify_update_soa(notify_type* notify, ldns_rr* soa) { if (!notify) { return; } if (notify->soa) { ldns_rr_free(notify->soa); } notify->soa = soa; return; } /** * Enable notify. * */ void notify_enable(notify_type* notify, ldns_rr* soa) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; dnsout_type* dnsout = NULL; if (!notify) { return; } xfrhandler = (xfrhandler_type*) notify->xfrhandler; ods_log_assert(xfrhandler); zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adoutbound); ods_log_assert(zone->adoutbound->config); ods_log_assert(zone->adoutbound->type == ADAPTER_DNS); dnsout = (dnsout_type*) zone->adoutbound->config; if (!dnsout->do_notify) { ods_log_warning("[%s] zone %s has no notify acl", notify_str, zone->name); return; /* nothing to do */ } notify_update_soa(notify, soa); if (notify->is_waiting) { ods_log_debug("[%s] zone %s already on waiting list", notify_str, zone->name); return; } if (xfrhandler->notify_udp_num < NOTIFY_MAX_UDP) { notify_setup(notify); xfrhandler->notify_udp_num++; ods_log_debug("[%s] zone %s notify enabled", notify_str, zone->name); return; } /* put it in waiting list */ notify->secondary = dnsout->do_notify; notify->is_waiting = 1; notify->waiting_next = NULL; if (xfrhandler->notify_waiting_last) { xfrhandler->notify_waiting_last->waiting_next = notify; } else { xfrhandler->notify_waiting_first = notify; } xfrhandler->notify_waiting_last = notify; notify->handler.timeout = NULL; ods_log_debug("[%s] zone %s notify on waiting list", notify_str, zone->name); return; } /** * Cleanup notify structure. * */ void notify_cleanup(notify_type* notify) { allocator_type* allocator = NULL; if (!notify) { return; } allocator = notify->allocator; if (notify->handler.fd != -1) { close(notify->handler.fd); notify->handler.fd = -1; } if (notify->soa) { ldns_rr_free(notify->soa); } tsig_rr_cleanup(notify->tsig_rr); allocator_deallocate(allocator, (void*) notify); allocator_cleanup(allocator); return; } opendnssec-1.4.3/signer/src/wire/buffer.h0000664000175000017500000004126612173474626015276 00000000000000/* * $Id: buffer.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Packet buffer. * */ #ifndef WIRE_BUFFER_H #define WIRE_BUFFER_H #include "config.h" #include "shared/allocator.h" #include "shared/log.h" #include "shared/status.h" #include #include #define BUFFER_PKT_HEADER_SIZE 12 #define MAXDOMAINLEN 255 #define MAX_RDLENGTH 65535 #define MAX_RR_SIZE \ (MAXDOMAINLEN + sizeof(uint32_t) + 4*sizeof(uint16_t) + MAX_RDLENGTH) #define MAX_PACKET_SIZE 65535 #define PACKET_BUFFER_SIZE (MAX_PACKET_SIZE + MAX_RR_SIZE) #define QR_MASK 0x80U #define QR_SHIFT 7 #define QR(packet) (*buffer_at((packet), 2) & QR_MASK) #define QR_SET(packet) (*buffer_at((packet), 2) |= QR_MASK) #define QR_CLR(packet) (*buffer_at((packet), 2) &= ~QR_MASK) #define OPCODE_MASK 0x78U #define OPCODE_SHIFT 3 #define OPCODE(packet) ((*buffer_at((packet), 2) & OPCODE_MASK) >> OPCODE_SHIFT) #define OPCODE_SET(packet, opcode) \ (*buffer_at((packet), 2) = (*buffer_at((packet), 2) & ~OPCODE_MASK) | ((opcode) << OPCODE_SHIFT)) #define AA_MASK 0x04U #define AA_SHIFT 2 #define AA(packet) (*buffer_at((packet), 2) & AA_MASK) #define AA_SET(packet) (*buffer_at((packet), 2) |= AA_MASK) #define AA_CLR(packet) (*buffer_at((packet), 2) &= ~AA_MASK) #define TC_MASK 0x02U #define TC_SHIFT 1 #define TC(packet) (*buffer_at((packet), 2) & TC_MASK) #define TC_SET(packet) (*buffer_at((packet), 2) |= TC_MASK) #define TC_CLR(packet) (*buffer_at((packet), 2) &= ~TC_MASK) #define RD_MASK 0x01U #define RD_SHIFT 0 #define RD(packet) (*buffer_at((packet), 2) & RD_MASK) #define RD_SET(packet) (*buffer_at((packet), 2) |= RD_MASK) #define RD_CLR(packet) (*buffer_at((packet), 2) &= ~RD_MASK) #define RA_MASK 0x80U #define RA_SHIFT 7 #define RA(packet) (*buffer_at((packet), 3) & RA_MASK) #define RA_SET(packet) (*buffer_at((packet), 3) |= RA_MASK) #define RA_CLR(packet) (*buffer_at((packet), 3) &= ~RA_MASK) #define AD_MASK 0x20U #define AD_SHIFT 5 #define AD(packet) (*buffer_at((packet), 3) & AD_MASK) #define AD_SET(packet) (*buffer_at((packet), 3) |= AD_MASK) #define AD_CLR(packet) (*buffer_at((packet), 3) &= ~AD_MASK) #define CD_MASK 0x10U #define CD_SHIFT 4 #define CD(packet) (*buffer_at((packet), 3) & CD_MASK) #define CD_SET(packet) (*buffer_at((packet), 3) |= CD_MASK) #define CD_CLR(packet) (*buffer_at((packet), 3) &= ~CD_MASK) #define RCODE_MASK 0x0fU #define RCODE_SHIFT 0 #define RCODE(packet) (*buffer_at((packet), 3) & RCODE_MASK) #define RCODE_SET(packet, rcode) \ (*buffer_at((packet), 3) = (*buffer_at((packet), 3) & ~RCODE_MASK) | (rcode)) extern ods_lookup_table ods_rcode_str[]; /** * Buffer. */ typedef struct buffer_struct buffer_type; struct buffer_struct { size_t position; size_t limit; size_t capacity; uint8_t* data; unsigned fixed : 1; }; /** * Create a new buffer with the specified capacity. * \param[in] allocator memory allocator * \param[in] capacity specified capacity * \return buffer_type* buffer * */ buffer_type* buffer_create(allocator_type* allocator, size_t capacity); /** * Create a buffer with the specified data. * The data is not copied and no memory allocations are done. * The buffer is fixed and cannot be resized using buffer_reserve(). * \param[in] buffer buffer * \param[in] data specified data * \param[in] size size of data * */ void buffer_create_from(buffer_type* buffer, void* data, size_t size); /** * Clear the buffer and make it ready for writing. * The buffer's limit is set to the capacity and the position is set to 0. * \param[in] buffer buffer * */ void buffer_clear(buffer_type* buffer); /** * Flip the buffer and make it ready for reading. * The data that has been written to the buffer. * The buffer's limit is set to the current position and the position is set * to 0. * \param[in] buffer buffer * */ void buffer_flip(buffer_type* buffer); /** * Make the buffer ready for re-reading the data. * The buffer's position is reset to 0. * \param[in] buffer buffer * */ void buffer_rewind(buffer_type* buffer); /** * Get the buffer's position. * \param[in] buffer buffer * \return size_t position * */ size_t buffer_position(buffer_type* buffer); /** * Set the buffer's position. * The position must be less than or equal to the buffer's limit. * \param[in] buffer buffer * \param[in] pos position * */ void buffer_set_position(buffer_type* buffer, size_t pos); /** * Change the buffer's position. * The position must not be moved behind the buffer's limit or before the * beginning of the buffer. * \param[in] buffer buffer * \param[in] count number of bytes to skip * */ void buffer_skip(buffer_type* buffer, ssize_t count); /** * Change the buffer's position so that one dname is skipped. * \param[in] buffer buffer * \return int 0 if dname skipping failed * 1 otherwise * */ int buffer_skip_dname(buffer_type* buffer); /** * Change the buffer's position so that one RR is skipped. * \param[in] buffer buffer * \param[in] qrr 1 if we skip RRs in the question section. * \return int 0 if RR skipping failed * 1 otherwise * */ int buffer_skip_rr(buffer_type* buffer, unsigned qrr); /** * Get the buffer's limit. * \param[in] buffer buffer * \return size_t limit * */ size_t buffer_limit(buffer_type* buffer); /** * Set the buffer's limit. If the buffer's position is greater * than the new limit, the position is set to the limit. * \param[in] buffer buffer * \param[in] limit limit * */ void buffer_set_limit(buffer_type* buffer, size_t limit); /** * Get the buffer's capacity. * \param[in] buffer buffer * \return size_t capacity * */ size_t buffer_capacity(buffer_type* buffer); /** * Return a pointer to the data at the indicated position. * \param[in] buffer buffer * \param[in] at indicated position * \return uint8_t* pointer to the data at the indicated position * */ uint8_t* buffer_at(buffer_type* buffer, size_t at); /** * Return a pointer to the data at the beginning of the buffer. * \param[in] buffer buffer * \return uint8_t* pointer to the data at the begin of the buffer * */ uint8_t* buffer_begin(buffer_type* buffer); /** * Return a pointer to the data at the end of the buffer. * \param[in] buffer buffer * \return uint8_t* pointer to the data at the end of the buffer * */ uint8_t* buffer_end(buffer_type* buffer); /** * Return a pointer to the data at the buffer's current position. * \param[in] buffer buffer * \return uint8_t* pointer to the data at the buffer's current position * */ uint8_t* buffer_current(buffer_type* buffer); /** * The number of bytes remaining between the buffer's position and limit. * \param[in] buffer buffer * \return size_t remaining number of bytes * */ size_t buffer_remaining(buffer_type* buffer); /** * Check if the buffer has enough bytes available. * \param[in] buffer buffer * \param[in] count number of bytes that needs to be available * \return int 0 if not enough bytes are available * 1 otherwise * */ int buffer_available(buffer_type* buffer, size_t count); /** * Write to buffer. * \param[in] buffer buffer * \param[in] data data to write * \param[in] count number of bytes to write * */ void buffer_write(buffer_type* buffer, const void* data, size_t count); /** * Write uint8_t to buffer. * \param[in] buffer buffer * \param[in] data data to write * */ void buffer_write_u8(buffer_type* buffer, uint8_t data); /** * Write uint16_t to buffer. * \param[in] buffer buffer * \param[in] data data to write * */ void buffer_write_u16(buffer_type* buffer, uint16_t data); /** * Write uint16_t to buffer at indicated position. * \param[in] buffer buffer * \param[in] at indicated position * \param[in] data data to write * */ void buffer_write_u16_at(buffer_type* buffer, size_t at, uint16_t data); /** * Write uint32_t to buffer. * \param[in] buffer buffer * \param[in] data data to write * */ void buffer_write_u32(buffer_type* buffer, uint32_t data); /** * Write rdf to buffer. * \param[in] buffer buffer * \param[in] rdf data to write * */ void buffer_write_rdf(buffer_type* buffer, ldns_rdf* rdf); /** * Write rr to buffer. * \param[in] buffer buffer * \param[in] rr data to write * \return int 1 if rr fits, 0 otherwise * */ int buffer_write_rr(buffer_type* buffer, ldns_rr* rr); /** * Read from buffer. * \param[in] buffer buffer * \param[in] data read data * \param[in] count number of bytes to read * */ void buffer_read(buffer_type* buffer, void* data, size_t count); /** * Read uint8_t from buffer. * \param[in] buffer buffer * \return uint8_t read data * */ uint8_t buffer_read_u8(buffer_type* buffer); /** * Read uint16_t from buffer. * \param[in] buffer buffer * \return uint16_t read data * */ uint16_t buffer_read_u16(buffer_type* buffer); /** * Read uint32_t from buffer. * \param[in] buffer buffer * \return uint32_t read data * */ uint32_t buffer_read_u32(buffer_type* buffer); /** * Read dname from buffer. * \param[in] buffer buffer * \param[out] dname dname * \param[in] allow_pointers allow pointer labels * \return int dname length * */ size_t buffer_read_dname(buffer_type* buffer, uint8_t* dname, unsigned allow_pointers); /** * Get query id from buffer. * \param[in] buffer buffer * \return uint16_t query id * */ uint16_t buffer_pkt_id(buffer_type* buffer); /** * Set random query id in buffer. * \param[in] buffer buffer * */ void buffer_pkt_set_random_id(buffer_type* buffer); /** * Get flags from buffer. * \param[in] buffer buffer * \return uint16_t flags * */ uint16_t buffer_pkt_flags(buffer_type* buffer); /** * Set flags in buffer. * \param[in] buffer buffer * \param[in] flags flags * */ void buffer_pkt_set_flags(buffer_type* buffer, uint16_t flags); /** * Get QR bit from buffer. * \param[in] buffer buffer * \return int 0 if QR bit is clear * 1 if QR bit is set * */ int buffer_pkt_qr(buffer_type* buffer); /** * Set QR bit in buffer. * \param[in] buffer buffer * */ void buffer_pkt_set_qr(buffer_type* buffer); /** * Clear QR bit in buffer. * \param[in] buffer buffer * */ void buffer_pkt_clear_qr(buffer_type* buffer); /** * Get AA bit from buffer. * \param[in] buffer buffer * \return int 0 if AA bit is clear * 1 if AA bit is set * */ int buffer_pkt_aa(buffer_type* buffer); /** * Set AA bit in buffer. * \param[in] buffer buffer * */ void buffer_pkt_set_aa(buffer_type* buffer); /** * Get TC bit from buffer. * \param[in] buffer buffer * \return int 0 if TC bit is clear * 1 if TC bit is set * */ int buffer_pkt_tc(buffer_type* buffer); /** * Get RD bit from buffer. * \param[in] buffer buffer * \return int 0 if RD bit is clear * 1 if RD bit is set * */ int buffer_pkt_rd(buffer_type* buffer); /** * Get RA bit from buffer. * \param[in] buffer buffer * \return int 0 if RA bit is clear * 1 if RA bit is set * */ int buffer_pkt_ra(buffer_type* buffer); /** * Get AD bit from buffer. * \param[in] buffer buffer * \return int 0 if AD bit is clear * 1 if AD bit is set * */ int buffer_pkt_ad(buffer_type* buffer); /** * Get CD bit from buffer. * \param[in] buffer buffer * \return int 0 if CD bit is clear * 1 if CD bit is set * */ int buffer_pkt_cd(buffer_type* buffer); /** * Get OPCODE from buffer. * \param[in] buffer buffer * \return ldns_pkt_opcode OPCODE * */ ldns_pkt_opcode buffer_pkt_opcode(buffer_type* buffer); /** * Set OPCODE in buffer. * \param[in] buffer buffer * \param[in] opcode OPCODE * */ void buffer_pkt_set_opcode(buffer_type* buffer, ldns_pkt_opcode opcode); /** * Get RCODE from buffer. * \param[in] buffer buffer * \return ldns_pkt_rcode RCODE * */ ldns_pkt_rcode buffer_pkt_rcode(buffer_type* buffer); /** * Set RCODE in buffer. * \param[in] buffer buffer * \param[in] rcode RCODE * */ void buffer_pkt_set_rcode(buffer_type* buffer, ldns_pkt_rcode rcode); /** * Look up a descriptive text by each rcode. * \param[in] rcode rcode * \return const char* descriptive text * */ const char* buffer_rcode2str(ldns_pkt_rcode rcode); /** * Get QDCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t QDCOUNT * */ uint16_t buffer_pkt_qdcount(buffer_type* buffer); /** * Set QDCOUNT in buffer. * \param[in] buffer buffer * \param[in] count QDCOUNT * */ void buffer_pkt_set_qdcount(buffer_type* buffer, uint16_t count); /** * Get ANCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t ANCOUNT * */ uint16_t buffer_pkt_ancount(buffer_type* buffer); /** * Set ANCOUNT in buffer. * \param[in] buffer buffer * \param[in] count ANCOUNT * */ void buffer_pkt_set_ancount(buffer_type* buffer, uint16_t count); /** * Get NSCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t NSCOUNT * */ uint16_t buffer_pkt_nscount(buffer_type* buffer); /** * Set NSCOUNT in buffer. * \param[in] buffer buffer * \param[in] count NSCOUNT * */ void buffer_pkt_set_nscount(buffer_type* buffer, uint16_t count); /** * Get ARCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t ARCOUNT * */ uint16_t buffer_pkt_arcount(buffer_type* buffer); /** * Set ARCOUNT in buffer. * \param[in] buffer buffer * \param[in] count ARCOUNT * */ void buffer_pkt_set_arcount(buffer_type* buffer, uint16_t count); /** * Make a new query. * \param[in] buffer buffer * \param[in] qname qname * \param[in] qtype qtype * \param[in] qclass qclass * */ void buffer_pkt_query(buffer_type* buffer, ldns_rdf* qname, ldns_rr_type qtype, ldns_rr_class qclass); /** * Make a new notify. * \param[in] buffer buffer * \param[in] qname qname * \param[in] qclass qclass * */ void buffer_pkt_notify(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass); /** * Make a new axfr. * \param[in] buffer buffer * \param[in] qname qname * \param[in] qclass qclass * */ void buffer_pkt_axfr(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass); /** * Print packet buffer. * \param[in] fd file descriptor * \param[in] buffer buffer * */ void buffer_pkt_print(FILE* fd, buffer_type* buffer); /** * Clean up buffer. * \param[in] buffer buffer * \param[in] allocator memory allocator * */ void buffer_cleanup(buffer_type* buffer, allocator_type* allocator); /** UTIL **/ /* * Copy data allowing for unaligned accesses in network byte order * (big endian). */ static inline uint16_t read_uint16(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES return ntohs(* (uint16_t *) src); #else uint8_t *p = (uint8_t *) src; return (p[0] << 8) | p[1]; #endif } static inline uint32_t read_uint32(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES return ntohl(* (uint32_t *) src); #else uint8_t *p = (uint8_t *) src; return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; #endif } static inline void write_uint16(void *dst, uint16_t data) { #ifdef ALLOW_UNALIGNED_ACCESSES * (uint16_t *) dst = htons(data); #else uint8_t *p = (uint8_t *) dst; p[0] = (uint8_t) ((data >> 8) & 0xff); p[1] = (uint8_t) (data & 0xff); #endif } static inline void write_uint32(void *dst, uint32_t data) { #ifdef ALLOW_UNALIGNED_ACCESSES * (uint32_t *) dst = htonl(data); #else uint8_t *p = (uint8_t *) dst; p[0] = (uint8_t) ((data >> 24) & 0xff); p[1] = (uint8_t) ((data >> 16) & 0xff); p[2] = (uint8_t) ((data >> 8) & 0xff); p[3] = (uint8_t) (data & 0xff); #endif } #endif /* WIRE_BUFFER_H */ opendnssec-1.4.3/signer/src/wire/sock.c0000664000175000017500000006465612226742760014763 00000000000000/* * $Id: sock.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Sockets. * */ #include "config.h" #include "daemon/engine.h" #include "shared/log.h" #include "signer/zone.h" #include "wire/axfr.h" #include "wire/netio.h" #include "wire/sock.h" #include "wire/xfrd.h" #include #include #include #include #define SOCK_TCP_BACKLOG 5 static const char* sock_str = "socket"; /** * Set udp socket to non-blocking and bind. * */ static ods_status sock_fcntl_and_bind(sock_type* sock, const char* node, const char* port, const char* stype, const char* fam) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(stype); ods_log_assert(fam); if (fcntl(sock->s, F_SETFL, O_NONBLOCK) == -1) { ods_log_error("[%s] unable to set %s/%s socket '%s:%s' to " "non-blocking: fcntl() failed (%s)", sock_str, stype, fam, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_FCNTL_NONBLOCK; } ods_log_debug("[%s] bind %s/%s socket '%s:%s'", sock_str, stype, fam, node?node:"localhost", port, strerror(errno)); if (bind(sock->s, (struct sockaddr *) sock->addr->ai_addr, sock->addr->ai_addrlen) != 0) { ods_log_error("[%s] unable to bind %s/%s socket '%s:%s': bind() " "failed (%s)", sock_str, stype, fam, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_BIND; } return ODS_STATUS_OK; } /** * Set socket to v6 only. * */ static ods_status sock_v6only(sock_type* sock, const char* node, const char* port, int on, const char* stype) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(stype); #ifdef IPV6_V6ONLY #if defined(IPPROTO_IPV6) ods_log_debug("[%s] set %s/ipv6 socket '%s:%s' v6only", sock_str, stype, node?node:"localhost", port); if (setsockopt(sock->s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { ods_log_error("[%s] unable to set %s/ipv6 socket '%s:%s' to " "ipv6-only: setsockopt() failed (%s)", sock_str, stype, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_SETSOCKOPT_V6ONLY; } #endif #endif /* IPV6_V6ONLY */ return ODS_STATUS_OK; } /** * Set tcp socket to reusable. * */ static void sock_tcp_reuseaddr(sock_type* sock, const char* node, const char* port, int on, const char* fam) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(fam); if (setsockopt(sock->s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { ods_log_error("[%s] unable to set tcp/%s socket '%s:%s' to " "reuse-addr: setsockopt() failed (%s)", sock_str, fam, node?node:"localhost", port, strerror(errno)); } return; } /** * Listen on tcp socket. * */ static ods_status sock_tcp_listen(sock_type* sock, const char* node, const char* port, const char* fam) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(fam); if (listen(sock->s, SOCK_TCP_BACKLOG) == -1) { ods_log_error("[%s] unable to listen on tcp/%s socket '%s:%s': " "listen() failed (%s)", sock_str, fam, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_LISTEN; } return ODS_STATUS_OK; } /** * Create server udp socket. * */ static ods_status sock_server_udp(sock_type* sock, const char* node, const char* port, unsigned* ip6_support) { int on = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(sock); ods_log_assert(port); #if defined(SO_REUSEADDR) || defined(IPV6_V6ONLY) on = 1; #endif *ip6_support = 1; /* socket */ ods_log_debug("[%s] create udp socket '%s:%s'", sock_str, node?node:"localhost", port, strerror(errno)); if ((sock->s = socket(sock->addr->ai_family, SOCK_DGRAM, 0))== -1) { ods_log_error("[%s] unable to create udp/ipv4 socket '%s:%s': " "socket() failed (%s)", sock_str, node?node:"localhost", port, strerror(errno)); if (sock->addr->ai_family == AF_INET6 && errno == EAFNOSUPPORT) { *ip6_support = 0; } return ODS_STATUS_SOCK_SOCKET_UDP; } /* ipv4 */ if (sock->addr->ai_family == AF_INET) { status = sock_fcntl_and_bind(sock, node, port, "udp", "ipv4"); } /* ipv6 */ else if (sock->addr->ai_family == AF_INET6) { status = sock_v6only(sock, node, port, on, "udp"); if (status != ODS_STATUS_OK) { return status; } status = sock_fcntl_and_bind(sock, node, port, "udp", "ipv6"); } return status; } /** * Create server tcp socket. * */ static ods_status sock_server_tcp(sock_type* sock, const char* node, const char* port, unsigned* ip6_support) { int on = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(sock); ods_log_assert(port); #if defined(SO_REUSEADDR) || defined(IPV6_V6ONLY) on = 1; #endif *ip6_support = 1; /* socket */ ods_log_debug("[%s] create tcp socket '%s:%s'", sock_str, node?node:"localhost", port, strerror(errno)); if ((sock->s = socket(sock->addr->ai_family, SOCK_STREAM, 0))== -1) { ods_log_error("[%s] unable to create tcp/ipv4 socket '%s:%s': " "socket() failed (%s)", sock_str, node?node:"localhost", port, strerror(errno)); if (sock->addr->ai_family == AF_INET6 && errno == EAFNOSUPPORT) { *ip6_support = 0; } return ODS_STATUS_SOCK_SOCKET_TCP; } /* ipv4 */ if (sock->addr->ai_family == AF_INET) { sock_tcp_reuseaddr(sock, node, port, on, "ipv4"); status = sock_fcntl_and_bind(sock, node, port, "tcp", "ipv4"); if (status == ODS_STATUS_OK) { status = sock_tcp_listen(sock, node, port, "ipv4"); } } /* ipv6 */ else if (sock->addr->ai_family == AF_INET6) { status = sock_v6only(sock, node, port, on, "tcp"); if (status != ODS_STATUS_OK) { return status; } sock_tcp_reuseaddr(sock, node, port, on, "ipv6"); status = sock_fcntl_and_bind(sock, node, port, "tcp", "ipv6"); if (status == ODS_STATUS_OK) { status = sock_tcp_listen(sock, node, port, "ipv6"); } } return status; } /** * Create listening socket. * */ static ods_status socket_listen(sock_type* sock, struct addrinfo hints, int socktype, const char* node, const char* port, unsigned* ip6_support) { ods_status status = ODS_STATUS_OK; int r = 0; ods_log_assert(sock); ods_log_assert(port); *ip6_support = 1; hints.ai_socktype = socktype; /* getaddrinfo */ if ((r = getaddrinfo(node, port, &hints, &sock->addr)) != 0 || !sock->addr) { ods_log_error("[%s] unable to parse address '%s:%s': getaddrinfo() " "failed (%s %s)", sock_str, node?node:"localhost", port, gai_strerror(r), #ifdef EAI_SYSTEM r==EAI_SYSTEM?(char*)strerror(errno):""); #else ""); #endif if (hints.ai_family == AF_INET6 && r==EAFNOSUPPORT) { *ip6_support = 0; } return ODS_STATUS_SOCK_GETADDRINFO; } /* socket */ if (socktype == SOCK_DGRAM) { status = sock_server_udp(sock, node, port, ip6_support); } else if (socktype == SOCK_STREAM) { status = sock_server_tcp(sock, node, port, ip6_support); } ods_log_debug("[%s] socket listening to %s:%s", sock_str, node?node:"localhost", port); return status; } /** * Create sockets and listen. * */ ods_status sock_listen(socklist_type* sockets, listener_type* listener) { ods_status status = ODS_STATUS_OK; struct addrinfo hints[MAX_INTERFACES]; const char* node = NULL; const char* port = NULL; size_t i = 0; unsigned ip6_support = 1; if (!sockets || !listener) { return ODS_STATUS_ASSERT_ERR; } /* Initialize values */ for (i = 0; i < MAX_INTERFACES; i++) { memset(&hints[i], 0, sizeof(hints[i])); hints[i].ai_family = AF_UNSPEC; hints[i].ai_flags = AI_PASSIVE; sockets->udp[i].s = -1; sockets->tcp[i].s = -1; } /* Walk interfaces */ for (i=0; i < listener->count; i++) { node = NULL; if (strlen(listener->interfaces[i].address) > 0) { node = listener->interfaces[i].address; } port = DNS_PORT_STRING; if (listener->interfaces[i].port) { port = listener->interfaces[i].port; } if (node != NULL) { hints[i].ai_flags |= AI_NUMERICHOST; } else { hints[i].ai_family = listener->interfaces[i].family; } /* udp */ status = socket_listen(&sockets->udp[i], hints[i], SOCK_DGRAM, node, port, &ip6_support); if (status != ODS_STATUS_OK) { if (!ip6_support) { ods_log_warning("[%s] fallback to udp/ipv4, no udp/ipv6: " "not supported", sock_str); status = ODS_STATUS_OK; } else { return status; } } /* tcp */ status = socket_listen(&sockets->tcp[i], hints[i], SOCK_STREAM, node, port, &ip6_support); if (status != ODS_STATUS_OK) { if (!ip6_support) { ods_log_warning("[%s] fallback to udp/ipv4, no udp/ipv6: " "not supported", sock_str); status = ODS_STATUS_OK; } else { return status; } } } /* All ok */ return ODS_STATUS_OK; } /** * Send data over udp. * */ static void send_udp(struct udp_data* data, query_type* q) { ssize_t nb; ods_log_deeebug("[%s] sending %d bytes over udp", sock_str, (int)buffer_remaining(q->buffer)); nb = sendto(data->socket->s, buffer_begin(q->buffer), buffer_remaining(q->buffer), 0, (struct sockaddr*) &q->addr, q->addrlen); if (nb == -1) { ods_log_error("[%s] unable to send data over udp: sendto() failed " "(%s)", sock_str, strerror(errno)); ods_log_debug("[%s] len=%u", sock_str, buffer_remaining(q->buffer)); } else if ((size_t) nb != buffer_remaining(q->buffer)) { ods_log_error("[%s] unable to send data over udp: only sent %d of %d " "octets", sock_str, (int)nb, (int)buffer_remaining(q->buffer)); } return; } /** * Handle incoming udp queries. * */ void sock_handle_udp(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { struct udp_data* data = (struct udp_data*) handler->user_data; int received = 0; query_type* q = data->query; query_state qstate = QUERY_PROCESSED; if (!(event_types & NETIO_EVENT_READ)) { return; } ods_log_debug("[%s] incoming udp message", sock_str); query_reset(q, UDP_MAX_MESSAGE_LEN, 0); received = recvfrom(handler->fd, buffer_begin(q->buffer), buffer_remaining(q->buffer), 0, (struct sockaddr*) &q->addr, &q->addrlen); if (received < 1) { if (errno != EAGAIN && errno != EINTR) { ods_log_error("[%s] recvfrom() failed: %s", sock_str, strerror(errno)); } return; } buffer_skip(q->buffer, received); buffer_flip(q->buffer); qstate = query_process(q, data->engine); if (qstate != QUERY_DISCARDED) { ods_log_debug("[%s] query processed qstate=%d", sock_str, qstate); query_add_optional(q, data->engine); buffer_flip(q->buffer); send_udp(data, q); } return; } /** * Cleanup tcp handler data. * */ static void cleanup_tcp_handler(netio_type* netio, netio_handler_type* handler) { struct tcp_data* data = (struct tcp_data*) handler->user_data; allocator_type* allocator = data->allocator; netio_remove_handler(netio, handler); close(handler->fd); allocator_deallocate(allocator, (void*) handler->timeout); allocator_deallocate(allocator, (void*) handler); query_cleanup(data->query); allocator_deallocate(allocator, (void*) data); allocator_cleanup(allocator); return; } /** * Handle incoming tcp connections. * */ void sock_handle_tcp_accept(netio_type* netio, netio_handler_type* handler, netio_events_type event_types) { allocator_type* allocator = NULL; struct tcp_accept_data* accept_data = (struct tcp_accept_data*) handler->user_data; int s = 0; struct tcp_data* tcp_data = NULL; netio_handler_type* tcp_handler = NULL; struct sockaddr_storage addr; socklen_t addrlen = 0; if (!(event_types & NETIO_EVENT_READ)) { return; } ods_log_debug("[%s] handle incoming tcp connection", sock_str); addrlen = sizeof(addr); s = accept(handler->fd, (struct sockaddr *) &addr, &addrlen); if (s == -1) { if (errno != EINTR && errno != EWOULDBLOCK) { ods_log_error("[%s] unable to handle incoming tcp connection: " "accept() failed (%s)", sock_str, strerror(errno)); } return; } if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) { ods_log_error("[%s] unable to handle incoming tcp connection: " "fcntl() failed: %s", sock_str, strerror(errno)); close(s); return; } /* create tcp handler data */ allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_create() failed", sock_str); close(s); return; } tcp_data = (struct tcp_data*) allocator_alloc(allocator, sizeof(struct tcp_data)); if (!tcp_data) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_alloc() data failed", sock_str); allocator_cleanup(allocator); close(s); return; } tcp_data->allocator = allocator; tcp_data->query = query_create(); if (!tcp_data->query) { ods_log_error("[%s] unable to handle incoming tcp connection: " "query_create() failed", sock_str); allocator_deallocate(allocator, (void*) tcp_data); allocator_cleanup(allocator); close(s); return; } tcp_data->engine = accept_data->engine; tcp_data->tcp_accept_handler_count = accept_data->tcp_accept_handler_count; tcp_data->tcp_accept_handlers = accept_data->tcp_accept_handlers; tcp_data->qstate = QUERY_PROCESSED; tcp_data->bytes_transmitted = 0; memcpy(&tcp_data->query->addr, &addr, addrlen); tcp_data->query->addrlen = addrlen; tcp_handler = (netio_handler_type*) allocator_alloc(allocator, sizeof(netio_handler_type)); if (!tcp_handler) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_alloc() handler failed", sock_str); query_cleanup(tcp_data->query); allocator_deallocate(allocator, (void*) tcp_data); allocator_cleanup(allocator); close(s); return; } tcp_handler->fd = s; tcp_handler->timeout = (struct timespec*) allocator_alloc(allocator, sizeof(struct timespec)); if (!tcp_handler->timeout) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_alloc() timeout failed", sock_str); allocator_deallocate(allocator, (void*) tcp_handler); query_cleanup(tcp_data->query); allocator_deallocate(allocator, (void*) tcp_data); allocator_cleanup(allocator); close(s); return; } tcp_handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; tcp_handler->timeout->tv_nsec = 0L; timespec_add(tcp_handler->timeout, netio_current_time(netio)); tcp_handler->user_data = tcp_data; tcp_handler->event_types = NETIO_EVENT_READ | NETIO_EVENT_TIMEOUT; tcp_handler->event_handler = sock_handle_tcp_read; netio_add_handler(netio, tcp_handler); return; } /** * Handle incoming tcp queries. * */ void sock_handle_tcp_read(netio_type* netio, netio_handler_type* handler, netio_events_type event_types) { struct tcp_data* data = (struct tcp_data *) handler->user_data; ssize_t received = 0; query_state qstate = QUERY_PROCESSED; if (event_types & NETIO_EVENT_TIMEOUT) { cleanup_tcp_handler(netio, handler); return; } ods_log_assert(event_types & NETIO_EVENT_READ); ods_log_debug("[%s] incoming tcp message", sock_str); if (data->bytes_transmitted == 0) { ods_log_debug("[%s] TCP_READ: reset query", sock_str); query_reset(data->query, TCP_MAX_MESSAGE_LEN, 1); } /* check if we received the leading packet length bytes yet. */ if (data->bytes_transmitted < sizeof(uint16_t)) { received = read(handler->fd, (char *) &data->query->tcplen + data->bytes_transmitted, sizeof(uint16_t) - data->bytes_transmitted); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, wait until more data is available. */ return; } else { ods_log_error("[%s] unable to handle incoming tcp query: " "read() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (received == 0) { cleanup_tcp_handler(netio, handler); return; } data->bytes_transmitted += received; ods_log_debug("[%s] TCP_READ: bytes transmitted %u (received %u)", sock_str, data->bytes_transmitted, received); if (data->bytes_transmitted < sizeof(uint16_t)) { /* not done with the tcplen yet, wait for more. */ ods_log_debug("[%s] TCP_READ: bytes transmitted %u, while ", "sizeof uint16_t %u", sock_str, data->bytes_transmitted, sizeof(uint16_t)); return; } ods_log_assert(data->bytes_transmitted == sizeof(uint16_t)); data->query->tcplen = ntohs(data->query->tcplen); /* minimum query size is: 12 + 1 + 2 + 2: * header size + root dname + qclass + qtype */ if (data->query->tcplen < 17) { ods_log_warning("[%s] unable to handle incoming tcp query: " "packet too small", sock_str); cleanup_tcp_handler(netio, handler); return; } if (data->query->tcplen > data->query->maxlen) { ods_log_warning("[%s] unable to handle incoming tcp query: " "insufficient tcp buffer", sock_str); cleanup_tcp_handler(netio, handler); return; } buffer_set_limit(data->query->buffer, data->query->tcplen); } ods_log_assert(buffer_remaining(data->query->buffer) > 0); /* read the (remaining) query data. */ received = read(handler->fd, buffer_current(data->query->buffer), buffer_remaining(data->query->buffer)); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, wait until more data is available. */ return; } else { ods_log_error("[%s] unable to handle incoming tcp query: " "read() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (received == 0) { cleanup_tcp_handler(netio, handler); return; } data->bytes_transmitted += received; ods_log_debug("[%s] TCP_READ: bytes transmitted %u (received %u)", sock_str, data->bytes_transmitted, received); buffer_skip(data->query->buffer, received); if (buffer_remaining(data->query->buffer) > 0) { /* not done with message yet, wait for more. */ ods_log_debug("[%s] TCP_READ: remaining %u", sock_str, buffer_remaining(data->query->buffer)); return; } ods_log_assert(buffer_position(data->query->buffer) == data->query->tcplen); /* we have a complete query, process it. */ buffer_flip(data->query->buffer); qstate = query_process(data->query, data->engine); if (qstate == QUERY_DISCARDED) { cleanup_tcp_handler(netio, handler); return; } ods_log_debug("[%s] query processed qstate=%d", sock_str, qstate); data->qstate = qstate; /* edns, tsig */ query_add_optional(data->query, data->engine); /* switch to tcp write handler. */ buffer_flip(data->query->buffer); data->query->tcplen = buffer_remaining(data->query->buffer); ods_log_debug("[%s] TCP_READ: new tcplen %u", sock_str, data->query->tcplen); data->bytes_transmitted = 0; handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; handler->timeout->tv_nsec = 0L; timespec_add(handler->timeout, netio_current_time(netio)); handler->event_types = NETIO_EVENT_WRITE | NETIO_EVENT_TIMEOUT; handler->event_handler = sock_handle_tcp_write; return; } /** * Handle outgoing tcp responses. * */ void sock_handle_tcp_write(netio_type* netio, netio_handler_type* handler, netio_events_type event_types) { struct tcp_data* data = (struct tcp_data *) handler->user_data; ssize_t sent = 0; query_type* q = data->query; if (event_types & NETIO_EVENT_TIMEOUT) { cleanup_tcp_handler(netio, handler); return; } ods_log_assert(event_types & NETIO_EVENT_WRITE); if (data->bytes_transmitted < sizeof(q->tcplen)) { uint16_t n_tcplen = htons(q->tcplen); sent = write(handler->fd, (const char*) &n_tcplen + data->bytes_transmitted, sizeof(n_tcplen) - data->bytes_transmitted); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, wait until socket becomes writeable. */ return; } else { ods_log_error("[%s] unable to handle outgoing tcp response: " "write() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (sent == 0) { cleanup_tcp_handler(netio, handler); return; } data->bytes_transmitted += sent; ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u (sent %u)", sock_str, data->bytes_transmitted, sent); if (data->bytes_transmitted < sizeof(q->tcplen)) { /* writing not complete, wait until socket becomes writable. */ ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u, while ", "sizeof tcplen %u", sock_str, data->bytes_transmitted, sizeof(q->tcplen)); return; } ods_log_assert(data->bytes_transmitted == sizeof(q->tcplen)); } ods_log_assert(data->bytes_transmitted < q->tcplen + sizeof(q->tcplen)); sent = write(handler->fd, buffer_current(q->buffer), buffer_remaining(q->buffer)); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, wait until socket becomes writeable. */ return; } else { ods_log_error("[%s] unable to handle outgoing tcp response: " "write() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (sent == 0) { cleanup_tcp_handler(netio, handler); return; } buffer_skip(q->buffer, sent); data->bytes_transmitted += sent; if (data->bytes_transmitted < q->tcplen + sizeof(q->tcplen)) { /* still more data to write when socket becomes writable. */ ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u, while tcplen " "%u and sizeof tcplen %u", sock_str, data->bytes_transmitted, q->tcplen, sizeof(q->tcplen)); return; } ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u", sock_str, data->bytes_transmitted); ods_log_debug("[%s] TCP_WRITE: tcplen %u", sock_str, q->tcplen); ods_log_debug("[%s] TCP_WRITE: sizeof tcplen %u", sock_str, sizeof(q->tcplen)); ods_log_assert(data->bytes_transmitted == q->tcplen + sizeof(q->tcplen)); if (data->qstate == QUERY_AXFR || data->qstate == QUERY_IXFR) { /* continue processing AXFR and writing back results. */ buffer_clear(q->buffer); if (data->qstate == QUERY_IXFR) { data->qstate = ixfr(q, data->engine); } else { data->qstate = axfr(q, data->engine, 0); } if (data->qstate != QUERY_PROCESSED) { /* edns, tsig */ query_add_optional(q, data->engine); buffer_flip(q->buffer); q->tcplen = buffer_remaining(q->buffer); data->bytes_transmitted = 0; handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; handler->timeout->tv_nsec = 0L; timespec_add(handler->timeout, netio_current_time(netio)); return; } } /* done sending, wait for the next request. */ data->bytes_transmitted = 0; handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; handler->timeout->tv_nsec = 0L; timespec_add(handler->timeout, netio_current_time(netio)); handler->event_types = NETIO_EVENT_READ | NETIO_EVENT_TIMEOUT; handler->event_handler = sock_handle_tcp_read; return; } opendnssec-1.4.3/signer/src/wire/netio.h0000664000175000017500000001442011700277426015125 00000000000000/* * $Id: netio.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2001-2011, NLnet Labs. All rights reserved. * * See LICENSE for the license. * * * The netio module implements event based I/O handling using * pselect(2). Multiple event handlers can wait for a certain event * to occur simultaneously. Each event handler is called when an * event occurs that the event handler has indicated that it is * willing to handle. * * There are four types of events that can be handled: * * NETIO_EVENT_READ: reading will not block. * NETIO_EVENT_WRITE: writing will not block. * NETIO_EVENT_EXCEPT: an exception occurred. * NETIO_EVENT_TIMEOUT: the timeout expired. * * A file descriptor must be specified if the handler is interested in * the first three event types. A timeout must be specified if the * event handler is interested in timeouts. These event types can be * OR'ed together if the handler is willing to handle multiple types * of events. * * The special event type NETIO_EVENT_NONE is available if you wish to * temporarily disable the event handler without removing and adding * the handler to the netio structure. * * The event callbacks are free to modify the netio_handler_type * structure to change the file descriptor, timeout, event types, user * data, or handler functions. * * The main loop of the program must call netio_dispatch to check for * events and dispatch them to the handlers. An additional timeout * can be specified as well as the signal mask to install while * blocked in pselect(2). */ /** * Network I/O Support. * */ #ifndef WIRE_NETIO_H_ #define WIRE_NETIO_H_ #ifdef HAVE_SYS_SELECT_H #include #endif #include #include "config.h" #include "shared/allocator.h" #ifndef PF_INET #define PF_INET AF_INET #endif #ifndef PF_INET6 #define PF_INET6 AF_INET6 #endif /* * The type of events a handler is interested in. * These can be OR'ed together to specify multiple event types. * */ enum netio_events_enum { NETIO_EVENT_NONE = 0, NETIO_EVENT_READ = 1, NETIO_EVENT_WRITE = 2, NETIO_EVENT_EXCEPT = 4, NETIO_EVENT_TIMEOUT = 8 }; typedef enum netio_events_enum netio_events_type; typedef struct netio_struct netio_type; typedef struct netio_handler_struct netio_handler_type; typedef struct netio_handler_list_struct netio_handler_list_type; /** * Network I/O event handler function. * */ typedef void (*netio_event_handler_type)(netio_type *netio, netio_handler_type* handler, netio_events_type event_types); /** * Network I/O event handler list. * */ struct netio_handler_list_struct { netio_handler_list_type* next; netio_handler_type* handler; }; /** * Network I/O event handler. * */ struct netio_handler_struct { /* * The file descriptor that should be checked for events. If * the file descriptor is negative only timeout events are * checked for. */ int fd; /* * The time when no events should be checked for and the * handler should be called with the NETIO_EVENT_TIMEOUT * event type. Unlike most timeout parameters the time should * be absolute, not relative! */ struct timespec* timeout; /* * User data. */ void* user_data; /* * The type of events that should be checked for. These types * can be OR'ed together to wait for multiple types of events. */ netio_events_type event_types; /* * The event handler. The event_types parameter contains the * OR'ed set of event types that actually triggered. The * event handler is allowed to modify this handler object. * The event handler SHOULD NOT block. */ netio_event_handler_type event_handler; }; /** * Network I/O instance. * */ struct netio_struct { allocator_type* allocator; netio_handler_list_type* handlers; netio_handler_list_type* deallocated; /* * Cached value of the current time. The cached value is * cleared at the start of netio_dispatch to calculate the * relative timeouts of the event handlers and after calling * pselect(2) so handlers can use it to calculate a new * absolute timeout. * * Use netio_current_time() to read the current time. */ int have_current_time; struct timespec cached_current_time; /* * Next handler in the dispatch. Only valid during callbacks. * To make sure that deletes respect the state of the iterator. */ netio_handler_list_type* dispatch_next; }; /* * Create a new netio instance. * \param[in] allocator memory allocator * \return netio_type* netio instance * */ netio_type* netio_create(allocator_type* allocator); /* * Add a new handler to netio. * \param[in] netio netio instance * \param[in] handler handler * */ void netio_add_handler(netio_type* netio, netio_handler_type* handler); /* * Remove the handler from netio. * \param[in] netio netio instance * \param[in] handler handler * */ void netio_remove_handler(netio_type* netio, netio_handler_type* handler); /* * Retrieve the current time (using gettimeofday(2)). * \param[in] netio netio instance * \return const struct timespec* current time * */ const struct timespec* netio_current_time(netio_type* netio); /* * Check for events and dispatch them to the handlers. * \param[in] netio netio instance * \param[in] timeout if specified, the maximum time to wait for an * event to arrive. * \param[in] sigmask is passed to the underlying pselect(2) call * \return int the number of non-timeout events dispatched, 0 on timeout, * and -1 on error (with errno set appropriately). * */ int netio_dispatch(netio_type* netio, const struct timespec* timeout, const sigset_t* sigmask); /** * Clean up netio instance * \param[in] netio netio instance * */ void netio_cleanup(netio_type* netio); /** * Add timespecs. * \param[in] left left * \param[in] right right * */ void timespec_add(struct timespec* left, const struct timespec* right); #ifdef __cplusplus inline netio_events_type operator | (netio_events_type lhs, netio_events_type rhs) { return (netio_events_type) (lhs | rhs); } inline netio_events_type operator |= (netio_events_type &lhs, netio_events_type rhs) { lhs = (netio_events_type) (lhs | rhs); return lhs; } #endif /* __cplusplus */ #endif /* WIRE_NETIO_H_ */ opendnssec-1.4.3/signer/src/wire/axfr.h0000664000175000017500000000443112226742760014752 00000000000000/* * $Id: axfr.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * AXFR. * */ #ifndef WIRE_AXFR_H #define WIRE_AXFR_H #include "config.h" #include "daemon/engine.h" #include "wire/query.h" #include /* NSD values */ #define MAX_COMPRESSION_OFFSET 16383 /* Compression pointers are 14 bit. */ #define AXFR_MAX_MESSAGE_LEN MAX_COMPRESSION_OFFSET /** * Handle SOA request. * \param[in] q soa request * \param[in] engine signer engine * \return query_state state of the query * */ query_state soa_request(query_type* q, engine_type* engine); /** * Do AXFR. * \param[in] q axfr request * \param[in] engine signer engine * \param[in] fallback fallback from ixfr? * \return query_state state of the query * */ query_state axfr(query_type* q, engine_type* engine, int fallback); /** * Do IXFR. * \param[in] q ixfr request * \param[in] engine signer engine * \return query_state state of the query * */ query_state ixfr(query_type* q, engine_type* engine); #endif /* WIRE_AXFR_H */ opendnssec-1.4.3/signer/src/wire/tsig.c0000664000175000017500000006160712061343046014752 00000000000000/* * $Id: tsig.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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, 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 ``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 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. * */ /** * TSIG. * */ #include "config.h" #include "compat.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "wire/buffer.h" #include "wire/tsig.h" #include "wire/tsig-openssl.h" #include #define TSIG_SIGNED_TIME_FUDGE 300 static const char* tsig_str = "tsig"; /** allocator */ static allocator_type* tsig_allocator = NULL; /** key table */ typedef struct tsig_key_table_struct tsig_key_table_type; struct tsig_key_table_struct { tsig_key_table_type* next; tsig_key_type* key; }; static tsig_key_table_type* tsig_key_table = NULL; /** algorithm table */ typedef struct tsig_algo_table_struct tsig_algo_table_type; struct tsig_algo_table_struct { tsig_algo_table_type* next; tsig_algo_type* algorithm; }; static tsig_algo_table_type* tsig_algo_table = NULL; /** maximum algorithm digest size */ static size_t max_algo_digest_size = 0; /** lookup algorithm table */ tsig_lookup_table tsig_supported_algorithms[] = { { TSIG_HMAC_MD5, "hmac-md5" }, #ifdef HAVE_EVP_SHA1 { TSIG_HMAC_SHA1, "hmac-sha1" }, #endif #ifdef HAVE_EVP_SHA256 { TSIG_HMAC_SHA256, "hmac-sha256" }, #endif { 0, NULL } }; /** * Add key to TSIG handler. * */ void tsig_handler_add_key(tsig_key_type* key) { tsig_key_table_type* entry = NULL; if (!key) { return; } entry = (tsig_key_table_type *) allocator_alloc(tsig_allocator, sizeof(tsig_key_table_type)); if (entry) { entry->key = key; entry->next = tsig_key_table; tsig_key_table = entry; } return; } /** * Add algorithm to TSIG handler. * */ void tsig_handler_add_algo(tsig_algo_type* algo) { tsig_algo_table_type* entry = NULL; if (!algo) { return; } entry = (tsig_algo_table_type *) allocator_alloc(tsig_allocator, sizeof(tsig_algo_table_type)); if (entry) { entry->algorithm = algo; entry->next = tsig_algo_table; tsig_algo_table = entry; if (algo->max_digest_size > max_algo_digest_size) { max_algo_digest_size = algo->max_digest_size; } } return; } /** * Initialize TSIG handler. * */ ods_status tsig_handler_init(allocator_type* allocator) { if (!allocator) { return ODS_STATUS_ERR; } tsig_allocator = allocator; tsig_key_table = NULL; tsig_algo_table = NULL; #ifdef HAVE_SSL ods_log_debug("[%s] init openssl", tsig_str); return tsig_handler_openssl_init(allocator); #endif ods_log_debug("[%s] openssl disabled", tsig_str); return ODS_STATUS_OK; } /** * Clean up TSIG handler. * */ void tsig_handler_cleanup(void) { tsig_algo_table_type* aentry = NULL, *anext = NULL; tsig_key_table_type* kentry = NULL, *knext = NULL; #ifdef HAVE_SSL tsig_handler_openssl_finalize(); #endif aentry = tsig_algo_table; while (aentry) { anext = aentry->next; ldns_rdf_deep_free(aentry->algorithm->wf_name); allocator_deallocate(tsig_allocator, (void*)aentry->algorithm); allocator_deallocate(tsig_allocator, (void*)aentry); aentry = anext; } kentry = tsig_key_table; while (kentry) { knext = kentry->next; ldns_rdf_deep_free(kentry->key->dname); allocator_deallocate(tsig_allocator, (void*)kentry->key->data); allocator_deallocate(tsig_allocator, (void*)kentry->key); allocator_deallocate(tsig_allocator, (void*)kentry); kentry = knext; } return; } /** * Create new TSIG key. * */ tsig_key_type* tsig_key_create(allocator_type* allocator, tsig_type* tsig) { tsig_key_type* key = NULL; ldns_rdf* dname = NULL; uint8_t* data = NULL; int size = 0; if (!allocator || !tsig || !tsig->name || !tsig->secret) { return NULL; } key = (tsig_key_type*) allocator_alloc(allocator, sizeof(tsig_key_type)); if (!key) { return NULL; } dname = ldns_dname_new_frm_str(tsig->name); if (!dname) { return NULL; } data = allocator_alloc(allocator, sizeof(uint8_t) * util_b64_pton_calculate_size(strlen(tsig->secret))); if (!data) { ldns_rdf_deep_free(dname); return NULL; } size = b64_pton(tsig->secret, data, util_b64_pton_calculate_size(strlen(tsig->secret))); if (size < 0) { ods_log_error("[%s] unable to create tsig key %s: failed to parse " "secret", tsig_str, tsig->name); ldns_rdf_deep_free(dname); allocator_deallocate(allocator, (void*)data); } key->dname = dname; key->size = size; key->data = data; tsig_handler_add_key(key); return key; } /** * Create new TSIG. * */ tsig_type* tsig_create(allocator_type* allocator, char* name, char* algo, char* secret) { tsig_type* tsig = NULL; if (!allocator || !name || !algo || !secret) { return NULL; } tsig = (tsig_type*) allocator_alloc(allocator, sizeof(tsig_type)); if (!tsig) { ods_log_error("[%s] unable to create tsig: allocator_alloc() " "failed", tsig_str); return NULL; } tsig->next = NULL; tsig->name = allocator_strdup(allocator, name); tsig->algorithm = allocator_strdup(allocator, algo); tsig->secret = allocator_strdup(allocator, secret); tsig->key = tsig_key_create(allocator, tsig); if (!tsig->key) { ods_log_error("[%s] unable to create tsig: tsig_key_create() " "failed", tsig_str); tsig_cleanup(tsig, allocator); return NULL; } return tsig; } /** * Lookup TSIG by key name. * */ tsig_type* tsig_lookup_by_name(tsig_type* tsig, const char* name) { tsig_type* find = NULL; if (!tsig || !name) { return NULL; } find = tsig; while (find) { if (ods_strlowercmp(find->name, name) == 0) { return find; } find = find->next; } return NULL; } /** * Lookup TSIG algorithm by name. * */ tsig_algo_type* tsig_lookup_algo(const char* name) { tsig_algo_table_type* entry = NULL; for (entry = tsig_algo_table; entry; entry = entry->next) { if (ods_strlowercmp(name, entry->algorithm->txt_name) == 0) { return entry->algorithm; } } return NULL; } /** * Create new TSIG RR. * */ tsig_rr_type* tsig_rr_create(allocator_type* allocator) { tsig_rr_type* trr = NULL; if (!allocator) { return NULL; } trr = (tsig_rr_type*) allocator_alloc(allocator, sizeof(tsig_rr_type)); if (!trr) { ods_log_error("[%s] unable to create tsig rr: allocator_alloc() " "failed", tsig_str); return NULL; } trr->allocator = allocator; trr->key_name = NULL; trr->algo_name = NULL; trr->mac_data = NULL; trr->other_data = NULL; tsig_rr_reset(trr, NULL, NULL); return trr; } /** * Reset TSIG RR. * */ void tsig_rr_reset(tsig_rr_type* trr, tsig_algo_type* algo, tsig_key_type* key) { if (!trr) { return; } tsig_rr_free(trr); trr->status = TSIG_NOT_PRESENT; trr->position = 0; trr->response_count = 0; trr->update_since_last_prepare = 0; trr->context = NULL; trr->algo = algo; trr->key = key; trr->prior_mac_size = 0; trr->prior_mac_data = NULL; trr->signed_time_high = 0; trr->signed_time_low = 0; trr->signed_time_fudge = 0; trr->mac_size = 0; trr->original_query_id = 0; trr->error_code = LDNS_RCODE_NOERROR; trr->other_size = 0; return; } /** * Parse TSIG RR. * */ int tsig_rr_parse(tsig_rr_type* trr, buffer_type* buffer) { uint16_t dname_len = 0; ldns_rr_type type = 0; ldns_rr_class klass = 0; uint32_t ttl = 0; uint16_t rdlen = 0; uint16_t curpos = 0; ods_log_assert(trr); ods_log_assert(trr->allocator); ods_log_assert(buffer); trr->status = TSIG_NOT_PRESENT; trr->position = buffer_position(buffer); curpos = trr->position; if (!buffer_skip_dname(buffer)) { buffer_set_position(buffer, trr->position); ods_log_debug("[%s] parse: skip key name failed", tsig_str); return 0; } dname_len = buffer_position(buffer) - curpos; buffer_set_position(buffer, curpos); trr->key_name = ldns_dname_new_frm_data(dname_len, (const void*) buffer_current(buffer)); if (!trr->key_name) { buffer_set_position(buffer, trr->position); ods_log_debug("[%s] parse: read key name failed", tsig_str); return 0; } buffer_set_position(buffer, curpos + dname_len); if (!buffer_available(buffer, 10)) { ods_log_debug("[%s] parse: not enough available", tsig_str); buffer_set_position(buffer, trr->position); return 0; } type = (ldns_rr_type) buffer_read_u16(buffer); klass = (ldns_rr_class) buffer_read_u16(buffer); if (type != LDNS_RR_TYPE_TSIG || klass != LDNS_RR_CLASS_ANY) { /* not present */ ods_log_debug("[%s] parse: not TSIG or not ANY", tsig_str, klass, type); buffer_set_position(buffer, trr->position); return 1; } ttl = buffer_read_u32(buffer); rdlen = buffer_read_u16(buffer); /* default to error */ trr->status = TSIG_ERROR; trr->error_code = LDNS_RCODE_FORMERR; if (ttl || !buffer_available(buffer, rdlen)) { ods_log_debug("[%s] parse: TTL!=0 or RDLEN=0", tsig_str); buffer_set_position(buffer, trr->position); return 0; } curpos = buffer_position(buffer); if (!buffer_skip_dname(buffer)) { ods_log_debug("[%s] parse: skip algo name failed", tsig_str); buffer_set_position(buffer, trr->position); return 0; } dname_len = buffer_position(buffer) - curpos; buffer_set_position(buffer, curpos); trr->algo_name = ldns_dname_new_frm_data(dname_len, (const void*) buffer_current(buffer)); if (!trr->algo_name) { ods_log_debug("[%s] parse: read algo name failed", tsig_str); buffer_set_position(buffer, trr->position); return 0; } buffer_set_position(buffer, curpos + dname_len); if (!buffer_available(buffer, 10)) { ods_log_debug("[%s] parse: not enough available", tsig_str); buffer_set_position(buffer, trr->position); return 0; } trr->signed_time_high = buffer_read_u16(buffer); trr->signed_time_low = buffer_read_u32(buffer); trr->signed_time_fudge = buffer_read_u16(buffer); trr->mac_size = buffer_read_u16(buffer); if (!buffer_available(buffer, trr->mac_size)) { ods_log_debug("[%s] parse: wrong mac size", tsig_str); buffer_set_position(buffer, trr->position); trr->mac_size = 0; return 0; } trr->mac_data = (uint8_t *) allocator_alloc_init(trr->allocator, trr->mac_size, (const void*) buffer_current(buffer)); buffer_skip(buffer, trr->mac_size); if (!buffer_available(buffer, 6)) { ods_log_debug("[%s] parse: not enough available", tsig_str); buffer_set_position(buffer, trr->position); return 0; } trr->original_query_id = buffer_read_u16(buffer); trr->error_code = buffer_read_u16(buffer); trr->other_size = buffer_read_u16(buffer); if (!buffer_available(buffer, trr->other_size) || trr->other_size > 16) { ods_log_debug("[%s] parse: not enough available", tsig_str); trr->other_size = 0; buffer_set_position(buffer, trr->position); return 0; } trr->other_data = (uint8_t *) allocator_alloc_init(trr->allocator, trr->other_size, (const void*) buffer_current(buffer)); buffer_skip(buffer, trr->other_size); trr->status = TSIG_OK; return 1; } /** * Find TSIG RR. * */ int tsig_rr_find(tsig_rr_type* trr, buffer_type* buffer) { size_t saved_pos = 0; size_t rrcount = 0; size_t i = 0; int result = 0; ods_log_assert(trr); ods_log_assert(buffer); if (buffer_pkt_arcount(buffer) == 0) { trr->status = TSIG_NOT_PRESENT; return 1; } saved_pos = buffer_position(buffer); rrcount = buffer_pkt_qdcount(buffer) + buffer_pkt_ancount(buffer) + buffer_pkt_nscount(buffer) + buffer_pkt_arcount(buffer); buffer_set_position(buffer, BUFFER_PKT_HEADER_SIZE); for (i=0; i < rrcount - 1; i++) { if (!buffer_skip_rr(buffer, i < buffer_pkt_qdcount(buffer))) { buffer_set_position(buffer, saved_pos); return 0; } } result = tsig_rr_parse(trr, buffer); buffer_set_position(buffer, saved_pos); return result; } /** * Lookup TSIG RR. * */ int tsig_rr_lookup(tsig_rr_type* trr) { tsig_key_table_type* kentry = NULL; tsig_key_type* key = NULL; tsig_algo_table_type* aentry = NULL; tsig_algo_type* algorithm = NULL; uint64_t current_time = 0; uint64_t signed_time = 0; ods_log_assert(trr); ods_log_assert(trr->status == TSIG_OK); ods_log_assert(!trr->algo); ods_log_assert(!trr->key); for (kentry = tsig_key_table; kentry; kentry = kentry->next) { if (ldns_dname_compare(trr->key_name, kentry->key->dname) == 0) { key = kentry->key; break; } } for (aentry = tsig_algo_table; aentry; aentry = aentry->next) { if (ldns_dname_compare(trr->algo_name, aentry->algorithm->wf_name) == 0) { algorithm = aentry->algorithm; break; } } if (!key || !algorithm) { /* algorithm or key is unknown, cannot authenticate. */ ods_log_debug("[%s] algorithm or key missing", tsig_str); trr->error_code = TSIG_ERROR_BADKEY; return 0; } if ((trr->algo && algorithm != trr->algo) || (trr->key && key != trr->key)) { /* algorithm or key changed during a single connection, error. */ ods_log_debug("[%s] algorithm or key has changed", tsig_str); trr->error_code = TSIG_ERROR_BADKEY; return 0; } signed_time = ((((uint64_t) trr->signed_time_high) << 32) | ((uint64_t) trr->signed_time_low)); current_time = (uint64_t) time_now(); if ((current_time < signed_time - trr->signed_time_fudge) || (current_time > signed_time + trr->signed_time_fudge)) { uint16_t current_time_high; uint32_t current_time_low; trr->error_code = TSIG_ERROR_BADTIME; current_time_high = (uint16_t) (current_time >> 32); current_time_low = (uint32_t) current_time; trr->other_size = 6; trr->other_data = (uint8_t *) allocator_alloc(trr->allocator, sizeof(uint16_t) + sizeof(uint32_t)); write_uint16(trr->other_data, current_time_high); write_uint32(trr->other_data + 2, current_time_low); ods_log_debug("[%s] bad time", tsig_str); return 0; } trr->algo = algorithm; trr->key = key; trr->response_count = 0; trr->prior_mac_size = 0; return 1; } /** * Prepare TSIG RR. * */ void tsig_rr_prepare(tsig_rr_type* trr) { ods_log_assert(trr->algo); ods_log_assert(trr->allocator); if (!trr->context) { trr->context = trr->algo->hmac_create(trr->allocator); trr->prior_mac_data = (uint8_t *) allocator_alloc( trr->allocator, trr->algo->max_digest_size); } trr->algo->hmac_init(trr->context, trr->algo, trr->key); if (trr->prior_mac_size > 0) { uint16_t mac_size = htons(trr->prior_mac_size); trr->algo->hmac_update(trr->context, &mac_size, sizeof(mac_size)); trr->algo->hmac_update(trr->context, trr->prior_mac_data, trr->prior_mac_size); } trr->update_since_last_prepare = 0; return; } /** * Update TSIG RR. * */ void tsig_rr_update(tsig_rr_type* trr, buffer_type* buffer, size_t length) { uint16_t original_query_id = 0; ods_log_assert(trr); ods_log_assert(trr->algo); ods_log_assert(trr->context); ods_log_assert(buffer); ods_log_assert(length <= buffer_limit(buffer)); original_query_id = htons(trr->original_query_id); trr->algo->hmac_update(trr->context, &original_query_id, sizeof(original_query_id)); trr->algo->hmac_update(trr->context, buffer_at(buffer, sizeof(original_query_id)), length - sizeof(original_query_id)); if (buffer_pkt_qr(buffer)) { ++trr->response_count; } ++trr->update_since_last_prepare; return; } /** * Digest variables. * */ static void tsig_rr_digest_variables(tsig_rr_type* trr, int tsig_timers_only) { uint16_t klass = htons(LDNS_RR_CLASS_ANY); uint32_t ttl = htonl(0); uint16_t signed_time_high = htons(trr->signed_time_high); uint32_t signed_time_low = htonl(trr->signed_time_low); uint16_t signed_time_fudge = htons(trr->signed_time_fudge); uint16_t error_code = htons(trr->error_code); uint16_t other_size = htons(trr->other_size); ods_log_assert(trr->context); ods_log_assert(trr->algo); ods_log_assert(trr->key_name); if (!tsig_timers_only) { ods_log_assert(trr->key_name); ods_log_assert(trr->algo_name); trr->algo->hmac_update(trr->context, ldns_rdf_data(trr->key_name), ldns_rdf_size(trr->key_name)); trr->algo->hmac_update(trr->context, &klass, sizeof(klass)); trr->algo->hmac_update(trr->context, &ttl, sizeof(ttl)); trr->algo->hmac_update(trr->context, ldns_rdf_data(trr->algo_name), ldns_rdf_size(trr->algo_name)); } trr->algo->hmac_update(trr->context, &signed_time_high, sizeof(signed_time_high)); trr->algo->hmac_update(trr->context, &signed_time_low, sizeof(signed_time_low)); trr->algo->hmac_update(trr->context, &signed_time_fudge, sizeof(signed_time_fudge)); if (!tsig_timers_only) { trr->algo->hmac_update(trr->context, &error_code, sizeof(error_code)); trr->algo->hmac_update(trr->context, &other_size, sizeof(other_size)); trr->algo->hmac_update(trr->context, trr->other_data, trr->other_size); } return; } /** * Sign TSIG RR. * */ void tsig_rr_sign(tsig_rr_type* trr) { uint64_t current_time = (uint64_t) time_now(); ods_log_assert(trr); ods_log_assert(trr->context); trr->signed_time_high = (uint16_t) (current_time >> 32); trr->signed_time_low = (uint32_t) current_time; trr->signed_time_fudge = TSIG_SIGNED_TIME_FUDGE; tsig_rr_digest_variables(trr, trr->response_count > 1); trr->algo->hmac_final(trr->context, trr->prior_mac_data, &trr->prior_mac_size); trr->mac_size = trr->prior_mac_size; trr->mac_data = trr->prior_mac_data; return; } /** * Verify TSIG RR. * */ int tsig_rr_verify(tsig_rr_type* trr) { ods_log_assert(trr); ods_log_assert(trr->algo); tsig_rr_digest_variables(trr, trr->response_count > 1); trr->algo->hmac_final(trr->context, trr->prior_mac_data, &trr->prior_mac_size); if (trr->mac_size != trr->prior_mac_size || memcmp(trr->mac_data, trr->prior_mac_data, trr->mac_size) != 0) { /* digest is incorrect, cannot authenticate. */ trr->error_code = TSIG_ERROR_BADSIG; return 0; } return 1; } /** * Append TSIG RR. * */ void tsig_rr_append(tsig_rr_type* trr, buffer_type* buffer) { size_t rdlength_pos = 0; if (!trr || !buffer) { return; } /* [TODO] key name compression? */ if (trr->key_name) { buffer_write_rdf(buffer, trr->key_name); } else { buffer_write_u8(buffer, 0); } buffer_write_u16(buffer, (uint16_t)LDNS_RR_TYPE_TSIG); buffer_write_u16(buffer, (uint16_t)LDNS_RR_CLASS_ANY); buffer_write_u32(buffer, 0); /* TTL */ rdlength_pos = buffer_position(buffer); buffer_skip(buffer, sizeof(uint16_t)); if (trr->algo_name) { buffer_write_rdf(buffer, trr->algo_name); } else { buffer_write_u8(buffer, 0); } buffer_write_u16(buffer, trr->signed_time_high); buffer_write_u32(buffer, trr->signed_time_low); buffer_write_u16(buffer, trr->signed_time_fudge); buffer_write_u16(buffer, trr->mac_size); buffer_write(buffer, trr->mac_data, trr->mac_size); buffer_write_u16(buffer, trr->original_query_id); buffer_write_u16(buffer, trr->error_code); buffer_write_u16(buffer, trr->other_size); buffer_write(buffer, trr->other_data, trr->other_size); buffer_write_u16_at(buffer, rdlength_pos, buffer_position(buffer) - rdlength_pos - sizeof(uint16_t)); return; } /* * The amount of space to reserve in the response for the TSIG data. * */ size_t tsig_rr_reserved_space(tsig_rr_type* trr) { if (!trr || trr->status == TSIG_NOT_PRESENT) { return 0; } return ( (trr->key_name?ldns_rdf_size(trr->key_name):1) + sizeof(uint16_t) /* Type */ + sizeof(uint16_t) /* Class */ + sizeof(uint32_t) /* TTL */ + sizeof(uint16_t) /* RDATA length */ + (trr->algo_name?ldns_rdf_size(trr->algo_name):1) + sizeof(uint16_t) /* Signed time (high) */ + sizeof(uint32_t) /* Signed time (low) */ + sizeof(uint16_t) /* Signed time fudge */ + sizeof(uint16_t) /* MAC size */ + max_algo_digest_size /* MAC data */ + sizeof(uint16_t) /* Original query ID */ + sizeof(uint16_t) /* Error code */ + sizeof(uint16_t) /* Other size */ + trr->other_size); /* Other data */ } /** * Reply with error TSIG RR. * */ void tsig_rr_error(tsig_rr_type* trr) { if (!trr) { return; } if (trr->mac_data) { memset(trr->mac_data, 0, trr->mac_size); } trr->mac_size = 0; return; } /** * Print TSIG status. * */ const char* tsig_status2str(tsig_status status) { switch (status) { case TSIG_NOT_PRESENT: return "NOT PRESENT"; case TSIG_OK: return "OK"; case TSIG_ERROR: return "ERROR"; } return "UNKNOWN"; } /** * Get human readable TSIG error code. * */ const char* tsig_strerror(uint16_t error) { static char message[1000]; switch (error) { case 0: return "No Error"; break; case TSIG_ERROR_BADSIG: return "Bad Signature"; break; case TSIG_ERROR_BADKEY: return "Bad Key"; break; case TSIG_ERROR_BADTIME: return "Bad Time"; break; default: if (error < 16) { /* DNS rcodes */ return (const char*) ldns_pkt_rcode2str(error); } snprintf(message, sizeof(message), "Unknown Error %d", error); break; } return message; } /** * Free TSIG RR. * */ void tsig_rr_free(tsig_rr_type* trr) { if (!trr || !trr->allocator) { return; } ldns_rdf_deep_free(trr->key_name); ldns_rdf_deep_free(trr->algo_name); allocator_deallocate(trr->allocator, (void*) trr->mac_data); allocator_deallocate(trr->allocator, (void*) trr->other_data); trr->key_name = NULL; trr->algo_name = NULL; trr->mac_data = NULL; trr->other_data = NULL; return; } /** * Cleanup TSIG RR. * */ void tsig_rr_cleanup(tsig_rr_type* trr) { allocator_type* allocator = NULL; if (!trr || !trr->allocator) { return; } tsig_rr_free(trr); allocator = trr->allocator; allocator_deallocate(allocator, (void*) trr); return; } /** * Clean up TSIG. * */ void tsig_cleanup(tsig_type* tsig, allocator_type* allocator) { if (!tsig || !allocator) { return; } tsig_cleanup(tsig->next, allocator); allocator_deallocate(allocator, (void*) tsig->name); allocator_deallocate(allocator, (void*) tsig->algorithm); allocator_deallocate(allocator, (void*) tsig->secret); allocator_deallocate(allocator, (void*) tsig); return; } opendnssec-1.4.3/signer/src/wire/notify.h0000664000175000017500000000525011665406617015326 00000000000000/* * $Id: notify.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Notify sending. * */ #ifndef WIRE_NOTIFY_H #define WIRE_NOTIFY_H #include "config.h" #include "shared/allocator.h" #include "wire/acl.h" #include "wire/buffer.h" #include "wire/netio.h" #include "wire/tsig.h" #include #define NOTIFY_MAX_UDP 50 #define NOTIFY_MAX_RETRY 5 #define NOTIFY_RETRY_TIMEOUT 15 /** * Notify. * */ typedef struct notify_struct notify_type; struct notify_struct { notify_type* waiting_next; allocator_type* allocator; ldns_rr* soa; tsig_rr_type* tsig_rr; acl_type* secondary; void* zone; void* xfrhandler; netio_handler_type handler; struct timespec timeout; uint16_t query_id; uint8_t retry; unsigned is_waiting : 1; }; /** * Create notify structure. * \param[in] xfrhandler zone transfer handler * \param[in] zone zone reference * \return notify_type* notify structure. * */ notify_type* notify_create(void* xfrhandler, void* zone); /** * Enable notify. * \param[in] notify notify structure * \param[in] soa current soa * */ void notify_enable(notify_type* notify, ldns_rr* soa); /** * Send notify. * \param[in] notify notify structure * */ void notify_send(notify_type* notify); /** * Cleanup notify structure. * \param[in] notify notify structure. * */ void notify_cleanup(notify_type* notify); #endif /* WIRE_NOTIFY_H */ opendnssec-1.4.3/signer/src/wire/xfrd.c0000664000175000017500000015676412167255023014764 00000000000000/* * $Id: xfrd.c 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone transfers. * */ #include "config.h" #include "daemon/engine.h" #include "daemon/xfrhandler.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/domain.h" #include "signer/zone.h" #include "wire/tcpset.h" #include "wire/xfrd.h" #include #include #define XFRD_TSIG_MAX_UNSIGNED 100 static const char* xfrd_str = "xfrd"; static void xfrd_handle_zone(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); static void xfrd_make_request(xfrd_type* xfrd); static socklen_t xfrd_acl_sockaddr(acl_type* acl, unsigned int port, struct sockaddr_storage *sck); static void xfrd_write_soa(xfrd_type* xfrd, buffer_type* buffer); static int xfrd_parse_soa(xfrd_type* xfrd, buffer_type* buffer, unsigned rdata_only, unsigned update, uint32_t t, uint32_t* serial); static ods_status xfrd_parse_rrs(xfrd_type* xfrd, buffer_type* buffer, uint16_t count, int* done); static xfrd_pkt_status xfrd_parse_packet(xfrd_type* xfrd, buffer_type* buffer); static xfrd_pkt_status xfrd_handle_packet(xfrd_type* xfrd, buffer_type* buffer); static void xfrd_tcp_obtain(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_read(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_release(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_write(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_xfr(xfrd_type* xfrd, tcp_set_type* set); static int xfrd_tcp_open(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_udp_obtain(xfrd_type* xfrd); static void xfrd_udp_read(xfrd_type* xfrd); static void xfrd_udp_release(xfrd_type* xfrd); static int xfrd_udp_read_packet(xfrd_type* xfrd); static int xfrd_udp_send(xfrd_type* xfrd, buffer_type* buffer); static int xfrd_udp_send_request_ixfr(xfrd_type* xfrd); static time_t xfrd_time(xfrd_type* xfrd); static void xfrd_set_timer(xfrd_type* xfrd, time_t t); static void xfrd_set_timer_time(xfrd_type* xfrd, time_t t); static void xfrd_unset_timer(xfrd_type* xfrd); /** * Create zone transfer structure. * */ xfrd_type* xfrd_create(void* xfrhandler, void* zone) { xfrd_type* xfrd = NULL; allocator_type* allocator = NULL; if (!xfrhandler || !zone) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create zone xfr structure: " "allocator_create() failed", xfrd_str); return NULL; } xfrd = (xfrd_type*) allocator_alloc(allocator, sizeof(xfrd_type)); if (!xfrd) { ods_log_error("[%s] unable to create zone xfr structure: " " allocator_alloc() failed", xfrd_str); allocator_cleanup(allocator); return NULL; } lock_basic_init(&xfrd->serial_lock); lock_basic_init(&xfrd->rw_lock); xfrd->allocator = allocator; xfrd->xfrhandler = xfrhandler; xfrd->zone = zone; xfrd->tcp_conn = -1; xfrd->round_num = -1; xfrd->master_num = 0; xfrd->next_master = -1; xfrd->master = NULL; lock_basic_lock(&xfrd->serial_lock); xfrd->serial_xfr = 0; xfrd->serial_disk = 0; xfrd->serial_notify = 0; xfrd->serial_xfr_acquired = 0; xfrd->serial_disk_acquired = 0; xfrd->serial_notify_acquired = 0; lock_basic_unlock(&xfrd->serial_lock); xfrd->query_id = 0; xfrd->msg_seq_nr = 0; xfrd->msg_rr_count = 0; xfrd->msg_old_serial = 0; xfrd->msg_new_serial = 0; xfrd->msg_is_ixfr = 0; xfrd->udp_waiting = 0; xfrd->udp_waiting_next = NULL; xfrd->tcp_waiting = 0; xfrd->tcp_waiting_next = NULL; xfrd->tsig_rr = tsig_rr_create(allocator); if (!xfrd->tsig_rr) { xfrd_cleanup(xfrd); return NULL; } xfrd->soa.ttl = 0; xfrd->soa.mname[0] = 1; xfrd->soa.rname[0] = 1; xfrd->soa.serial = 0; xfrd->soa.refresh = 3600; xfrd->soa.retry = 300; xfrd->soa.expire = 604800; xfrd->soa.minimum = 3600; xfrd->handler.fd = -1; xfrd->handler.user_data = (void*) xfrd; xfrd->handler.timeout = 0; xfrd->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; xfrd->handler.event_handler = xfrd_handle_zone; xfrd_set_timer_time(xfrd, 0); return xfrd; } /** * Get time. * */ static time_t xfrd_time(xfrd_type* xfrd) { ods_log_assert(xfrd); ods_log_assert(xfrd->xfrhandler); return xfrhandler_time((xfrhandler_type*) xfrd->xfrhandler); } /** * Set timer. * */ static void xfrd_set_timer(xfrd_type* xfrd, time_t t) { if (!xfrd || !xfrd->xfrhandler) { return; } /** * Randomize the time, within 90%-100% of original. * Not later so zones cannot expire too late. */ if(t > xfrd_time(xfrd) + 10) { time_t extra = t - xfrd_time(xfrd); time_t base = extra*9/10; t = xfrd_time(xfrd) + base + random()%(extra-base); } xfrd->handler.timeout = &xfrd->timeout; xfrd->timeout.tv_sec = t; xfrd->timeout.tv_nsec = 0; return; } /** * Unset timer. * */ static void xfrd_unset_timer(xfrd_type* xfrd) { ods_log_assert(xfrd); xfrd->handler.timeout = NULL; return; } /** * Set timer timeout to time. * */ static void xfrd_set_timer_time(xfrd_type* xfrd, time_t t) { ods_log_assert(xfrd); xfrd_set_timer(xfrd, xfrd_time(xfrd) + t); return; } /** * Set timeout for zone transfer to now. * */ void xfrd_set_timer_now(xfrd_type* xfrd) { zone_type* zone = NULL; if (!xfrd || !xfrd->zone || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s sets timer timeout now", xfrd_str, zone->name); xfrd_set_timer_time(xfrd, 0); return; } /** * Set timeout for zone transfer to RETRY. * */ void xfrd_set_timer_retry(xfrd_type* xfrd) { zone_type* zone = NULL; if (!xfrd || !xfrd->zone || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s sets timer timeout retry %u", xfrd_str, zone->name, (unsigned) xfrd->soa.retry); xfrd_set_timer_time(xfrd, xfrd->soa.retry); return; } /** * Set timeout for zone transfer to REFRESH. * */ void xfrd_set_timer_refresh(xfrd_type* xfrd) { zone_type* zone = NULL; if (!xfrd || !xfrd->zone || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s sets timer timeout refresh %u", xfrd_str, zone->name, (unsigned) xfrd->soa.refresh); xfrd_set_timer_time(xfrd, xfrd->soa.refresh); return; } /** * Use acl address to setup sockaddr struct. * */ static socklen_t xfrd_acl_sockaddr(acl_type* acl, unsigned int port, struct sockaddr_storage *sck) { ods_log_assert(acl); ods_log_assert(sck); ods_log_assert(port); memset(sck, 0, sizeof(struct sockaddr_storage)); if (acl->family == AF_INET6) { struct sockaddr_in6* sa = (struct sockaddr_in6*)sck; sa->sin6_family = AF_INET6; sa->sin6_port = htons(port); sa->sin6_addr = acl->addr.addr6; return sizeof(struct sockaddr_in6); } else { struct sockaddr_in* sa = (struct sockaddr_in*)sck; sa->sin_family = AF_INET; sa->sin_port = htons(port); sa->sin_addr = acl->addr.addr; return sizeof(struct sockaddr_in); } return 0; } /** * Use acl address to setup remote sockaddr struct. * */ socklen_t xfrd_acl_sockaddr_to(acl_type* acl, struct sockaddr_storage *to) { unsigned int port = 0; if (!acl || !to) { return 0; } port = acl->port ? acl->port : (unsigned) atoi(DNS_PORT_STRING); return xfrd_acl_sockaddr(acl, port, to); } /** * Sign transfer request. * */ static void xfrd_tsig_sign(xfrd_type* xfrd, buffer_type* buffer) { tsig_algo_type* algo = NULL; if (!xfrd || !xfrd->tsig_rr || !xfrd->master || !xfrd->master->tsig || !xfrd->master->tsig->key || !buffer) { return; /* no tsig configured */ } algo = tsig_lookup_algo(xfrd->master->tsig->algorithm); if (!algo) { ods_log_error("[%s] unable to sign request: tsig unknown algorithm " "%s", xfrd_str, xfrd->master->tsig->algorithm); return; } ods_log_assert(algo); tsig_rr_reset(xfrd->tsig_rr, algo, xfrd->master->tsig->key); xfrd->tsig_rr->original_query_id = buffer_pkt_id(buffer); xfrd->tsig_rr->algo_name = ldns_rdf_clone(xfrd->tsig_rr->algo->wf_name); xfrd->tsig_rr->key_name = ldns_rdf_clone(xfrd->tsig_rr->key->dname); log_dname(xfrd->tsig_rr->key_name, "tsig sign query with key", LOG_DEBUG); log_dname(xfrd->tsig_rr->algo_name, "tsig sign query with algorithm", LOG_DEBUG); tsig_rr_prepare(xfrd->tsig_rr); tsig_rr_update(xfrd->tsig_rr, buffer, buffer_position(buffer)); tsig_rr_sign(xfrd->tsig_rr); ods_log_debug("[%s] tsig append rr to request id=%u", xfrd_str, buffer_pkt_id(buffer)); tsig_rr_append(xfrd->tsig_rr, buffer); buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1); tsig_rr_prepare(xfrd->tsig_rr); return; } /** * Process TSIG in transfer. * */ static int xfrd_tsig_process(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; int have_tsig = 0; if (!xfrd || !xfrd->tsig_rr || !xfrd->master || !xfrd->master->tsig || !xfrd->master->tsig->key || !buffer) { return 1; /* no tsig configured */ } zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(xfrd->master->address); if (!tsig_rr_find(xfrd->tsig_rr, buffer)) { ods_log_error("[%s] unable to process tsig: xfr zone %s from %s " "has malformed tsig rr", xfrd_str, zone->name, xfrd->master->address); return 0; } if (xfrd->tsig_rr->status == TSIG_OK) { have_tsig = 1; if (xfrd->tsig_rr->error_code != LDNS_RCODE_NOERROR) { ods_log_error("[%s] zone %s, from %s has tsig error (%s)", xfrd_str, zone->name, xfrd->master->address, tsig_strerror(xfrd->tsig_rr->error_code)); } /* strip the TSIG resource record off... */ buffer_set_limit(buffer, xfrd->tsig_rr->position); buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)-1); } /* keep running the TSIG hash */ tsig_rr_update(xfrd->tsig_rr, buffer, buffer_limit(buffer)); if (have_tsig) { if (!tsig_rr_verify(xfrd->tsig_rr)) { ods_log_error("[%s] unable to process tsig: xfr zone %s from %s " "has bad tsig signature", xfrd_str, zone->name, xfrd->master->address); return 0; } /* prepare for next tsigs */ tsig_rr_prepare(xfrd->tsig_rr); } else if (xfrd->tsig_rr->update_since_last_prepare > XFRD_TSIG_MAX_UNSIGNED) { /* we allow a number of non-tsig signed packets */ ods_log_error("[%s] unable to process tsig: xfr zone %s, from %s " "has too many consecutive packets without tsig", xfrd_str, zone->name, xfrd->master->address); return 0; } if (!have_tsig && xfrd->msg_seq_nr == 0) { ods_log_error("[%s] unable to process tsig: xfr zone %s from %s " "has no tsig in first packet of reply", xfrd_str, zone->name, xfrd->master->address); return 0; } /* process TSIG ok */ return 1; } /** * Commit answer on disk. * */ static void xfrd_commit_packet(xfrd_type* xfrd) { zone_type* zone = NULL; char* xfrfile = NULL; FILE* fd = NULL; ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; xfrfile = ods_build_path(zone->name, ".xfrd", 0, 1); if (!xfrfile) { ods_log_crit("[%s] unable to commit xfr zone %s: build path failed", xfrd_str, zone->name); return; } ods_log_assert(zone); ods_log_assert(zone->name); lock_basic_lock(&zone->zone_lock); lock_basic_lock(&xfrd->rw_lock); lock_basic_lock(&xfrd->serial_lock); /* mark end packet */ fd = ods_fopen(xfrfile, NULL, "a"); free((void*)xfrfile); if (fd) { fprintf(fd, ";;ENDPACKET\n"); ods_fclose(fd); } else { lock_basic_unlock(&zone->zone_lock); lock_basic_unlock(&xfrd->rw_lock); lock_basic_unlock(&xfrd->serial_lock); ods_log_crit("[%s] unable to commit xfr zone %s: ods_fopen() failed " "(%s)", xfrd_str, zone->name, strerror(errno)); return; } /* update soa serial management */ xfrd->serial_disk = xfrd->msg_new_serial; xfrd->serial_disk_acquired = xfrd_time(xfrd); xfrd->soa.serial = xfrd->serial_disk; if (util_serial_gt(xfrd->serial_disk, xfrd->serial_xfr) && xfrd->serial_disk_acquired > xfrd->serial_xfr_acquired) { /* reschedule task */ int ret = 0; xfrhandler_type* xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; engine_type* engine = (engine_type*) xfrhandler->engine; ods_log_assert(xfrhandler); ods_log_assert(engine); ods_log_debug("[%s] reschedule task for zone %s: disk serial=%u " "acquired=%u, memory serial=%u acquired=%u", xfrd_str, zone->name, xfrd->serial_disk, xfrd->serial_disk_acquired, xfrd->serial_xfr, xfrd->serial_xfr_acquired); ret = zone_reschedule_task(zone, engine->taskq, TASK_READ); if (ret != ODS_STATUS_OK) { ods_log_crit("[%s] unable to reschedule task for zone %s: %s", xfrd_str, zone->name, ods_status2str(ret)); } else { engine_wakeup_workers(engine); } } lock_basic_unlock(&xfrd->serial_lock); lock_basic_unlock(&xfrd->rw_lock); lock_basic_unlock(&zone->zone_lock); return; } /** * Dump answer to disk. * */ static void xfrd_dump_packet(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; char* xfrfile = NULL; FILE* fd = NULL; ldns_pkt* pkt = NULL; ldns_status status = LDNS_STATUS_OK; ods_log_assert(buffer); ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); status = ldns_wire2pkt(&pkt, buffer_begin(buffer), buffer_limit(buffer)); if (status != LDNS_STATUS_OK) { ods_log_crit("[%s] unable to dump packet zone %s: ldns_wire2pkt() " "failed (%s)", xfrd_str, zone->name, ldns_get_errorstr_by_id(status)); return; } ods_log_assert(pkt); xfrfile = ods_build_path(zone->name, ".xfrd", 0, 1); if (!xfrfile) { ods_log_crit("[%s] unable to dump packet zone %s: build path failed", xfrd_str, zone->name); return; } lock_basic_lock(&xfrd->rw_lock); fd = ods_fopen(xfrfile, NULL, "a"); free((void*) xfrfile); if (!fd) { ods_log_crit("[%s] unable to dump packet zone %s: ods_fopen() failed " "(%s)", xfrd_str, zone->name, strerror(errno)); lock_basic_unlock(&xfrd->rw_lock); return; } ods_log_assert(fd); if (xfrd->msg_seq_nr == 0) { fprintf(fd, ";;BEGINPACKET\n"); } ldns_rr_list_print(fd, ldns_pkt_answer(pkt)); ods_fclose(fd); lock_basic_unlock(&xfrd->rw_lock); ldns_pkt_free(pkt); return; } /** * Write SOA in packet. * */ static void xfrd_write_soa(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; size_t rdlength_pos = 0; uint16_t rdlength = 0; ods_log_assert(xfrd); ods_log_assert(buffer); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->apex); buffer_write_rdf(buffer, zone->apex); buffer_write_u16(buffer, (uint16_t) LDNS_RR_TYPE_SOA); buffer_write_u16(buffer, (uint16_t) zone->klass); buffer_write_u32(buffer, xfrd->soa.ttl); rdlength_pos = buffer_position(buffer); buffer_skip(buffer, sizeof(rdlength)); buffer_write(buffer, xfrd->soa.mname+1, xfrd->soa.mname[0]); buffer_write(buffer, xfrd->soa.rname+1, xfrd->soa.rname[0]); buffer_write_u32(buffer, xfrd->soa.serial); buffer_write_u32(buffer, xfrd->soa.refresh); buffer_write_u32(buffer, xfrd->soa.retry); buffer_write_u32(buffer, xfrd->soa.expire); buffer_write_u32(buffer, xfrd->soa.minimum); rdlength = buffer_position(buffer) - rdlength_pos - sizeof(rdlength); buffer_write_u16_at(buffer, rdlength_pos, rdlength); return; } /** * Update SOA. * */ static void xfrd_update_soa(xfrd_type* xfrd, buffer_type* buffer, uint32_t ttl, uint16_t mname_pos, uint16_t rname_pos, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum) { zone_type* zone = NULL; ods_log_assert(xfrd); ods_log_assert(buffer); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->apex); xfrd->soa.ttl = ttl; xfrd->soa.refresh = refresh; xfrd->soa.retry = retry; xfrd->soa.expire = expire; xfrd->soa.minimum = minimum; buffer_set_position(buffer, mname_pos); if (!(xfrd->soa.mname[0] = buffer_read_dname(buffer, xfrd->soa.mname+1, 1))) { xfrd->soa.mname[0] = 1; xfrd->soa.mname[1] = 0; } buffer_set_position(buffer, rname_pos); if (!(xfrd->soa.rname[0] = buffer_read_dname(buffer, xfrd->soa.rname+1, 1))) { xfrd->soa.rname[0] = 1; xfrd->soa.rname[1] = 0; } return; } /** * Parse SOA RR in packet. * */ static int xfrd_parse_soa(xfrd_type* xfrd, buffer_type* buffer, unsigned rdata_only, unsigned update, uint32_t t, uint32_t* soa_serial) { ldns_rr_type type = LDNS_RR_TYPE_SOA; uint16_t mname_pos = 0; uint16_t rname_pos = 0; uint16_t pos = 0; uint32_t serial = 0; uint32_t refresh = 0; uint32_t retry = 0; uint32_t expire = 0; uint32_t minimum = 0; uint32_t ttl = t; ods_log_assert(xfrd); ods_log_assert(buffer); /* type class ttl */ if (!rdata_only) { if (!buffer_available(buffer, 10)) { ods_log_debug("[%s] unable to parse soa: rr too short", xfrd_str); return 0; } type = (ldns_rr_type) buffer_read_u16(buffer); if (type != LDNS_RR_TYPE_SOA) { ods_log_debug("[%s] unable to parse soa: rrtype %u != soa", xfrd_str, (unsigned) type); return 0; } (void)buffer_read_u16(buffer); /* class */ ttl = buffer_read_u32(buffer); /* rdata length */ if (!buffer_available(buffer, buffer_read_u16(buffer))) { ods_log_debug("[%s] unable to parse soa: rdata too short", xfrd_str); return 0; } } /* MNAME */ mname_pos = buffer_position(buffer); if (!buffer_skip_dname(buffer)) { ods_log_debug("[%s] unable to parse soa: bad mname", xfrd_str); return 0; } /* RNAME */ rname_pos = buffer_position(buffer); if (!buffer_skip_dname(buffer)) { ods_log_debug("[%s] unable to parse soa: bad rname", xfrd_str); return 0; } serial = buffer_read_u32(buffer); refresh = buffer_read_u32(buffer); retry = buffer_read_u32(buffer); expire = buffer_read_u32(buffer); minimum = buffer_read_u32(buffer); pos = buffer_position(buffer); if (soa_serial) { *soa_serial = serial; } if (update) { xfrd_update_soa(xfrd, buffer, ttl, mname_pos, rname_pos, refresh, retry, expire, minimum); } buffer_set_position(buffer, pos); return 1; } /** * Parse RRs in packet. * */ static ods_status xfrd_parse_rrs(xfrd_type* xfrd, buffer_type* buffer, uint16_t count, int* done) { ldns_rr_type type = 0; uint16_t rrlen = 0; uint32_t ttl = 0; uint32_t serial = 0; uint32_t tmp_serial = 0; size_t i = 0; ods_log_assert(xfrd); ods_log_assert(buffer); ods_log_assert(done); for (i=0; i < count; ++i, ++xfrd->msg_rr_count) { if (*done) { return ODS_STATUS_OK; } if (!buffer_skip_dname(buffer)) { return ODS_STATUS_SKIPDNAME; } if (!buffer_available(buffer, 10)) { return ODS_STATUS_BUFAVAIL; } (void)buffer_position(buffer); type = (ldns_rr_type) buffer_read_u16(buffer); (void)buffer_read_u16(buffer); /* class */ ttl = buffer_read_u32(buffer); rrlen = buffer_read_u16(buffer); if (!buffer_available(buffer, rrlen)) { return ODS_STATUS_BUFAVAIL; } if (type == LDNS_RR_TYPE_SOA) { if (!xfrd_parse_soa(xfrd, buffer, 1, 0, ttl, &serial)) { return ODS_STATUS_PARSESOA; } if (xfrd->msg_rr_count == 1 && serial != xfrd->msg_new_serial) { /* 2nd RR is SOA with different serial, this is an IXFR */ xfrd->msg_is_ixfr = 1; lock_basic_lock(&xfrd->serial_lock); if (!xfrd->serial_disk_acquired) { lock_basic_unlock(&xfrd->serial_lock); /* got IXFR but need AXFR */ return ODS_STATUS_REQAXFR; } if (serial != xfrd->serial_disk) { lock_basic_unlock(&xfrd->serial_lock); /* bad start serial in IXFR */ return ODS_STATUS_INSERIAL; } lock_basic_unlock(&xfrd->serial_lock); xfrd->msg_old_serial = serial; tmp_serial = serial; } else if (serial == xfrd->msg_new_serial) { /* saw another SOA of new serial. */ if (xfrd->msg_is_ixfr == 1) { xfrd->msg_is_ixfr = 2; /* seen middle SOA in ixfr */ } else { *done = 1; /* final axfr/ixfr soa */ } } else if (xfrd->msg_is_ixfr) { /* some additional checks */ if (util_serial_gt(serial, xfrd->msg_new_serial)) { /* bad middle serial in IXFR (too high) */ return ODS_STATUS_INSERIAL; } if (util_serial_gt(tmp_serial, serial)) { /* middle serial decreases in IXFR */ return ODS_STATUS_INSERIAL; } /* serial ok, update tmp serial */ tmp_serial = serial; } } else { buffer_skip(buffer, rrlen); } } return ODS_STATUS_OK; } /** * Parse packet. * */ static xfrd_pkt_status xfrd_parse_packet(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; uint16_t qdcount = 0; uint16_t ancount = 0; uint16_t ancount_todo = 0; uint16_t rrcount = 0; uint32_t serial = 0; int done = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(buffer); ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); /* check packet size */ if (!buffer_available(buffer, BUFFER_PKT_HEADER_SIZE)) { ods_log_error("[%s] unable to parse packet: zone %s received bad " "packet from %s (too small)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } /* check query id */ if (buffer_pkt_id(buffer) != xfrd->query_id) { ods_log_error("[%s] bad packet: zone %s received bad query id " "%u from %s (expected %u)", xfrd_str, zone->name, buffer_pkt_id(buffer), xfrd->master->address, xfrd->query_id); return XFRD_PKT_BAD; } /* check rcode */ if (buffer_pkt_rcode(buffer) != LDNS_RCODE_NOERROR) { ods_log_error("[%s] bad packet: zone %s received error code %s from %s", xfrd_str, zone->name, ldns_pkt_rcode2str(buffer_pkt_rcode(buffer)), xfrd->master->address); if (buffer_pkt_rcode(buffer) == LDNS_RCODE_NOTIMPL) { return XFRD_PKT_NOTIMPL; } else if (buffer_pkt_rcode(buffer) != LDNS_RCODE_NOTAUTH) { return XFRD_PKT_BAD; } } /* check tsig */ if (!xfrd_tsig_process(xfrd, buffer)) { ods_log_error("[%s] bad packet: zone %s received bad tsig " "from %s", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } /* skip header and question section */ buffer_skip(buffer, BUFFER_PKT_HEADER_SIZE); qdcount = buffer_pkt_qdcount(buffer); for (rrcount = 0; rrcount < qdcount; rrcount++) { if (!buffer_skip_rr(buffer, 1)) { ods_log_error("[%s] bad packet: zone %s received bad " "question section from %s (bad rr)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } } /* answer section */ ancount = buffer_pkt_ancount(buffer); if (xfrd->msg_rr_count == 0 && ancount == 0) { if (xfrd->tcp_conn == -1 && buffer_pkt_tc(buffer)) { ods_log_debug("[%s] zone %s received tc from %s, retry tcp", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_TC; } ods_log_error("[%s] bad packet: zone %s received bad xfr packet " "from %s (nodata)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } ancount_todo = ancount; if (xfrd->msg_rr_count == 0) { /* parse the first RR, see if it is a SOA */ if (!buffer_skip_dname(buffer) || !xfrd_parse_soa(xfrd, buffer, 0, 1, 0, &serial)) { ods_log_error("[%s] bad packet: zone %s received bad xfr " "packet from %s (bad soa)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } /* check serial */ lock_basic_lock(&xfrd->serial_lock); if (xfrd->serial_disk_acquired && xfrd->serial_disk == serial) { ods_log_debug("[%s] zone %s got update indicating current " "serial %u from %s", xfrd_str, zone->name, serial, xfrd->master->address); xfrd->serial_disk_acquired = xfrd_time(xfrd); if (xfrd->serial_xfr == serial) { xfrd->serial_xfr_acquired = xfrd->serial_disk_acquired; if (!xfrd->serial_notify_acquired) { /* not notified or anything, so stop asking around */ xfrd->round_num = -1; /* next try start a new round */ xfrd_set_timer_refresh(xfrd); ods_log_debug("[%s] zone %s wait refresh time", xfrd_str, zone->name); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_NEWLEASE; } /* try next master */ ods_log_debug("[%s] zone %s try next master", xfrd_str, zone->name); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_BAD; } } if (xfrd->serial_disk_acquired && !util_serial_gt(serial, xfrd->serial_disk)) { ods_log_debug("[%s] zone %s ignoring old serial %u from %s " "(have %u)", xfrd_str, zone->name, serial, xfrd->master->address, xfrd->serial_disk); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_BAD; } xfrd->msg_new_serial = serial; if (xfrd->serial_disk_acquired) { xfrd->msg_old_serial = xfrd->serial_disk; } else { xfrd->msg_old_serial = 0; } /* update notify serial if this xfr is newer */ if (ancount > 1 && xfrd->serial_notify_acquired && util_serial_gt(serial, xfrd->serial_notify)) { xfrd->serial_notify = serial; } lock_basic_unlock(&xfrd->serial_lock); xfrd->msg_rr_count = 1; xfrd->msg_is_ixfr = 0; ancount_todo = ancount - 1; } /* check tc bit */ if (xfrd->tcp_conn == -1 && buffer_pkt_tc(buffer)) { ods_log_debug("[%s] zone %s received tc from %s, retry tcp", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_TC; } if (xfrd->tcp_conn == -1 && ancount < 2) { /* too short to be a real ixfr/axfr data transfer */ ods_log_debug("[%s] zone %s received too short udp reply from %s, " "retry tcp", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_TC; } status = xfrd_parse_rrs(xfrd, buffer, ancount_todo, &done); if (status != ODS_STATUS_OK) { ods_log_error("[%s] bad packet: zone %s received bad xfr packet " "from %s (%s)", xfrd_str, zone->name, xfrd->master->address, ods_status2str(status)); return XFRD_PKT_BAD; } if (xfrd->tcp_conn == -1 && !done) { ods_log_error("[%s] bad packet: zone %s received bad xfr packet " "(xfr over udp incomplete)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } if (!done) { return XFRD_PKT_MORE; } return XFRD_PKT_XFR; } /** * Handle packet. * */ static xfrd_pkt_status xfrd_handle_packet(xfrd_type* xfrd, buffer_type* buffer) { xfrd_pkt_status res = XFRD_PKT_BAD; zone_type* zone = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); res = xfrd_parse_packet(xfrd, buffer); ods_log_debug("[%s] zone %s xfr packet parsed (res %d)", xfrd_str, zone->name, res); switch (res) { case XFRD_PKT_MORE: case XFRD_PKT_XFR: /* continue with commit */ break; case XFRD_PKT_NEWLEASE: case XFRD_PKT_TC: return res; break; case XFRD_PKT_NOTIMPL: case XFRD_PKT_BAD: default: /* rollback */ if (xfrd->msg_seq_nr > 0) { buffer_clear(buffer); ods_log_info("[%s] zone %s xfr rollback", xfrd_str, zone->name); buffer_flip(buffer); } return res; break; } /* dump reply on disk to diff file */ xfrd_dump_packet(xfrd, buffer); /* more? */ xfrd->msg_seq_nr++; if (res == XFRD_PKT_MORE) { /* wait for more */ return XFRD_PKT_MORE; } /* done */ buffer_clear(buffer); buffer_flip(buffer); /* commit packet */ xfrd_commit_packet(xfrd); /* next time */ lock_basic_lock(&xfrd->serial_lock); ods_log_debug("[%s] zone %s notify acquired %u, serial on disk %u, " "notify serial %u", xfrd_str, zone->name, xfrd->serial_notify_acquired, xfrd->serial_disk, xfrd->serial_notify); if (xfrd->serial_notify_acquired && !util_serial_gt(xfrd->serial_notify, xfrd->serial_disk)) { ods_log_debug("[%s] zone %s reset notify acquired", xfrd_str, zone->name); xfrd->serial_notify_acquired = 0; } if (!xfrd->serial_notify_acquired) { ods_log_debug("[%s] zone %s xfr done", xfrd_str, zone->name); xfrd->round_num = -1; /* next try start anew */ xfrd_set_timer_refresh(xfrd); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_XFR; } lock_basic_unlock(&xfrd->serial_lock); /* try to get an even newer serial */ ods_log_debug("[%s] zone %s get newer serial", xfrd_str, zone->name); return XFRD_PKT_BAD; } /** TCP **/ /** * Write to tcp. * */ static void xfrd_tcp_write(xfrd_type* xfrd, tcp_set_type* set) { zone_type* zone = NULL; tcp_conn_type* tcp = NULL; int ret = 0; int error = 0; socklen_t len = 0; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn != -1); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); tcp = set->tcp_conn[xfrd->tcp_conn]; if (tcp->total_bytes == 0) { /* check for pending error from nonblocking connect */ /* from Stevens, unix network programming, vol1, 3rd ed, p450 */ len = sizeof(error); if (getsockopt(tcp->fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { error = errno; /* on solaris errno is error */ } if (error == EINPROGRESS || error == EWOULDBLOCK) { ods_log_debug("[%s] zone %s zero write, write again later (%s)", xfrd_str, zone->name, strerror(error)); return; /* try again later */ } if (error != 0) { ods_log_error("[%s] zone %s cannot tcp connect to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set); return; } } ret = tcp_conn_write(tcp); if(ret == -1) { ods_log_error("[%s] zone %s cannot tcp write to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set); return; } if (ret == 0) { ods_log_debug("[%s] zone %s zero write, write again later", xfrd_str, zone->name); return; /* write again later */ } /* done writing, get ready for reading */ ods_log_debug("[%s] zone %s done writing, get ready for reading", xfrd_str, zone->name); tcp->is_reading = 1; tcp_conn_ready(tcp); xfrd->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; xfrd_tcp_read(xfrd, set); return; } /** * Open tcp connection. * */ static int xfrd_tcp_open(xfrd_type* xfrd, tcp_set_type* set) { int fd, family, conn; struct sockaddr_storage to; socklen_t to_len; zone_type* zone = NULL; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn != -1); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] zone %s open tcp connection to %s", xfrd_str, zone->name, xfrd->master->address); set->tcp_conn[xfrd->tcp_conn]->is_reading = 0; set->tcp_conn[xfrd->tcp_conn]->total_bytes = 0; set->tcp_conn[xfrd->tcp_conn]->msglen = 0; if (xfrd->master->family == AF_INET6) { family = PF_INET6; } else { family = PF_INET; } fd = socket(family, SOCK_STREAM, IPPROTO_TCP); set->tcp_conn[xfrd->tcp_conn]->fd = fd; if (fd == -1) { ods_log_error("[%s] zone %s cannot create tcp socket to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set); return 0; } if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) { ods_log_error("[%s] zone %s cannot fcntl tcp socket to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set); return 0; } to_len = xfrd_acl_sockaddr_to(xfrd->master, &to); /* bind it? */ conn = connect(fd, (struct sockaddr*)&to, to_len); if (conn == -1 && errno != EINPROGRESS) { ods_log_error("[%s] zone %s cannot connect tcp socket to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set); return 0; } xfrd->handler.fd = fd; xfrd->handler.event_types = NETIO_EVENT_WRITE|NETIO_EVENT_TIMEOUT; xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); return 1; } /** * Obtain tcp. * */ static void xfrd_tcp_obtain(xfrd_type* xfrd, tcp_set_type* set) { int i = 0; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn == -1); ods_log_assert(xfrd->tcp_waiting == 0); if (set->tcp_count < TCPSET_MAX) { ods_log_assert(!set->tcp_waiting_first); set->tcp_count ++; /* find a free tcp_buffer */ for (i=0; i < TCPSET_MAX; i++) { if (set->tcp_conn[i]->fd == -1) { xfrd->tcp_conn = i; break; } } ods_log_assert(xfrd->tcp_conn != -1); xfrd->tcp_waiting = 0; /* stop udp use (if any) */ if (xfrd->handler.fd != -1) { xfrd_udp_release(xfrd); } if (!xfrd_tcp_open(xfrd, set)) { return; } xfrd_tcp_xfr(xfrd, set); return; } /* wait, at end of line */ ods_log_verbose("[%s] max number of tcp connections (%d) reached", xfrd_str, TCPSET_MAX); xfrd->tcp_waiting = 1; xfrd_unset_timer(xfrd); return; } /** * Start xfr. * */ static void xfrd_tcp_xfr(xfrd_type* xfrd, tcp_set_type* set) { tcp_conn_type* tcp = NULL; zone_type* zone = NULL; ods_log_assert(set); ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(xfrd->tcp_conn != -1); ods_log_assert(xfrd->tcp_waiting == 0); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); /* start AXFR or IXFR for the zone */ tcp = set->tcp_conn[xfrd->tcp_conn]; if (xfrd->serial_xfr_acquired <= 0 || xfrd->master->ixfr_disabled) { ods_log_debug("[%s] zone %s request axfr to %s", xfrd_str, zone->name, xfrd->master->address); buffer_pkt_query(tcp->packet, zone->apex, LDNS_RR_TYPE_AXFR, zone->klass); } else { ods_log_debug("[%s] zone %s request ixfr to %s", xfrd_str, zone->name, xfrd->master->address); buffer_pkt_query(tcp->packet, zone->apex, LDNS_RR_TYPE_IXFR, zone->klass); buffer_pkt_set_nscount(tcp->packet, 1); xfrd_write_soa(xfrd, tcp->packet); } /* make packet */ xfrd->query_id = buffer_pkt_id(tcp->packet); xfrd->msg_seq_nr = 0; xfrd->msg_rr_count = 0; xfrd->msg_old_serial = 0; xfrd->msg_new_serial = 0; xfrd->msg_is_ixfr = 0; xfrd_tsig_sign(xfrd, tcp->packet); buffer_flip(tcp->packet); tcp->msglen = buffer_limit(tcp->packet); ods_log_debug("[%s] zone %s sending tcp query id=%d", xfrd_str, zone->name, xfrd->query_id); /* wait for select to complete connect before write */ return; } /** * Read from tcp. * */ static void xfrd_tcp_read(xfrd_type* xfrd, tcp_set_type* set) { tcp_conn_type* tcp = NULL; int ret = 0; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn != -1); tcp = set->tcp_conn[xfrd->tcp_conn]; ret = tcp_conn_read(tcp); if (ret == -1) { xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set); return; } if (ret == 0) { return; } /* completed msg */ buffer_flip(tcp->packet); ret = xfrd_handle_packet(xfrd, tcp->packet); switch (ret) { case XFRD_PKT_MORE: tcp_conn_ready(tcp); break; case XFRD_PKT_XFR: case XFRD_PKT_NEWLEASE: ods_log_debug("[%s] tcp read %s: release connection", xfrd_str, XFRD_PKT_XFR?"xfr":"newlease"); xfrd_tcp_release(xfrd, set); ods_log_assert(xfrd->round_num == -1); break; case XFRD_PKT_NOTIMPL: xfrd->master->ixfr_disabled = time_now(); ods_log_debug("[%s] disable ixfr requests for %s from now (%u)", xfrd_str, xfrd->master->address, xfrd->master->ixfr_disabled); /* break; */ case XFRD_PKT_BAD: default: ods_log_debug("[%s] tcp read %s: release connection", xfrd_str, ret==XFRD_PKT_BAD?"bad":"notimpl"); xfrd_tcp_release(xfrd, set); xfrd_make_request(xfrd); break; } return; } /** * Release tcp. * */ static void xfrd_tcp_release(xfrd_type* xfrd, tcp_set_type* set) { int conn = 0; zone_type* zone = NULL; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); ods_log_assert(xfrd->tcp_conn != -1); ods_log_assert(xfrd->tcp_waiting == 0); zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s release tcp connection to %s", xfrd_str, zone->name, xfrd->master->address); conn = xfrd->tcp_conn; xfrd->tcp_conn = -1; xfrd->tcp_waiting = 0; xfrd->handler.fd = -1; xfrd->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; if (set->tcp_conn[conn]->fd != -1) { close(set->tcp_conn[conn]->fd); } set->tcp_conn[conn]->fd = -1; set->tcp_count --; return; } /** UDP **/ /** * Send packet over udp. * */ static int xfrd_udp_send(xfrd_type* xfrd, buffer_type* buffer) { struct sockaddr_storage to; socklen_t to_len = 0; int fd = -1; int family = PF_INET; ssize_t nb = -1; ods_log_assert(buffer); ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); /* this will set the remote port to acl->port or TCP_PORT */ to_len = xfrd_acl_sockaddr_to(xfrd->master, &to); /* get the address family of the remote host */ if (xfrd->master->family == AF_INET6) { family = PF_INET6; } /* create socket */ fd = socket(family, SOCK_DGRAM, IPPROTO_UDP); if (fd == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "socket() failed (%s)", xfrd_str, xfrd->master->address, strerror(errno)); return -1; } /* bind it? */ /* send it (udp) */ ods_log_deeebug("[%s] send %d bytes over udp to %s", xfrd_str, buffer_remaining(buffer), xfrd->master->address); nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0, (struct sockaddr*)&to, to_len); if (nb == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "sendto() failed (%s)", xfrd_str, xfrd->master->address, strerror(errno)); close(fd); return -1; } return fd; } /** * Send IXFR request. * */ static int xfrd_udp_send_request_ixfr(xfrd_type* xfrd) { int fd; xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); if (xfrd->tcp_conn != -1) { /* tcp is using the handler.fd */ ods_log_error("[%s] unable to transfer zone %s: tried to send " "udp while tcp obtained", xfrd_str, zone->name); return -1; } /* make packet */ xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); buffer_pkt_query(xfrhandler->packet, zone->apex, LDNS_RR_TYPE_IXFR, zone->klass); xfrd->query_id = buffer_pkt_id(xfrhandler->packet); xfrd->msg_seq_nr = 0; xfrd->msg_rr_count = 0; xfrd->msg_old_serial = 0; xfrd->msg_new_serial = 0; xfrd->msg_is_ixfr = 0; buffer_pkt_set_nscount(xfrhandler->packet, 1); xfrd_write_soa(xfrd, xfrhandler->packet); xfrd_tsig_sign(xfrd, xfrhandler->packet); buffer_flip(xfrhandler->packet); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_UDP_TIMEOUT); ods_log_debug("[%s] zone %s sending udp query id=%d qtype=IXFR to %s", xfrd_str, zone->name, xfrd->query_id, xfrd->master->address); if((fd = xfrd_udp_send(xfrd, xfrhandler->packet)) == -1) { return -1; } return fd; } /** * Obtain udp. * */ static void xfrd_udp_obtain(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->xfrhandler); ods_log_assert(xfrd->udp_waiting == 0); xfrhandler = (void*) xfrd->xfrhandler; if (xfrd->tcp_conn != -1) { /* no tcp and udp at the same time */ xfrd_tcp_release(xfrd, xfrhandler->tcp_set); } if (xfrhandler->udp_use_num < XFRD_MAX_UDP) { xfrhandler->udp_use_num++; xfrd->handler.fd = xfrd_udp_send_request_ixfr(xfrd); if (xfrd->handler.fd == -1) { xfrhandler->udp_use_num--; } return; } /* queue the zone as last */ xfrd->udp_waiting = 1; xfrd->udp_waiting_next = NULL; if (!xfrhandler->udp_waiting_first) { xfrhandler->udp_waiting_first = xfrd; } if (xfrhandler->udp_waiting_last) { xfrhandler->udp_waiting_last->udp_waiting_next = xfrd; } xfrhandler->udp_waiting_last = xfrd; xfrd_unset_timer(xfrd); return; } /** * Read packet from udp. * */ static int xfrd_udp_read_packet(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; ssize_t received = 0; ods_log_assert(xfrd); xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); /* read the data */ buffer_clear(xfrhandler->packet); received = recvfrom(xfrd->handler.fd, buffer_begin(xfrhandler->packet), buffer_remaining(xfrhandler->packet), 0, NULL, NULL); if (received == -1) { ods_log_error("[%s] unable to read packet: recvfrom() failed fd %d " "(%s)", xfrd_str, xfrd->handler.fd, strerror(errno)); return 0; } buffer_set_limit(xfrhandler->packet, received); return 1; } /** * Read from udp. * */ static void xfrd_udp_read(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; xfrd_pkt_status res = XFRD_PKT_BAD; ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] zone %s read data from udp", xfrd_str, zone->name); if (!xfrd_udp_read_packet(xfrd)) { ods_log_error("[%s] unable to read data from udp zone %s: " "xfrd_udp_read_packet() failed", xfrd_str, zone->name); xfrd_udp_release(xfrd); return; } xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); res = xfrd_handle_packet(xfrd, xfrhandler->packet); switch (res) { case XFRD_PKT_TC: ods_log_debug("[%s] truncation from %s", xfrd_str, xfrd->master->address); xfrd_udp_release(xfrd); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_obtain(xfrd, xfrhandler->tcp_set); break; case XFRD_PKT_XFR: case XFRD_PKT_NEWLEASE: ods_log_debug("[%s] xfr/newlease from %s", xfrd_str, xfrd->master->address); /* nothing more to do */ ods_log_assert(xfrd->round_num == -1); xfrd_udp_release(xfrd); break; case XFRD_PKT_NOTIMPL: xfrd->master->ixfr_disabled = time_now(); ods_log_debug("[%s] disable ixfr requests for %s from now (%u)", xfrd_str, xfrd->master->address, xfrd->master->ixfr_disabled); /* break; */ case XFRD_PKT_BAD: default: ods_log_debug("[%s] bad ixfr packet from %s", xfrd_str, xfrd->master->address); xfrd_udp_release(xfrd); xfrd_make_request(xfrd); break; } return; } /** * Release udp. * */ static void xfrd_udp_release(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->udp_waiting == 0); if(xfrd->handler.fd != -1) close(xfrd->handler.fd); xfrd->handler.fd = -1; xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); /* see if there are waiting zones */ if (xfrhandler->udp_use_num == XFRD_MAX_UDP) { while (xfrhandler->udp_waiting_first) { /* snip off waiting list */ xfrd_type* wf = xfrhandler->udp_waiting_first; ods_log_assert(wf->udp_waiting); wf->udp_waiting = 0; xfrhandler->udp_waiting_first = wf->udp_waiting_next; if (xfrhandler->udp_waiting_last == wf) { xfrhandler->udp_waiting_last = NULL; } /* see if this zone needs udp connection */ if (wf->tcp_conn == -1) { wf->handler.fd = xfrd_udp_send_request_ixfr(wf); if (wf->handler.fd != -1) { return; } } } } /* no waiting zones */ if (xfrhandler->udp_use_num > 0) { xfrhandler->udp_use_num --; } return; } /** * Make a zone transfer request. * */ static void xfrd_make_request(xfrd_type* xfrd) { zone_type* zone = NULL; dnsin_type* dnsin = NULL; if (!xfrd || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adinbound); ods_log_assert(zone->adinbound->type == ADAPTER_DNS); ods_log_assert(zone->adinbound->config); dnsin = (dnsin_type*) zone->adinbound->config; if (xfrd->next_master != -1) { /* we are told to use this next master */ xfrd->master_num = xfrd->next_master; xfrd->master = NULL; /* acl_find_num(...) */ /* if there is no next master, fallback to use the first one */ if (!xfrd->master) { xfrd->master = dnsin->request_xfr; xfrd->master_num = 0; } /* fallback to cycle master */ xfrd->next_master = -1; xfrd->round_num = 0; /* fresh set of retries after notify */ } else { /* cycle master */ if (xfrd->round_num != -1 && xfrd->master && xfrd->master->next) { /* try the next master */ xfrd->master = xfrd->master->next; xfrd->master_num++; } else { /* start a new round */ xfrd->master = dnsin->request_xfr; xfrd->master_num = 0; xfrd->round_num++; } if (xfrd->round_num >= XFRD_MAX_ROUNDS) { /* tried all servers that many times, wait */ xfrd->round_num = -1; xfrd_set_timer_retry(xfrd); ods_log_verbose("[%s] zone %s make request wait retry", xfrd_str, zone->name); return; } } if (!xfrd->master) { ods_log_debug("[%s] unable to make request for zone %s: no master", xfrd_str, zone->name); xfrd->round_num = -1; xfrd_set_timer_retry(xfrd); return; } /* cache ixfr_disabled only for XFRD_NO_IXFR_CACHE time */ if (xfrd->master->ixfr_disabled && (xfrd->master->ixfr_disabled + XFRD_NO_IXFR_CACHE) <= xfrd_time(xfrd)) { ods_log_verbose("[%s] clear negative caching ixfr disabled for " "master %s", xfrd_str, xfrd->master->address); ods_log_debug("[%s] clear negative caching calc: %u + %u <= %u", xfrd_str, xfrd->master->ixfr_disabled, XFRD_NO_IXFR_CACHE, xfrd_time(xfrd)); xfrd->master->ixfr_disabled = 0; } /* perform xfr request */ ods_log_debug("[%s] zone %s make request round %d master %s:%u", xfrd_str, zone->name, xfrd->round_num, xfrd->master->address, xfrd->master->port); if (xfrd->serial_xfr_acquired && !xfrd->master->ixfr_disabled) { xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_UDP_TIMEOUT); xfrd_udp_obtain(xfrd); } else if (xfrd->serial_xfr_acquired <= 0 || xfrd->master->ixfr_disabled) { xfrhandler_type* xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_obtain(xfrd, xfrhandler->tcp_set); } return; } /** * Handle zone transfer. * */ static void xfrd_handle_zone(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { xfrd_type* xfrd = NULL; zone_type* zone = NULL; if (!handler) { return; } xfrd = (xfrd_type*) handler->user_data; ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); if (xfrd->tcp_conn != -1) { /* busy in tcp transaction */ xfrhandler_type* xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); if (event_types & NETIO_EVENT_READ) { ods_log_deeebug("[%s] zone %s event tcp read", xfrd_str, zone->name); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_read(xfrd, xfrhandler->tcp_set); return; } else if (event_types & NETIO_EVENT_WRITE) { ods_log_deeebug("[%s] zone %s event tcp write", xfrd_str, zone->name); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_write(xfrd, xfrhandler->tcp_set); return; } else if (event_types & NETIO_EVENT_TIMEOUT) { /* tcp connection timed out. Stop it. */ ods_log_deeebug("[%s] zone %s event tcp timeout", xfrd_str, zone->name); xfrd_tcp_release(xfrd, xfrhandler->tcp_set); /* continue to retry; as if a timeout happened */ event_types = NETIO_EVENT_TIMEOUT; } } if (event_types & NETIO_EVENT_READ) { /* busy in udp transaction */ ods_log_deeebug("[%s] zone %s event udp read", xfrd_str, zone->name); xfrd_set_timer_now(xfrd); xfrd_udp_read(xfrd); return; } /* timeout */ ods_log_deeebug("[%s] zone %s timeout", xfrd_str, zone->name); if (handler->fd != -1) { ods_log_assert(xfrd->tcp_conn == -1); xfrd_udp_release(xfrd); } if (xfrd->tcp_waiting) { ods_log_deeebug("[%s] zone %s skips retry: tcp connections full", xfrd_str, zone->name); xfrd_unset_timer(xfrd); return; } if (xfrd->udp_waiting) { ods_log_deeebug("[%s] zone %s skips retry: udp connections full", xfrd_str, zone->name); xfrd_unset_timer(xfrd); return; } /* make a new request */ xfrd_make_request(xfrd); return; } /** * Cleanup zone transfer structure. * */ void xfrd_cleanup(xfrd_type* xfrd) { allocator_type* allocator = NULL; lock_basic_type serial_lock; lock_basic_type rw_lock; if (!xfrd) { return; } allocator = xfrd->allocator; serial_lock = xfrd->serial_lock; rw_lock = xfrd->rw_lock; tsig_rr_cleanup(xfrd->tsig_rr); allocator_deallocate(allocator, (void*) xfrd); allocator_cleanup(allocator); lock_basic_destroy(&serial_lock); lock_basic_destroy(&rw_lock); return; } opendnssec-1.4.3/signer/src/wire/xfrd.h0000664000175000017500000001166611665406617014771 00000000000000/* * $Id: xfrd.h 4958 2011-04-18 07:11:09Z matthijs $ * * Copyright (c) 2011 NLNet Labs. 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, 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 ``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 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. * */ /** * Zone transfers. * */ #ifndef WIRE_XFRD_H #define WIRE_XFRD_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "wire/acl.h" #include "wire/buffer.h" #include "wire/netio.h" #include "wire/tsig.h" #include #include #define XFRD_MAX_ROUNDS 3 /* max number of rounds along the masters */ #define XFRD_MAX_UDP 100 /* max number of udp sockets at a time for ixfr */ #define XFRD_NO_IXFR_CACHE 172800 /* 48h before retrying ixfr after notimpl */ #define XFRD_TCP_TIMEOUT 120 /* seconds, before a tcp request times out */ #define XFRD_UDP_TIMEOUT 5 /* seconds, before a udp request times out */ /** * Packet status. * */ enum xfrd_pkt_enum { XFRD_PKT_BAD, /* drop the packet/connection */ XFRD_PKT_MORE, /* more packets to follow on tcp */ XFRD_PKT_NOTIMPL, /* server responded with NOTIMPL or FORMATERR */ XFRD_PKT_TC, /* try tcp connection */ XFRD_PKT_XFR, /* server responded with transfer*/ XFRD_PKT_NEWLEASE /* no changes, soa OK */ }; typedef enum xfrd_pkt_enum xfrd_pkt_status; /* * Zone transfer SOA information. */ typedef struct soa_struct soa_type; struct soa_struct { /* owner equals zone apex */ /* class equals zone klass */ /* type is SOA */ uint32_t ttl; /* rdata count = 7 */ uint8_t mname[MAXDOMAINLEN + 2]; uint8_t rname[MAXDOMAINLEN + 2]; uint32_t serial; uint32_t refresh; uint32_t retry; uint32_t expire; uint32_t minimum; }; /** * Zone transfer state. * */ typedef struct xfrd_struct xfrd_type; struct xfrd_struct { allocator_type* allocator; void* xfrhandler; void* zone; lock_basic_type serial_lock; /* mutexes soa serial management */ lock_basic_type rw_lock; /* mutexes .xfrd file */ /* transfer request handling */ int tcp_conn; int round_num; int master_num; int next_master; acl_type* master; /* soa serial management */ uint32_t serial_xfr; uint32_t serial_notify; uint32_t serial_disk; time_t serial_xfr_acquired; time_t serial_notify_acquired; time_t serial_disk_acquired; soa_type soa; /* timeout and event handling */ struct timespec timeout; netio_handler_type handler; /* packet handling */ uint16_t query_id; uint32_t msg_seq_nr; uint32_t msg_old_serial; uint32_t msg_new_serial; size_t msg_rr_count; uint8_t msg_is_ixfr; tsig_rr_type* tsig_rr; xfrd_type* tcp_waiting_next; xfrd_type* udp_waiting_next; unsigned tcp_waiting : 1; unsigned udp_waiting : 1; }; /** * Create zone transfer structure. * \param[in] xfrhandler zone transfer handler * \param[in] zone zone reference * \return xfrd_type* zone transfer structure. * */ xfrd_type* xfrd_create(void* xfrhandler, void* zone); /** * Set timeout for zone transfer to now. * \param[in] xfrd zone transfer structure. * */ void xfrd_set_timer_now(xfrd_type* xfrd); /** * Set timeout for zone transfer to RETRY. * \param[in] xfrd zone transfer structure. * */ void xfrd_set_timer_retry(xfrd_type* xfrd); /** * Set timeout for zone transfer to REFRESH. * \param[in] xfrd zone transfer structure. * */ void xfrd_set_timer_refresh(xfrd_type* xfrd); /** * Use acl address to setup remote sockaddr struct. * \param[in] acl acl * \param[in] to remote address storage * \return socklen_t length of address * */ socklen_t xfrd_acl_sockaddr_to(acl_type* acl, struct sockaddr_storage* to); /** * Cleanup zone transfer structure. * \param[in] xfrd zone transfer structure. * */ void xfrd_cleanup(xfrd_type* xfrd); #endif /* WIRE_XFRD_H */ opendnssec-1.4.3/signer/src/Makefile.am0000664000175000017500000000575711763104736014743 00000000000000# $Id: Makefile.am 6368 2012-06-04 10:11:42Z matthijs $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBHSM = ${top_builddir}/libhsm/src/lib/libhsm.a LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(top_srcdir)/libhsm/src/lib \ @SSL_INCLUDES@ \ @XML2_INCLUDES@ \ @LDNS_INCLUDES@ signerdir = @libdir@/opendnssec/signer sbin_PROGRAMS = ods-signerd ods-signer # man8_MANS = man/ods-signer.8 man/ods-signerd.8 ods_signerd_SOURCES= ods-signerd.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_signerd_LDADD= $(LIBHSM) ods_signerd_LDADD+= $(LIBCOMPAT) ods_signerd_LDADD+= @LDNS_LIBS@ @XML2_LIBS@ @PTHREAD_LIBS@ @RT_LIBS@ @SSL_LIBS@ @C_LIBS@ ods_signer_SOURCES= ods-signer.c \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/log.c shared/log.h \ shared/util.c shared/util.h ods_signer_LDADD= $(LIBHSM) ods_signer_LDADD+= @LDNS_LIBS@ @XML2_LIBS@ opendnssec-1.4.3/signer/src/ods-signerd.c0000664000175000017500000001175012127027127015250 00000000000000/* * $Id: ods-signerd.c 7083 2013-04-03 13:27:51Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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, 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 ``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 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. * */ /** * OpenDNSSEC signer engine daemon. * */ #include "config.h" #include "daemon/engine.h" #include #include #include #define AUTHOR_NAME "Matthijs Mekking" #define COPYRIGHT_STR "Copyright (C) 2008-2010 NLnet Labs OpenDNSSEC" /** * Prints usage. * */ static void usage(FILE* out) { fprintf(out, "Usage: %s [OPTIONS]\n", "ods-signerd"); fprintf(out, "Start the OpenDNSSEC signer engine daemon.\n\n"); fprintf(out, "Supported options:\n"); fprintf(out, " -c | --config Read configuration from file.\n"); fprintf(out, " -d | --no-daemon Do not daemonize the signer " "engine.\n"); fprintf(out, " -1 | --single-run Run once, then exit.\n"); fprintf(out, " -h | --help Show this help and exit.\n"); fprintf(out, " -i | --info Print configuration and exit.\n"); fprintf(out, " -v | --verbose Increase verbosity.\n"); fprintf(out, " -V | --version Show version and exit.\n"); fprintf(out, "\nBSD licensed, see LICENSE in source package for " "details.\n"); fprintf(out, "Version %s. Report bugs to <%s>.\n", PACKAGE_VERSION, PACKAGE_BUGREPORT); } /** * Prints version. * */ static void version(FILE* out) { fprintf(out, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); fprintf(out, "Written by %s.\n\n", AUTHOR_NAME); fprintf(out, "%s. This is free software.\n", COPYRIGHT_STR); fprintf(out, "See source files for more license information\n"); exit(0); } /** * Main. start engine and run it. * */ int main(int argc, char* argv[]) { int c; int options_index = 0; int info = 0; int single_run = 0; int daemonize = 1; int cmdline_verbosity = 0; const char* cfgfile = ODS_SE_CFGFILE; static struct option long_options[] = { {"single-run", no_argument, 0, '1'}, {"config", required_argument, 0, 'c'}, {"no-daemon", no_argument, 0, 'd'}, {"help", no_argument, 0, 'h'}, {"info", no_argument, 0, 'i'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, { 0, 0, 0, 0} }; /* parse the commandline */ while ((c=getopt_long(argc, argv, "1c:dhivV", long_options, &options_index)) != -1) { switch (c) { case '1': single_run = 1; break; case 'c': cfgfile = optarg; break; case 'd': daemonize = 0; break; case 'h': usage(stdout); exit(0); break; case 'i': info = 1; break; case 'v': cmdline_verbosity++; break; case 'V': version(stdout); exit(0); break; default: usage(stderr); exit(2); break; } } argc -= optind; argv += optind; if (argc != 0) { usage(stderr); exit(2); } #ifdef ENFORCER_TIMESHIFT if (getenv("ENFORCER_TIMESHIFT")) { fprintf(stdout, "WARNING: timeshift %s detected, running once only\n", getenv("ENFORCER_TIMESHIFT")); single_run = 1; } else { fprintf(stdout, "DEBUG: timeshift mode enabled, but not set.\n"); } #endif /* ENFORCER_TIMESHIFT */ /* main stuff */ fprintf(stdout, "OpenDNSSEC signer engine version %s\n", PACKAGE_VERSION); engine_start(cfgfile, cmdline_verbosity, daemonize, info, single_run); /* done */ return 0; } opendnssec-1.4.3/signer/README0000664000175000017500000002342111721247530012756 00000000000000$Id: README 6186 2012-02-22 20:26:00Z matthijs $ The signer engine and its tools are part of the OpenDNSSEC project. For more information, visit http://www.opendnssec.org CONTENTS: INTRODUCTION DEPENDENCIES INSTALLATION INTERACTION FROM THE COMMAND LINE RUNNING THE ENGINE RUNNING WITHOUT THE KASP DEBUGGING ------------------------------------------------------------------- INTRODUCTION ------------------------------------------------------------------- As part of the OpenDNSSEC project, the task of the signer engine is to schedule signing operation on DNS zones. Taking input from the KASP, it will automatically sign zones and keep their signatures up-to-date. Until version 1.3, OpenDNSSEC could only handle file-to-file signing. With the Zonefetcher enabled, AXFR-to-file signing was possible. Version 1.4 and up can handle unsigned zones in file, AXFR and IXFR format, as well as output signed zones as file, AXFR and IXFR. When a zone has changed, the engine can run a specified command, for instance to signal an actual DNS server that it should reload its zones (useful for file output). The signer engine has a scheduler, including a set of workers to do zone manipulation, and zone in- and output is handled by different types of adapters. The signer is written in c is run as a daemon. When a zone needs to be sorted or (re)signed, the workers will report for duty and perform the job. It uses a worker/task-queue design, where the worker threads will suspend until there is something to do. ------------------------------------------------------------------- DEPENDENCIES ------------------------------------------------------------------- The signer depends on the ldns library: http://www.NLnetLabs.nl/projects/ldns and can only be used in conjuction with a PKCS#11 library (a software version of which, softHSM, is supplied with the OpenDNSSEC). ------------------------------------------------------------------- INSTALLATION ------------------------------------------------------------------- The signer is installed as part of the OpenDNSSEC install. To build and install the signer engine separately, the following steps are needed: From the base directory /signer autoreconf --install ./configure make make install The options provided with configure: --with-ldns= The base directory (prefix) of your ldns installation, if it isn't in your standard path. --prefix= Installation directory. All files will be installed relative to this path, and default search paths will be relative to the prefix. Defaults to /usr/local The signer engine will be installed in /sbin ------------------------------------------------------------------- INTERACTION FROM THE COMMAND LINE ------------------------------------------------------------------- If the engine is running (see the next section on how to run one manually), you can interact with it using the tool ods-signer. If you give no arguments, it will connect to the engine and go to interactive mode. Only the start command cannot be called in interactive mode. The command 'help' shows a list of possible commands: $ ods-signer cmd> help Commands: zones show the currently known zones sign schedule zone for immediate (re-)signing sign --all schedule all zones for immediate (re-)signing. clear delete the internal storage of this zone. All signatures will be regenerated on the next re-sign. queue show the current task queue. flush execute all scheduled tasks immediately. update update this zone signer configurations. update [--all] update zone list and all signer configurations. start start the engine. reload reload the engine. running test if the engine is running. stop stop the engine. verbosity set verbosity. cmd> quit You can also use these commands directly from your shell, by giving them as arguments to ods-signer. If you do this, the client will execute the command and quit. ------------------------------------------------------------------- RUNNING THE ENGINE ------------------------------------------------------------------- You can run the engine by calling /sbin/ods-signer start If everything is ok, you should see the following output: $ ./ods-signer start OpenDNSSEC signer engine version 1.4.0 $ The engine has daemonized itself and should be running. You can check that it does by using ods-signer as specified in the section INTERACTION FROM THE COMMAND LINE. ------------------------------------------------------------------- RUNNING WITHOUT THE KASP ------------------------------------------------------------------- If you want to test the engine on its own, or run it without using the KASP module, you will need to perform the following steps. Of course it has to be installed using the steps from section INSTALLATION. HSM --- You will need to set up an HSM module. If you use SoftHSM, you will need to make sure that a token is initialized, and that the correct softhsm.conf file is set in the environment variable $SOFTHSM_CONF. Some keys should be present in the token. If not, you can generate them with the hsm-toolkit from OpenDNSSEC. conf.xml -------- You will need to either create or update the /etc/opendnssec/conf.xml file to your settings; the element should contain the name of the token you have initialized in your HSM, the complete path of the module library (e.g. /lib/libsofthsm.so). Optionally you can use a PIN value here too. If you do not specify it, the engine will prompt for it. If you run a nameserver, you will need to create a little script that tells that server to reload its zones, and point to that script with the element below . The rest of the values can be left to their defaults. The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/conf.rnc zonelist.xml ------------ You can tell the engine what zones to sign with /etc/zonelist.xml An example zone list file can be found at http://www.opendnssec.se/browser/trunk/conf/opendnssec/zonelist.xml The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/zonelist.rnc This file will specify the specific zone configuration, and its in- and output-files. addns.xml ------------ If you use AXFR or IXFR as zone input/output, you can tell the engine where and how to get the zones from the master servers with /etc/addns.xml This can be configured on a per-zone basis in the zonelist.xml file. An example zone list file can be found at http://www.opendnssec.se/browser/trunk/conf/opendnssec/addns.xml The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/addns.rnc This file will specify the interface to listen NOTIFY messages on, the master servers that are allowed to send NOTIFY messages and to contact for zone transfers and optionally, the TSIG credentials. zone file --------- If you use files as input, you obviously will need to give the engine an actual zone file to work on. You will have already specified the location of this file in the zonelist.xml file above. zone configuration ------------------ Finally, at the location pointed to in your zonelist.xml, you should create a signer configuration xml file. An example can be found at: http://www.opendnssec.se/browser/trunk/conf/opendnssec/signconf.xml The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/signconf.rnc Diagnostics ----------- The signer prints statistics about the signed zones into the logs. [STATS] opendnssec.org RR[count=32 time=1(sec)] NSEC[count=32 time=1(sec)] RRSIG[new=1 reused=31 time=1(sec) avg=1(sig/sec)] TOTAL[time=5(sec)] RR[count] is the number of records read in the unsigned zone. It is zero if the zone was not re-read. This happens for example when only re-signing. RR[time] is the time it took to read the unsigned zone. NSEC[count] is the number of NSEC or NSEC3 records added to the zone. This can be zero too, when only re-signing. NSEC[time] is the time it took to create all the Denial of Existence records. RRSIG[new] is the number of signatures newly created. RRSIG[reused] is the number of signatures that were created on a previous run, but are fresh enough that they may be remained in the zone. RRSIG[time] is the time it took to gather all the new and reused signatures. RRSIG[avg] is the average number of created signatures per second. TOTAL[time] is the total time it took for the signer engine to sign the latest version of the zone. ------------------------------------------------------------------- DNS FILE ADAPTERS ------------------------------------------------------------------- As mentioned above, you can use DNS adapters instead of File adapters. Put something like this in your zonelist.xml: ... example.com.dns.xml example.com.dns.xml The example.com.dns.xml holds all master and slave configurations for transfers. ------------------------------------------------------------------- DEBUGGING ------------------------------------------------------------------- Warning: DO NOT TRY THIS EXCEPT FOR DEBUGGING PURPOSES If the signer is build with the '--enable-timeshift' option, one can override the system clock using the ENFORCER_TIMESHIFT environment variable. ENFORCER_TIMESHIFT should be set to the timestamp (in YYYYMMDDHHMMSS format). When running with timeshift, the program will run once only and exit. opendnssec-1.4.3/signer/Makefile.am0000664000175000017500000000054211455342365014137 00000000000000# $Id: Makefile.am 4098 2010-10-13 14:40:53Z matthijs $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src man doxygen: rm -fr $(top_builddir)/signer/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-signer" \ SRCDIR=$(top_srcdir)/signer \ OUTPUTDIR=$(top_builddir)/signer/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) opendnssec-1.4.3/config.sub0000755000175000017500000010517612247571136012606 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # 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 . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. 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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: opendnssec-1.4.3/Makefile.in0000664000175000017500000006640012247571140012661 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6930 2013-01-08 12:31:16Z jakob $ VPATH = @srcdir@ 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@ @ENABLE_SIGNER_TRUE@am__append_1 = signer subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/configure NEWS config.guess config.sub depcomp \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = Doxyfile CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = common libhsm enforcer conf tools signer DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/common/config.h.in $(srcdir)/common/config.h.in~ \ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub SUBDIRS = common libhsm enforcer conf tools $(am__append_1) EXTRA_DIST = $(srcdir)/LICENSE \ $(srcdir)/KNOWN_ISSUES \ $(srcdir)/MIGRATION \ $(srcdir)/plugins/simple-dnskey-mailer/simple-dnskey-mailer.sh all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-data-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am install-data-hook: $(INSTALL) -d $(DESTDIR)$(localstatedir) $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/tmp $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/signconf $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/unsigned $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/signed $(INSTALL) -d $(DESTDIR)$(localstatedir)/run $(INSTALL) -d $(DESTDIR)$(localstatedir)/run/opendnssec docs: (cd libhsm; $(MAKE) doxygen) (cd enforcer; $(MAKE) doxygen) (cd signer; $(MAKE) doxygen) # 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: opendnssec-1.4.3/LICENSE0000664000175000017500000000303611736303111011606 00000000000000$Id: LICENSE 6232 2012-04-02 10:58:17Z matthijs $ Copyright (c) 2012 OpenDNSSEC AB (svb). All rights reserved. Copyright (c) 2011 SURFnet bv. All rights reserved. Copyright (c) 2008 .SE (The Internet Infrastructure Foundation). All rights reserved. Copyright (c) 2008 NLnet Labs. All rights reserved. Copyright (c) 2008 Nominet UK. 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, 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 ``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 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. opendnssec-1.4.3/Doxyfile.in0000664000175000017500000017413711427765052012744 00000000000000# Doxyfile 1.5.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = $(PROJECT_NAME) # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = $(OUTPUTDIR) # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, # Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = $(SRCDIR) # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = checks/* # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = */.svn/* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = $(GENERATE_HTML) # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = $(GENERATE_HTMLHELP) # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = $(GENERATE_CHI) # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which # disables this behavior completely. For backwards compatibility with previous # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE # respectively. GENERATE_TREEVIEW = NONE # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = $(GENERATE_LATEX) # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = $(GENERATE_RTF) # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = $(GENERATE_XML) # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = $(HAVE_DOT) # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = NO # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = $(DOT_PATH) # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Options related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO opendnssec-1.4.3/configure0000775000175000017500000232714712247571134012540 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for opendnssec 1.4.3. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 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" 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 \$(( 1 + 1 )) = 2 || 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" 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 : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} 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 and $0: http://bugs.opendnssec.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_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; } # 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &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='opendnssec' PACKAGE_TARNAME='opendnssec' PACKAGE_VERSION='1.4.3' PACKAGE_STRING='opendnssec 1.4.3' PACKAGE_BUGREPORT='http://bugs.opendnssec.org/' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS DOXYGEN_PAPER_SIZE DX_COND_latex_FALSE DX_COND_latex_TRUE DX_COND_pdf_FALSE DX_COND_pdf_TRUE DX_PDFLATEX DX_FLAG_pdf DX_COND_ps_FALSE DX_COND_ps_TRUE DX_EGREP DX_DVIPS DX_MAKEINDEX DX_LATEX DX_FLAG_ps DX_COND_html_FALSE DX_COND_html_TRUE DX_FLAG_html DX_COND_chi_FALSE DX_COND_chi_TRUE DX_FLAG_chi DX_COND_chm_FALSE DX_COND_chm_TRUE DX_HHC DX_FLAG_chm DX_COND_xml_FALSE DX_COND_xml_TRUE DX_FLAG_xml DX_COND_rtf_FALSE DX_COND_rtf_TRUE DX_FLAG_rtf DX_COND_man_FALSE DX_COND_man_TRUE DX_FLAG_man DX_COND_dot_FALSE DX_COND_dot_TRUE DX_DOT DX_FLAG_dot DX_COND_doc_FALSE DX_COND_doc_TRUE DX_PERL DX_DOXYGEN DX_FLAG_doc DX_ENV DX_DOCDIR DX_CONFIG DX_PROJECT WITH_CUCUMBER_FALSE WITH_CUCUMBER_TRUE CUCUMBER ENABLE_SIGNER_FALSE ENABLE_SIGNER_TRUE WITH_CUNIT_FALSE WITH_CUNIT_TRUE ENABLE_ENFORCER_FALSE ENABLE_ENFORCER_TRUE CUNIT_LIBS CUNIT_INCLUDES USE_MYSQL_FALSE USE_MYSQL_TRUE DB_LIBS DB_INCLUDES DB_TYPE MYSQL_LIBS MYSQL_INCLUDES MYSQL MYSQL_CONFIG SQLITE3_LIBS SQLITE3_INCLUDES SQLITE3 DB_PASS DB_USER DB_PORT DB_HOST DB_NAME PERL SSL_LIBS SSL_INCLUDES HAVE_SSL C_LIBS RT_LIBS pkcs11_aepkeyper_module pkcs11_ncipher_module pkcs11_opensc_module pkcs11_etoken_module pkcs11_sca6000_module pkcs11_softhsm_module LDNS_LIBS LDNS_INCLUDES LDNS_CONFIG XML2_LIBS XML2_INCLUDES XML2_CONFIG LIBOBJS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config CP JAVA XSLTPROC XMLLINT OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL EGREP GREP CPP 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 OPENDNSSEC_SIGNER_CLI OPENDNSSEC_SIGNER_ENGINE OPENDNSSEC_SIGNER_SOCKET OPENDNSSEC_FETCH_PIDFILE OPENDNSSEC_ENFORCER_PIDFILE OPENDNSSEC_SIGNER_PIDFILE OPENDNSSEC_STATE_DIR OPENDNSSEC_SCHEMA_DIR OPENDNSSEC_CONFIG_FILE OPENDNSSEC_CONFIG_DIR OPENDNSSEC_PID_DIR OPENDNSSEC_LOCALSTATE_DIR OPENDNSSEC_SYSCONF_DIR OPENDNSSEC_DATA_DIR OPENDNSSEC_LIBEXEC_DIR OPENDNSSEC_LIB_DIR OPENDNSSEC_SBIN_DIR OPENDNSSEC_BIN_DIR 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_rpath enable_pedantic enable_strict enable_timeshift with_libxml2 with_ldns with_pkcs11_softhsm with_pkcs11_sca6000 with_pkcs11_etoken with_pkcs11_opensc with_pkcs11_ncipher with_pkcs11_aepkeyper with_ssl with_dbname with_dbhost with_dbport with_dbuser with_dbpass with_database_backend with_sqlite3 with_mysql with_cunit enable_signer enable_doxygen_doc enable_doxygen_dot enable_doxygen_man enable_doxygen_rtf enable_doxygen_xml enable_doxygen_chm enable_doxygen_chi enable_doxygen_html enable_doxygen_ps enable_doxygen_pdf ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP DOXYGEN_PAPER_SIZE' # 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_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) 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 $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi 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 opendnssec 1.4.3 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/opendnssec] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of opendnssec 1.4.3:";; esac 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] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --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) --disable-rpath disable hardcoded rpath (default=enabled) --enable-pedantic enable pedantic compile mode [enabled] --enable-strict enable strict compile mode [enabled] --enable-timeshift Enable timeshift debug --disable-signer Disable signer build (default enabled) --disable-doxygen-doc don't generate any doxygen documentation --disable-doxygen-dot don't generate graphics for doxygen documentation --enable-doxygen-man generate doxygen manual pages --enable-doxygen-rtf generate doxygen RTF documentation --enable-doxygen-xml generate doxygen XML documentation --enable-doxygen-chm generate doxygen compressed HTML help documentation --enable-doxygen-chi generate doxygen seperate compressed HTML help index file --disable-doxygen-html don't generate doxygen plain HTML documentation --enable-doxygen-ps generate doxygen PostScript documentation --enable-doxygen-pdf generate doxygen PDF documentation 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). --with-libxml2=DIR look for libxml2 in this dir --with-ldns=PATH specify prefix of path of ldns library to use --with-pkcs11-softhsm=PATH specify path of SoftHSM PKCS#11 library (default PREFIX/lib/softhsm/libsofthsm.so) --with-pkcs11-sca6000=PATH specify path of SCA/6000 PKCS#11 library (default /usr/lib/libpkcs11.so) --with-pkcs11-etoken=PATH specify path of Aladdin eToken PKCS#11 library (default /usr/local/lib/libeTPkcs11.so) --with-pkcs11-opensc=PATH specify path of OpenSC PKCS#11 library (default /usr/lib/pkcs11/opensc-pkcs11.so) --with-pkcs11-ncipher=PATH specify path of nCipher PKCS#11 library (default /opt/nfast/toolkits/pkcs11/libcknfast.so) --with-pkcs11-aepkeyper=PATH specify path of AEP Keyper PKCS#11 library (default /opt/Keyper/PKCS11Provider/pkcs11.so) --with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr) --with-dbname=DB_NAME Database name/schema for unit tests --with-dbhost=DB_HOST Database host for unit tests --with-dbport=DB_PORT Database port for unit tests --with-dbuser=DB_USER Database user for unit tests --with-dbpass=DB_PASS Database password for unit tests --with-database-backend Select database backend (sqlite3|mysql) --with-sqlite3=PATH Specify prefix of path of SQLite3 --with-mysql=DIR Specify prefix of path of MySQL --with-cunit=DIR Look for cunit in this dir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor DOXYGEN_PAPER_SIZE a4wide (default), a4, letter, legal or executive Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { 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 opendnssec configure 1.4.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF 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_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_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;} ( $as_echo "## ------------------------------------------ ## ## Report this to http://bugs.opendnssec.org/ ## ## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&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 # 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_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_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 || $as_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_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 declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #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_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $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_member 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 opendnssec $as_me 1.4.3, which was generated by GNU Autoconf 2.68. 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 as_fn_append ac_header_list " sys/time.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_func_list " alarm" # 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 am__api_version='1.11' 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else 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; } # Just in case sleep 1 echo timestamp > conftest.file # 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 ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi 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; } 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi 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; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $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='opendnssec' VERSION='1.4.3' 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"} # 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 -' 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='opendnssec' VERSION='1.4.3' 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"} # 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 -' case "$prefix" in NONE) case "$sysconfdir" in '${prefix}/etc') sysconfdir=/etc ac_configure_args="$ac_configure_args --sysconfdir=$sysconfdir" { $as_echo "$as_me:${as_lineno-$LINENO}: sysconfdir set to $sysconfdir" >&5 $as_echo "$as_me: sysconfdir set to $sysconfdir" >&6;} ;; esac case "$localstatedir" in '${prefix}/var') localstatedir=/var ac_configure_args="$ac_configure_args --localstatedir=$localstatedir" { $as_echo "$as_me:${as_lineno-$LINENO}: localstate set to $localstatedir" >&5 $as_echo "$as_me: localstate set to $localstatedir" >&6;} ;; esac ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: Detecting common OpenDNSSEC settings" >&5 $as_echo "$as_me: Detecting common OpenDNSSEC settings" >&6;} full_bindir=`eval eval eval eval eval echo "${bindir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_sbindir=`eval eval eval eval eval echo "${sbindir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_libdir=`eval eval eval eval eval echo "${libdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_libexecdir=`eval eval eval eval eval echo "${libexecdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_datadir=`eval eval eval eval eval echo "${datadir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_sysconfdir=`eval eval eval eval eval echo "${sysconfdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_localstatedir=`eval eval eval eval eval echo "${localstatedir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` OPENDNSSEC_BIN_DIR=$full_bindir OPENDNSSEC_SBIN_DIR=$full_sbindir OPENDNSSEC_LIB_DIR=$full_libdir/opendnssec OPENDNSSEC_LIBEXEC_DIR=$full_libexecdir/opendnssec OPENDNSSEC_DATA_DIR=$full_datadir/opendnssec OPENDNSSEC_SYSCONF_DIR=$full_sysconfdir/opendnssec OPENDNSSEC_LOCALSTATE_DIR="$full_localstatedir/opendnssec" OPENDNSSEC_PID_DIR="$full_localstatedir/run/opendnssec" OPENDNSSEC_CONFIG_DIR=$OPENDNSSEC_SYSCONF_DIR OPENDNSSEC_CONFIG_FILE=$OPENDNSSEC_SYSCONF_DIR/conf.xml OPENDNSSEC_SCHEMA_DIR=$OPENDNSSEC_DATA_DIR OPENDNSSEC_STATE_DIR=$OPENDNSSEC_LOCALSTATE_DIR cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_CONFIG_DIR "$OPENDNSSEC_CONFIG_DIR" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_CONFIG_FILE "$OPENDNSSEC_CONFIG_FILE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SCHEMA_DIR "$OPENDNSSEC_SCHEMA_DIR" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_STATE_DIR "$OPENDNSSEC_STATE_DIR" _ACEOF OPENDNSSEC_SIGNER_PIDFILE=$OPENDNSSEC_PID_DIR/signerd.pid OPENDNSSEC_ENFORCER_PIDFILE=$OPENDNSSEC_PID_DIR/enforcerd.pid OPENDNSSEC_FETCH_PIDFILE=$OPENDNSSEC_PID_DIR/zone_fetcher.pid cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_PIDFILE "$OPENDNSSEC_SIGNER_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_ENFORCER_PIDFILE "$OPENDNSSEC_ENFORCER_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_FETCH_PIDFILE "$OPENDNSSEC_FETCH_PIDFILE" _ACEOF # signer specific OPENDNSSEC_SIGNER_SOCKET=$OPENDNSSEC_PID_DIR/engine.sock OPENDNSSEC_SIGNER_ENGINE=$OPENDNSSEC_SBIN_DIR/ods-signerd OPENDNSSEC_SIGNER_CLI=$OPENDNSSEC_SBIN_DIR/ods-signer OPENDNSSEC_SIGNER_WORKINGDIR=$OPENDNSSEC_STATE_DIR/tmp cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_SOCKET "$OPENDNSSEC_SIGNER_SOCKET" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_ENGINE "$OPENDNSSEC_SIGNER_ENGINE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_CLI "$OPENDNSSEC_SIGNER_CLI" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_PIDFILE "$OPENDNSSEC_SIGNER_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_ZF_PIDFILE "$OPENDNSSEC_FETCH_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_SOCKFILE "$OPENDNSSEC_SIGNER_SOCKET" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_WORKDIR "$OPENDNSSEC_SIGNER_WORKINGDIR" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_CFGFILE "$OPENDNSSEC_CONFIG_FILE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_RNGDIR "$OPENDNSSEC_SCHEMA_DIR" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_ENGINE "$OPENDNSSEC_SIGNER_ENGINE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_CLI "$OPENDNSSEC_SIGNER_CLI" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_MAXLINE 1024 _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_MAX_BACKOFF 3600 _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_WORKERTHREADS 4 _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_STOP_RESPONSE "Engine shut down." _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_FILE_MAGIC_V3 ";OpenDNSSEC-backup-v3" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_FILE_MAGIC_V2 ";ODSSE2" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_FILE_MAGIC_V1 ";ODSSE1" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_VERBOSITY 3 _ACEOF # enforcer specific OPENDNSSEC_ENFORCER_CONTROL=$OPENDNSSEC_SBIN_DIR/ods-control OPENDNSSEC_ENFORCER_KASPCHECK=$OPENDNSSEC_BIN_DIR/ods-kaspcheck cat >>confdefs.h <<_ACEOF #define ODS_EN_CONTROL "$OPENDNSSEC_ENFORCER_CONTROL enforcer " _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_EN_NOTIFY "$OPENDNSSEC_ENFORCER_CONTROL enforcer notify" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_EN_KASPCHECK "$OPENDNSSEC_ENFORCER_KASPCHECK" _ACEOF # extensions 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $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 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 #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 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 8's {/usr,}/bin/sh. touch 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 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 8's {/usr,}/bin/sh. touch 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 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 to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #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 _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 to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #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 _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 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" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $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" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $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 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 #include #include #include 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 _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 _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 #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF 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 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # standard programs 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $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 { $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 #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 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 8's {/usr,}/bin/sh. touch 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 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 8's {/usr,}/bin/sh. touch 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 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" { test -f "$ac_path_SED" && $as_test_x "$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 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" { test -f "$ac_path_FGREP" && $as_test_x "$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 &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 &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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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* | netbsdelf*-gnu) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 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* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... 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 ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=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 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* | netbsdelf*-gnu) 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 link_all_deplibs=no 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* | netbsdelf*-gnu) 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.so # instead of lib.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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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 #endif #include #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 #endif #include #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: { $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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_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 # additional programs # Extract the first word of "xmllint", so it can be a program name with args. set dummy xmllint; 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_path_XMLLINT+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLLINT in [\\/]* | ?:[\\/]*) ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi XMLLINT=$ac_cv_path_XMLLINT if test -n "$XMLLINT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 $as_echo "$XMLLINT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; 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_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "java", so it can be a program name with args. set dummy java; 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_path_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVA in [\\/]* | ?:[\\/]*) ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi JAVA=$ac_cv_path_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; 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_path_CP+:} false; then : $as_echo_n "(cached) " >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 $as_echo "$CP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat >>confdefs.h <<_ACEOF #define CP_COMMAND "$CP" _ACEOF # building # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; enable_rpath=$enableval else enable_rpath=yes fi if test "x$enable_rpath" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Fixing libtool for -rpath problems." >&5 $as_echo "Fixing libtool for -rpath problems." >&6; } sed < libtool > libtool-2 \ 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/' mv libtool-2 libtool chmod 755 libtool libtool="./libtool" fi if test "x$enable_rpath" = xyes; then if echo "" | grep "^/" >/dev/null; then RUNTIME_PATH="$RUNTIME_PATH -R" fi fi # Check whether --enable-pedantic was given. if test "${enable_pedantic+set}" = set; then : enableval=$enable_pedantic; else enable_pedantic="yes" fi if test "${enable_pedantic}" = "yes"; then enable_strict="yes"; CFLAGS="${CFLAGS} -pedantic" fi # Check whether --enable-strict was given. if test "${enable_strict+set}" = set; then : enableval=$enable_strict; else enable_strict="yes" fi if test "${enable_strict}" = "yes"; then CFLAGS="${CFLAGS} -Wall -Wextra" fi # compiler flags { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5 $as_echo_n "checking whether $CC supports -std=c99... " >&6; } cache=`echo std=c99 | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(){}' >conftest.c if test -z "`$CC -std=c99 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : C99FLAG="-std=c99" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5 $as_echo_n "checking whether $CC supports -xc99... " >&6; } cache=`echo xc99 | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(){}' >conftest.c if test -z "`$CC -xc99 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : C99FLAG="-xc99" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG as a flag for $CC" >&5 $as_echo_n "checking whether we need $C99FLAG as a flag for $CC... " >&6; } cache=`echo $C99FLAG | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_needed_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo '#include ' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else if test -z "`$CC $CFLAGS $C99FLAG -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else echo 'Test with flag fails too' fi fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="$CFLAGS $C99FLAG" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D__EXTENSIONS__ as a flag for $CC" >&5 $as_echo_n "checking whether we need -D__EXTENSIONS__ as a flag for $CC... " >&6; } cache=`echo -D__EXTENSIONS__ | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_needed_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo ' #include "confdefs.h" #include #include int test() { int a; char **opts = NULL; a = getopt(2, opts, "a"); return a; } ' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else if test -z "`$CC $CFLAGS -D__EXTENSIONS__ -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else echo 'Test with flag fails too' fi fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="-D__EXTENSIONS__ $CFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi # checks for header files { $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 #include #include #include 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 _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 _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 #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in fcntl.h inttypes.h stdio.h stdlib.h string.h syslog.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_H 1 _ACEOF else $ac_includes_default fi done for ac_header in errno.h getopt.h pthread.h signal.h stdarg.h stdint.h strings.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 libxml/parser.h libxml/relaxng.h libxml/xmlreader.h libxml/xpath.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 # checks for typedefs, structures, and compiler characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun" >&5 $as_echo_n "checking for union semun... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { union semun arg; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_union_semun=1 else have_union_semun=0 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $have_union_semun = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_UNION_SEMUN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # pthread 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } 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 pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case ${host_os} in solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; 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_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ax_pthread_config="yes" $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 test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case ${host_os} in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; osf* | hpux*) flag="-D_REENTRANT";; solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" # checks for library functions for ac_func in arc4random arc4random_uniform do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in dup2 endpwent select strerror strtol do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpass getpassphrase memset do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in localtime_r memset strdup strerror strstr strtol strtoul do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in setregid setreuid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in chown stat exit time atoi getpid waitpid sigfillset do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in malloc calloc realloc free do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strlen strncmp strncat strncpy strerror strncasecmp strdup do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fgetc fopen fclose ferror fprintf vsnprintf snprintf fflush do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in openlog closelog syslog do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in openlog_r closelog_r syslog_r vsyslog_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in chroot getgroups setgroups initgroups do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in close unlink fcntl socket listen bzero do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in va_start va_end do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in xmlInitParser xmlCleanupParser xmlCleanupThreads do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pthread_cond_init pthread_cond_signal pthread_cond_destroy pthread_cond_wait pthread_cond_timedwait do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pthread_create pthread_detach pthread_self pthread_join pthread_sigmask do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "#define HAVE_CHOWN 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in $ac_header_list 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_func in $ac_func_list do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } if ${ac_cv_func_working_mktime+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_working_mktime=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static const char *tz_strings[] = { (const char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (int j) { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (;;) { t = (time_t_max << 1) + 1; if (t <= time_t_max) break; time_t_max = t; } time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv ((char*) tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; ; j <<= 1) if (! bigtime_test (j)) return 1; else if (INT_MAX / 2 < j) break; if (! bigtime_test (INT_MAX)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_working_mktime=yes else ac_cv_func_working_mktime=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 $as_echo "$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then case " $LIBOBJS " in *" mktime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes; then : $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h else case " $LIBOBJS " in *" strlcat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcat.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes; then : $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h else case " $LIBOBJS " in *" strlcpy.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "b64_pton" "ac_cv_func_b64_pton" if test "x$ac_cv_func_b64_pton" = xyes; then : $as_echo "#define HAVE_B64_PTON 1" >>confdefs.h else case " $LIBOBJS " in *" b64_pton.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS b64_pton.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "b64_ntop" "ac_cv_func_b64_ntop" if test "x$ac_cv_func_b64_ntop" = xyes; then : $as_echo "#define HAVE_B64_NTOP 1" >>confdefs.h else case " $LIBOBJS " in *" b64_ntop.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS b64_ntop.$ac_objext" ;; esac fi for ac_func in setresuid do : ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid" if test "x$ac_cv_func_setresuid" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETRESUID 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setresuid seems to work" >&5 $as_echo_n "checking if setresuid seems to work... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking setresuid" >&5 $as_echo "$as_me: WARNING: cross compiling: not checking setresuid" >&2;} else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define BROKEN_SETRESUID 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: not implemented" >&5 $as_echo "not implemented" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi done for ac_func in setresgid do : ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid" if test "x$ac_cv_func_setresgid" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETRESGID 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setresgid seems to work" >&5 $as_echo_n "checking if setresgid seems to work... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking setresuid" >&5 $as_echo "$as_me: WARNING: cross compiling: not checking setresuid" >&2;} else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define BROKEN_SETRESGID 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: not implemented" >&5 $as_echo "not implemented" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strptime needs defines" >&5 $as_echo_n "checking whether strptime needs defines... " >&6; } if ${ac_cv_c_strptime_needs_defs+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.c < void testing (void) { struct tm t; char *timestr; strptime(timestr, "%Y%m", &t); } EOF if test -z "`$CC -Wall -Werror -c conftest.c 2>&1`"; then eval "ac_cv_c_strptime_needs_defs=no" else eval "ac_cv_c_strptime_needs_defs=yes" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_strptime_needs_defs" >&5 $as_echo "$ac_cv_c_strptime_needs_defs" >&6; } if test $ac_cv_c_strptime_needs_defs = yes; then cat >>confdefs.h <<_ACEOF #define STRPTIME_NEEDS_DEFINES 1 _ACEOF fi # check for some target-specific stuff case "$host" in *-*-darwin*) $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h ;; esac # check for the sockaddr_un.sun_len member ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_len" "ac_cv_member_struct_sockaddr_un_sun_len" " #include #include " if test "x$ac_cv_member_struct_sockaddr_un_sun_len" = xyes; then : $as_echo "#define HAVE_SOCKADDR_SUN_LEN 1" >>confdefs.h fi # timeshift # Check whether --enable-timeshift was given. if test "${enable_timeshift+set}" = set; then : enableval=$enable_timeshift; enable_timeshift="${enableval}" else enable_timeshift="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable timeshift debugging" >&5 $as_echo_n "checking if we should enable timeshift debugging... " >&6; } if test "x${enable_timeshift}" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define ENFORCER_TIMESHIFT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # common dependencies # Check whether --with-libxml2 was given. if test "${with_libxml2+set}" = set; then : withval=$with_libxml2; XML2_PATH="$withval" for ac_prog in xml2-config 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_path_XML2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $XML2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $XML2_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi XML2_CONFIG=$ac_cv_path_XML2_CONFIG if test -n "$XML2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 $as_echo "$XML2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XML2_CONFIG" && break done test -n "$XML2_CONFIG" || XML2_CONFIG="xml2-config" else XML2_PATH="/usr/local" for ac_prog in xml2-config 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_path_XML2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $XML2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi XML2_CONFIG=$ac_cv_path_XML2_CONFIG if test -n "$XML2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 $as_echo "$XML2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XML2_CONFIG" && break done test -n "$XML2_CONFIG" || XML2_CONFIG="xml2-config" fi if test -x "$XML2_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the xml2 includes" >&5 $as_echo_n "checking what are the xml2 includes... " >&6; } XML2_INCLUDES="`$XML2_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_INCLUDES" >&5 $as_echo "$XML2_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the xml2 libs" >&5 $as_echo_n "checking what are the xml2 libs... " >&6; } XML2_LIBS="`$XML2_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_LIBS" >&5 $as_echo "$XML2_LIBS" >&6; } tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $XML2_INCLUDES" LIBS="$LIBS $XML2_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlDocGetRootElement in -lxml2" >&5 $as_echo_n "checking for xmlDocGetRootElement in -lxml2... " >&6; } if ${ac_cv_lib_xml2_xmlDocGetRootElement+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxml2 $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 xmlDocGetRootElement (); int main () { return xmlDocGetRootElement (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xml2_xmlDocGetRootElement=yes else ac_cv_lib_xml2_xmlDocGetRootElement=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_xml2_xmlDocGetRootElement" >&5 $as_echo "$ac_cv_lib_xml2_xmlDocGetRootElement" >&6; } if test "x$ac_cv_lib_xml2_xmlDocGetRootElement" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXML2 1 _ACEOF LIBS="-lxml2 $LIBS" else as_fn_error $? "Can't find libxml2 library" "$LINENO" 5 fi CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS else as_fn_error $? "libxml2 required, but not found." "$LINENO" 5 fi # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; LDNS_PATH="$withval" for ac_prog in ldns-config 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_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LDNS_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" else LDNS_PATH="/usr/local" for ac_prog in ldns-config 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_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" fi if test -x "$LDNS_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="`$LDNS_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="-I$LDNS_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="-L$LDNS_PATH/lib -lldns" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } fi tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" LIBS="$LIBS $LDNS_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns_rr_new in -lldns" >&5 $as_echo_n "checking for ldns_rr_new in -lldns... " >&6; } if ${ac_cv_lib_ldns_ldns_rr_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldns $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 ldns_rr_new (); int main () { return ldns_rr_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldns_ldns_rr_new=yes else ac_cv_lib_ldns_ldns_rr_new=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_ldns_ldns_rr_new" >&5 $as_echo "$ac_cv_lib_ldns_ldns_rr_new" >&6; } if test "x$ac_cv_lib_ldns_ldns_rr_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDNS 1 _ACEOF LIBS="-lldns $LIBS" else as_fn_error $? "Can't find ldns library" "$LINENO" 5 fi LIBS=$tmp_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns version" >&5 $as_echo_n "checking for ldns version... " >&6; } CHECK_LDNS_VERSION=0x01060c 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 "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION >= $CHECK_LDNS_VERSION) return 0; #endif return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: >= 1.6.12" >&5 $as_echo ">= 1.6.12" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: < 1.6.12" >&5 $as_echo "< 1.6.12" >&6; } as_fn_error $? "ldns library too old (1.6.12 or later required)" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext 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 CPPFLAGS=$tmp_CPPFLAGS # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; LDNS_PATH="$withval" for ac_prog in ldns-config 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_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LDNS_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" else LDNS_PATH="/usr/local" for ac_prog in ldns-config 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_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" fi if test -x "$LDNS_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="`$LDNS_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="-I$LDNS_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="-L$LDNS_PATH/lib -lldns" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } fi tmp_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns version not 1.6.14" >&5 $as_echo_n "checking for ldns version not 1.6.14... " >&6; } CHECK_LDNS_VERSION=0x01060e 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 "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION != $CHECK_LDNS_VERSION) return 0; #endif return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "ldns version 1.6.14 is not compatible due to binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext 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 CPPFLAGS=$tmp_CPPFLAGS # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; LDNS_PATH="$withval" for ac_prog in ldns-config 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_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LDNS_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" else LDNS_PATH="/usr/local" for ac_prog in ldns-config 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_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" fi if test -x "$LDNS_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="`$LDNS_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="-I$LDNS_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="-L$LDNS_PATH/lib -lldns" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } fi tmp_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns version not 1.6.15" >&5 $as_echo_n "checking for ldns version not 1.6.15... " >&6; } CHECK_LDNS_VERSION=0x01060f 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 "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION != $CHECK_LDNS_VERSION) return 0; #endif return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "ldns version 1.6.15 is not compatible due to fail to create NSEC3 bitmap for empty non-terminals, see http://www.nlnetlabs.nl/pipermail/ldns-users/2012-November/000565.html" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext 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 CPPFLAGS=$tmp_CPPFLAGS # Check whether --with-pkcs11-softhsm was given. if test "${with_pkcs11_softhsm+set}" = set; then : withval=$with_pkcs11_softhsm; pkcs11_softhsm_module="$withval" else pkcs11_softhsm_module="$full_libdir/softhsm/libsofthsm.so" fi # Check whether --with-pkcs11-sca6000 was given. if test "${with_pkcs11_sca6000+set}" = set; then : withval=$with_pkcs11_sca6000; pkcs11_sca6000_module="$withval" else pkcs11_sca6000_module="/usr/lib/libpkcs11.so" fi # Check whether --with-pkcs11-etoken was given. if test "${with_pkcs11_etoken+set}" = set; then : withval=$with_pkcs11_etoken; pkcs11_etoken_module="$withval" else pkcs11_etoken_module="/usr/local/lib/libeTPkcs11.so" fi # Check whether --with-pkcs11-opensc was given. if test "${with_pkcs11_opensc+set}" = set; then : withval=$with_pkcs11_opensc; pkcs11_opensc_module="$withval" else pkcs11_opensc_module="/usr/lib/pkcs11/opensc-pkcs11.so" fi # Check whether --with-pkcs11-ncipher was given. if test "${with_pkcs11_ncipher+set}" = set; then : withval=$with_pkcs11_ncipher; pkcs11_ncipher_module="$withval" else pkcs11_ncipher_module="/opt/nfast/toolkits/pkcs11/libcknfast.so" fi # Check whether --with-pkcs11-aepkeyper was given. if test "${with_pkcs11_aepkeyper+set}" = set; then : withval=$with_pkcs11_aepkeyper; pkcs11_aepkeyper_module="$withval" else pkcs11_aepkeyper_module="/opt/Keyper/PKCS11Provider/pkcs11.so" fi RT_LIBS="-lrt" tmp_LIBS=$LIBS LIBS="$LIBS $RT_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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 clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=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_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h else RT_LIBS="" fi LIBS=$tmp_LIBS for ac_header in sys/time.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 if test "x$RT_LIBS" = "x" ; then ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : else as_fn_error $? "Could not find the function clock_gettime or gettimeofday" "$LINENO" 5 fi fi C_LIBS="-lc" # some checks could go in here # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then : withval=$with_ssl; else withval="yes" fi if test x_$withval != x_no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL" >&5 $as_echo_n "checking for SSL... " >&6; } if test x_$withval = x_ -o x_$withval = x_yes; then withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr" fi for dir in $withval; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl="yes"; cat >>confdefs.h <<_ACEOF #define HAVE_SSL /**/ _ACEOF if test x_$ssldir != x_/usr; then SSL_INCLUDES="$SSL_INCLUDES -I$ssldir/include"; fi break; fi done if test x_$found_ssl != x_yes; then as_fn_error $? "Cannot find the SSL libraries in $withval" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in $ssldir" >&5 $as_echo "found in $ssldir" >&6; } HAVE_SSL=yes if test x_$ssldir != x_/usr; then SSL_LIBS="$SSL_LIBS -L$ssldir/lib"; fi if test x_$ssldir = x_/usr/sfw; then SSL_LIBS="$SSL_LIBS -R$ssldir/lib"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_CTX_init in -lcrypto" >&5 $as_echo_n "checking for HMAC_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_HMAC_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $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 HMAC_CTX_init (); int main () { return HMAC_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_HMAC_CTX_init=yes else ac_cv_lib_crypto_HMAC_CTX_init=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_crypto_HMAC_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_HMAC_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_HMAC_CTX_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else as_fn_error $? "OpenSSL found in $ssldir, but version 0.9.7 or higher is required" "$LINENO" 5 fi for ac_func in EVP_sha1 EVP_sha256 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi fi # libhsm tmp_SUCCESS="no" # Unix ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h tmp_SUCCESS="yes" 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 : $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h LIBS="$LIBS -ldl" tmp_SUCCESS="yes" fi fi # Windows if test "$tmp_SUCCESS" = "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LoadLibrary" >&5 $as_echo_n "checking for LoadLibrary... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { LoadLibrary(NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LOADLIBRARY 1" >>confdefs.h tmp_SUCCESS="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tmp_SUCCESS" >&5 $as_echo "$tmp_SUCCESS" >&6; } fi if test "$tmp_SUCCESS" = "no" then as_fn_error $? "No dynamic library loading support" "$LINENO" 5 fi cat >>confdefs.h <<_ACEOF #define HSM_DEFAULT_CONFIG "$OPENDNSSEC_CONFIG_FILE" _ACEOF # enforcer # Extract the first word of "perl", so it can be a program name with args. set dummy perl; 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_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi # Check whether --with-dbname was given. if test "${with_dbname+set}" = set; then : withval=$with_dbname; DB_NAME="$withval" fi # Check whether --with-dbhost was given. if test "${with_dbhost+set}" = set; then : withval=$with_dbhost; DB_HOST="$withval" fi # Check whether --with-dbport was given. if test "${with_dbport+set}" = set; then : withval=$with_dbport; DB_PORT="$withval" fi # Check whether --with-dbuser was given. if test "${with_dbuser+set}" = set; then : withval=$with_dbuser; DB_USER="$withval" fi # Check whether --with-dbpass was given. if test "${with_dbpass+set}" = set; then : withval=$with_dbpass; DB_PASS="$withval" fi # Check whether --with-database-backend was given. if test "${with_database_backend+set}" = set; then : withval=$with_database_backend; database_backend="${withval}" else database_backend="sqlite3" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for database backend" >&5 $as_echo_n "checking for database backend... " >&6; } if test "x${database_backend}" = "xsqlite3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: SQLite3" >&5 $as_echo "SQLite3" >&6; } # Check whether --with-sqlite3 was given. if test "${with_sqlite3+set}" = set; then : withval=$with_sqlite3; SQLITE3_PATH="$withval" for ac_prog in sqlite3 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_path_SQLITE3+:} false; then : $as_echo_n "(cached) " >&6 else case $SQLITE3 in [\\/]* | ?:[\\/]*) ac_cv_path_SQLITE3="$SQLITE3" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $withval/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SQLITE3="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi SQLITE3=$ac_cv_path_SQLITE3 if test -n "$SQLITE3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3" >&5 $as_echo "$SQLITE3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SQLITE3" && break done test -n "$SQLITE3" || SQLITE3="sqlite3" else SQLITE3_PATH="/usr/local" for ac_prog in sqlite3 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_path_SQLITE3+:} false; then : $as_echo_n "(cached) " >&6 else case $SQLITE3 in [\\/]* | ?:[\\/]*) ac_cv_path_SQLITE3="$SQLITE3" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SQLITE3="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi SQLITE3=$ac_cv_path_SQLITE3 if test -n "$SQLITE3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3" >&5 $as_echo "$SQLITE3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SQLITE3" && break done test -n "$SQLITE3" || SQLITE3="sqlite3" fi if ! test -x "$SQLITE3"; then as_fn_error $? "sqlite3 command not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the SQLite3 includes" >&5 $as_echo_n "checking what are the SQLite3 includes... " >&6; } SQLITE3_INCLUDES="-I$SQLITE3_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3_INCLUDES" >&5 $as_echo "$SQLITE3_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the SQLite3 libs" >&5 $as_echo_n "checking what are the SQLite3 libs... " >&6; } SQLITE3_LIBS="-L$SQLITE3_PATH/lib -lsqlite3" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3_LIBS" >&5 $as_echo "$SQLITE3_LIBS" >&6; } tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $SQLITE3_INCLUDES" LIBS="$LIBS $SQLITE3_LIBS" for ac_header in sqlite3.h do : ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" if test "x$ac_cv_header_sqlite3_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SQLITE3_H 1 _ACEOF else as_fn_error $? "Can't find SQLite3 headers" "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_prepare_v2 in -lsqlite3" >&5 $as_echo_n "checking for sqlite3_prepare_v2 in -lsqlite3... " >&6; } if ${ac_cv_lib_sqlite3_sqlite3_prepare_v2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $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 sqlite3_prepare_v2 (); int main () { return sqlite3_prepare_v2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sqlite3_sqlite3_prepare_v2=yes else ac_cv_lib_sqlite3_sqlite3_prepare_v2=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_sqlite3_sqlite3_prepare_v2" >&5 $as_echo "$ac_cv_lib_sqlite3_sqlite3_prepare_v2" >&6; } if test "x$ac_cv_lib_sqlite3_sqlite3_prepare_v2" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSQLITE3 1 _ACEOF LIBS="-lsqlite3 $LIBS" else as_fn_error $? "Missing SQLite3 library v3.3.9 or greater" "$LINENO" 5 fi CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS DB_TYPE=sqlite3 DB_INCLUDES=$SQLITE3_INCLUDES DB_LIBS=$SQLITE3_LIBS cat >>confdefs.h <<_ACEOF #define SQL_BIN "$SQLITE3" _ACEOF cat >>confdefs.h <<_ACEOF #define SQL_SETUP "$OPENDNSSEC_DATA_DIR/database_create.sqlite3" _ACEOF elif test "x${database_backend}" = "xmysql"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: MySQL" >&5 $as_echo "MySQL" >&6; } # Check whether --with-mysql was given. if test "${with_mysql+set}" = set; then : withval=$with_mysql; MYSQL_PATH="$withval" for ac_prog in mysql_config 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_path_MYSQL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL_CONFIG="$MYSQL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $MYSQL_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG if test -n "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5 $as_echo "$MYSQL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL_CONFIG" && break done test -n "$MYSQL_CONFIG" || MYSQL_CONFIG="mysql_config" for ac_prog in mysql 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_path_MYSQL+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL="$MYSQL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $MYSQL_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MYSQL="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi MYSQL=$ac_cv_path_MYSQL if test -n "$MYSQL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL" >&5 $as_echo "$MYSQL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL" && break done test -n "$MYSQL" || MYSQL="mysql" else MYSQL_PATH="/usr/local" for ac_prog in mysql_config 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_path_MYSQL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL_CONFIG="$MYSQL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG if test -n "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5 $as_echo "$MYSQL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL_CONFIG" && break done test -n "$MYSQL_CONFIG" || MYSQL_CONFIG="mysql_config" for ac_prog in mysql 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_path_MYSQL+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL="$MYSQL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MYSQL="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi MYSQL=$ac_cv_path_MYSQL if test -n "$MYSQL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL" >&5 $as_echo "$MYSQL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL" && break done test -n "$MYSQL" || MYSQL="mysql" fi if test -x "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking mysql version" >&5 $as_echo_n "checking mysql version... " >&6; } MYSQL_VERSION="`$MYSQL_CONFIG --version`" MYSQL_VERSION_MAJOR=`echo "$MYSQL_VERSION" | sed -e 's/\..*//'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_VERSION" >&5 $as_echo "$MYSQL_VERSION" >&6; } if test ${MYSQL_VERSION_MAJOR} -le 4 ; then as_fn_error $? "mysql must be newer than 5.0.0" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the MySQL includes" >&5 $as_echo_n "checking what are the MySQL includes... " >&6; } MYSQL_INCLUDES="`$MYSQL_CONFIG --include` -DBIG_JOINS=1 -DUSE_MYSQL -Wno-long-long" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_INCLUDES" >&5 $as_echo "$MYSQL_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the MySQL libs" >&5 $as_echo_n "checking what are the MySQL libs... " >&6; } MYSQL_LIBS="`$MYSQL_CONFIG --libs_r`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_LIBS" >&5 $as_echo "$MYSQL_LIBS" >&6; } fi if ! test -x "$MYSQL"; then as_fn_error $? "mysql command not found" "$LINENO" 5 fi tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDES" LIBS="$LIBS $MYSQL_LIBS" for ac_header in mysql.h do : ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default" if test "x$ac_cv_header_mysql_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MYSQL_H 1 _ACEOF else as_fn_error $? "Can't find MySQL headers" "$LINENO" 5 fi done CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS DB_TYPE=mysql DB_INCLUDES=$MYSQL_INCLUDES DB_LIBS=$MYSQL_LIBS cat >>confdefs.h <<_ACEOF #define SQL_BIN "$MYSQL" _ACEOF cat >>confdefs.h <<_ACEOF #define SQL_SETUP "$OPENDNSSEC_DATA_DIR/database_create.mysql" _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown" >&5 $as_echo "Unknown" >&6; } as_fn_error $? "Database backend ${database_backend} not supported." "$LINENO" 5 fi if test "x${database_backend}" = "xmysql"; then USE_MYSQL_TRUE= USE_MYSQL_FALSE='#' else USE_MYSQL_TRUE='#' USE_MYSQL_FALSE= fi # Check whether --with-cunit was given. if test "${with_cunit+set}" = set; then : withval=$with_cunit; CUNIT_PATH="$withval" else CUNIT_PATH="/usr/local" fi if test "x$with_cunit" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the cunit includes" >&5 $as_echo_n "checking what are the cunit includes... " >&6; } CUNIT_INCLUDES="-I$CUNIT_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUNIT_INCLUDES" >&5 $as_echo "$CUNIT_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the cunit libs" >&5 $as_echo_n "checking what are the cunit libs... " >&6; } CUNIT_LIBS="-L$CUNIT_PATH/lib -lcunit" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUNIT_LIBS" >&5 $as_echo "$CUNIT_LIBS" >&6; } tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $CUNIT_INCLUDES" LIBS="$LIBS $CUNIT_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CU_run_test in -lcunit" >&5 $as_echo_n "checking for CU_run_test in -lcunit... " >&6; } if ${ac_cv_lib_cunit_CU_run_test+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcunit $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 CU_run_test (); int main () { return CU_run_test (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cunit_CU_run_test=yes else ac_cv_lib_cunit_CU_run_test=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_cunit_CU_run_test" >&5 $as_echo "$ac_cv_lib_cunit_CU_run_test" >&6; } if test "x$ac_cv_lib_cunit_CU_run_test" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCUNIT 1 _ACEOF LIBS="-lcunit $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: Can't find cunit library" >&5 $as_echo "$as_me: Can't find cunit library" >&6;} CUNIT_INCLUDES= CUNIT_LIBS= fi CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS else { $as_echo "$as_me:${as_lineno-$LINENO}: cunit disabled" >&5 $as_echo "$as_me: cunit disabled" >&6;} CUNIT_INCLUDES= CUNIT_LIBS= fi cat >>confdefs.h <<_ACEOF #define SIGNER_CLI_UPDATE "$OPENDNSSEC_SIGNER_CLI update" _ACEOF if test "${enable_signer}" = "yes"; then ENABLE_ENFORCER_TRUE= ENABLE_ENFORCER_FALSE='#' else ENABLE_ENFORCER_TRUE='#' ENABLE_ENFORCER_FALSE= fi # cunit if test "${with_cunit}" != "no" -a -n "$CUNIT_LIBS"; then WITH_CUNIT_TRUE= WITH_CUNIT_FALSE='#' else WITH_CUNIT_TRUE='#' WITH_CUNIT_FALSE= fi # signer # Check whether --enable-signer was given. if test "${enable_signer+set}" = set; then : enableval=$enable_signer; enable_signer="${enableval}" else enable_signer="yes" fi if test "${enable_signer}" = "yes"; then ENABLE_SIGNER_TRUE= ENABLE_SIGNER_FALSE='#' else ENABLE_SIGNER_TRUE='#' ENABLE_SIGNER_FALSE= fi # check for a green cucumber (but only if we can shift time) if test "x${enable_timeshift}" = "xyes"; then # Extract the first word of "cucumber", so it can be a program name with args. set dummy cucumber; 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_path_CUCUMBER+:} false; then : $as_echo_n "(cached) " >&6 else case $CUCUMBER in [\\/]* | ?:[\\/]*) ac_cv_path_CUCUMBER="$CUCUMBER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CUCUMBER="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi CUCUMBER=$ac_cv_path_CUCUMBER if test -n "$CUCUMBER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUCUMBER" >&5 $as_echo "$CUCUMBER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -x "${CUCUMBER}"; then WITH_CUCUMBER_TRUE= WITH_CUCUMBER_FALSE='#' else WITH_CUCUMBER_TRUE='#' WITH_CUCUMBER_FALSE= fi # doxygen # Files: DX_PROJECT=${PACKAGE_NAME} DX_CONFIG=Doxyfile DX_DOCDIR=doxygen-doc # Environment variables used inside doxygen.cfg: DX_ENV="$DX_ENV SRCDIR='$srcdir'" DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" DX_ENV="$DX_ENV DOCDIR='$DX_DOCDIR'" DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" # Doxygen itself: # Check whether --enable-doxygen-doc was given. if test "${enable_doxygen_doc+set}" = set; then : enableval=$enable_doxygen_doc; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_doc=1 ;; #( n|N|no|No|NO) DX_FLAG_doc=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 ;; esac else DX_FLAG_doc=1 fi if test "$DX_FLAG_doc" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. set dummy ${ac_tool_prefix}doxygen; 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_path_DX_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN if test -n "$DX_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 $as_echo "$DX_DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_DOXYGEN"; then ac_pt_DX_DOXYGEN=$DX_DOXYGEN # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_path_ac_pt_DX_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN if test -n "$ac_pt_DX_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 $as_echo "$ac_pt_DX_DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_DOXYGEN" = x; then DX_DOXYGEN="" 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 DX_DOXYGEN=$ac_pt_DX_DOXYGEN fi else DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" fi if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 $as_echo "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} DX_FLAG_doc=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. set dummy ${ac_tool_prefix}perl; 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_path_DX_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_DX_PERL="$DX_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_PERL="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_PERL=$ac_cv_path_DX_PERL if test -n "$DX_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 $as_echo "$DX_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_PERL"; then ac_pt_DX_PERL=$DX_PERL # Extract the first word of "perl", so it can be a program name with args. set dummy perl; 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_path_ac_pt_DX_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_PERL="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL if test -n "$ac_pt_DX_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 $as_echo "$ac_pt_DX_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_PERL" = x; then DX_PERL="" 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 DX_PERL=$ac_pt_DX_PERL fi else DX_PERL="$ac_cv_path_DX_PERL" fi if test "$DX_FLAG_doc$DX_PERL" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 $as_echo "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} DX_FLAG_doc=0 fi : fi if test "$DX_FLAG_doc" = 1; then if :; then DX_COND_doc_TRUE= DX_COND_doc_FALSE='#' else DX_COND_doc_TRUE='#' DX_COND_doc_FALSE= fi DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" : else if false; then DX_COND_doc_TRUE= DX_COND_doc_FALSE='#' else DX_COND_doc_TRUE='#' DX_COND_doc_FALSE= fi : fi # Dot for graphics: # Check whether --enable-doxygen-dot was given. if test "${enable_doxygen_dot+set}" = set; then : enableval=$enable_doxygen_dot; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_dot=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-dot requires doxygen-dot" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_dot=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 ;; esac else DX_FLAG_dot=1 test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 fi if test "$DX_FLAG_dot" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. set dummy ${ac_tool_prefix}dot; 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_path_DX_DOT+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DX_DOT="$DX_DOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_DOT="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_DOT=$ac_cv_path_DX_DOT if test -n "$DX_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 $as_echo "$DX_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_DOT"; then ac_pt_DX_DOT=$DX_DOT # Extract the first word of "dot", so it can be a program name with args. set dummy dot; 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_path_ac_pt_DX_DOT+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_DOT in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_DOT="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT if test -n "$ac_pt_DX_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 $as_echo "$ac_pt_DX_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_DOT" = x; then DX_DOT="" 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 DX_DOT=$ac_pt_DX_DOT fi else DX_DOT="$ac_cv_path_DX_DOT" fi if test "$DX_FLAG_dot$DX_DOT" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 $as_echo "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} DX_FLAG_dot=0 fi : fi if test "$DX_FLAG_dot" = 1; then if :; then DX_COND_dot_TRUE= DX_COND_dot_FALSE='#' else DX_COND_dot_TRUE='#' DX_COND_dot_FALSE= fi DX_ENV="$DX_ENV HAVE_DOT='YES'" DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" : else if false; then DX_COND_dot_TRUE= DX_COND_dot_FALSE='#' else DX_COND_dot_TRUE='#' DX_COND_dot_FALSE= fi DX_ENV="$DX_ENV HAVE_DOT='NO'" : fi # Man pages generation: # Check whether --enable-doxygen-man was given. if test "${enable_doxygen_man+set}" = set; then : enableval=$enable_doxygen_man; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_man=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-man requires doxygen-man" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_man=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 ;; esac else DX_FLAG_man=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 fi if test "$DX_FLAG_man" = 1; then : fi if test "$DX_FLAG_man" = 1; then if :; then DX_COND_man_TRUE= DX_COND_man_FALSE='#' else DX_COND_man_TRUE='#' DX_COND_man_FALSE= fi DX_ENV="$DX_ENV GENERATE_MAN='YES'" : else if false; then DX_COND_man_TRUE= DX_COND_man_FALSE='#' else DX_COND_man_TRUE='#' DX_COND_man_FALSE= fi DX_ENV="$DX_ENV GENERATE_MAN='NO'" : fi # RTF file generation: # Check whether --enable-doxygen-rtf was given. if test "${enable_doxygen_rtf+set}" = set; then : enableval=$enable_doxygen_rtf; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_rtf=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-rtf requires doxygen-rtf" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_rtf=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 ;; esac else DX_FLAG_rtf=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 fi if test "$DX_FLAG_rtf" = 1; then : fi if test "$DX_FLAG_rtf" = 1; then if :; then DX_COND_rtf_TRUE= DX_COND_rtf_FALSE='#' else DX_COND_rtf_TRUE='#' DX_COND_rtf_FALSE= fi DX_ENV="$DX_ENV GENERATE_RTF='YES'" : else if false; then DX_COND_rtf_TRUE= DX_COND_rtf_FALSE='#' else DX_COND_rtf_TRUE='#' DX_COND_rtf_FALSE= fi DX_ENV="$DX_ENV GENERATE_RTF='NO'" : fi # XML file generation: # Check whether --enable-doxygen-xml was given. if test "${enable_doxygen_xml+set}" = set; then : enableval=$enable_doxygen_xml; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_xml=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-xml requires doxygen-xml" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_xml=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 ;; esac else DX_FLAG_xml=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 fi if test "$DX_FLAG_xml" = 1; then : fi if test "$DX_FLAG_xml" = 1; then if :; then DX_COND_xml_TRUE= DX_COND_xml_FALSE='#' else DX_COND_xml_TRUE='#' DX_COND_xml_FALSE= fi DX_ENV="$DX_ENV GENERATE_XML='YES'" : else if false; then DX_COND_xml_TRUE= DX_COND_xml_FALSE='#' else DX_COND_xml_TRUE='#' DX_COND_xml_FALSE= fi DX_ENV="$DX_ENV GENERATE_XML='NO'" : fi # (Compressed) HTML help generation: # Check whether --enable-doxygen-chm was given. if test "${enable_doxygen_chm+set}" = set; then : enableval=$enable_doxygen_chm; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_chm=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-chm requires doxygen-chm" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_chm=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 ;; esac else DX_FLAG_chm=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 fi if test "$DX_FLAG_chm" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. set dummy ${ac_tool_prefix}hhc; 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_path_DX_HHC+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_HHC in [\\/]* | ?:[\\/]*) ac_cv_path_DX_HHC="$DX_HHC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_HHC="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_HHC=$ac_cv_path_DX_HHC if test -n "$DX_HHC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 $as_echo "$DX_HHC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_HHC"; then ac_pt_DX_HHC=$DX_HHC # Extract the first word of "hhc", so it can be a program name with args. set dummy hhc; 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_path_ac_pt_DX_HHC+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_HHC in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_HHC="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC if test -n "$ac_pt_DX_HHC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 $as_echo "$ac_pt_DX_HHC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_HHC" = x; then DX_HHC="" 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 DX_HHC=$ac_pt_DX_HHC fi else DX_HHC="$ac_cv_path_DX_HHC" fi if test "$DX_FLAG_chm$DX_HHC" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 $as_echo "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} DX_FLAG_chm=0 fi : fi if test "$DX_FLAG_chm" = 1; then if :; then DX_COND_chm_TRUE= DX_COND_chm_FALSE='#' else DX_COND_chm_TRUE='#' DX_COND_chm_FALSE= fi DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" DX_ENV="$DX_ENV GENERATE_HTML='YES'" DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" : else if false; then DX_COND_chm_TRUE= DX_COND_chm_FALSE='#' else DX_COND_chm_TRUE='#' DX_COND_chm_FALSE= fi DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" : fi # Seperate CHI file generation. # Check whether --enable-doxygen-chi was given. if test "${enable_doxygen_chi+set}" = set; then : enableval=$enable_doxygen_chi; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_chi=1 test "$DX_FLAG_chm" = "1" \ || as_fn_error $? "doxygen-chi requires doxygen-chi" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_chi=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 ;; esac else DX_FLAG_chi=0 test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 fi if test "$DX_FLAG_chi" = 1; then : fi if test "$DX_FLAG_chi" = 1; then if :; then DX_COND_chi_TRUE= DX_COND_chi_FALSE='#' else DX_COND_chi_TRUE='#' DX_COND_chi_FALSE= fi DX_ENV="$DX_ENV GENERATE_CHI='YES'" : else if false; then DX_COND_chi_TRUE= DX_COND_chi_FALSE='#' else DX_COND_chi_TRUE='#' DX_COND_chi_FALSE= fi DX_ENV="$DX_ENV GENERATE_CHI='NO'" : fi # Plain HTML pages generation: # Check whether --enable-doxygen-html was given. if test "${enable_doxygen_html+set}" = set; then : enableval=$enable_doxygen_html; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_html=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-html requires doxygen-html" "$LINENO" 5 test "$DX_FLAG_chm" = "0" \ || as_fn_error $? "doxygen-html contradicts doxygen-html" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_html=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 ;; esac else DX_FLAG_html=1 test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 fi if test "$DX_FLAG_html" = 1; then : fi if test "$DX_FLAG_html" = 1; then if :; then DX_COND_html_TRUE= DX_COND_html_FALSE='#' else DX_COND_html_TRUE='#' DX_COND_html_FALSE= fi DX_ENV="$DX_ENV GENERATE_HTML='YES'" : else if false; then DX_COND_html_TRUE= DX_COND_html_FALSE='#' else DX_COND_html_TRUE='#' DX_COND_html_FALSE= fi test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" : fi # PostScript file generation: # Check whether --enable-doxygen-ps was given. if test "${enable_doxygen_ps+set}" = set; then : enableval=$enable_doxygen_ps; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_ps=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-ps requires doxygen-ps" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_ps=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 ;; esac else DX_FLAG_ps=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 fi if test "$DX_FLAG_ps" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. set dummy ${ac_tool_prefix}latex; 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_path_DX_LATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_LATEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_LATEX="$DX_LATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_LATEX=$ac_cv_path_DX_LATEX if test -n "$DX_LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 $as_echo "$DX_LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_LATEX"; then ac_pt_DX_LATEX=$DX_LATEX # Extract the first word of "latex", so it can be a program name with args. set dummy latex; 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_path_ac_pt_DX_LATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_LATEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX if test -n "$ac_pt_DX_LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 $as_echo "$ac_pt_DX_LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_LATEX" = x; then DX_LATEX="" 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 DX_LATEX=$ac_pt_DX_LATEX fi else DX_LATEX="$ac_cv_path_DX_LATEX" fi if test "$DX_FLAG_ps$DX_LATEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. set dummy ${ac_tool_prefix}makeindex; 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_path_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX if test -n "$DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 $as_echo "$DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_MAKEINDEX"; then ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; 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_path_ac_pt_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX if test -n "$ac_pt_DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 $as_echo "$ac_pt_DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_MAKEINDEX" = x; then DX_MAKEINDEX="" 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 DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX fi else DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" fi if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. set dummy ${ac_tool_prefix}dvips; 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_path_DX_DVIPS+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_DX_DVIPS="$DX_DVIPS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_DVIPS=$ac_cv_path_DX_DVIPS if test -n "$DX_DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 $as_echo "$DX_DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_DVIPS"; then ac_pt_DX_DVIPS=$DX_DVIPS # Extract the first word of "dvips", so it can be a program name with args. set dummy dvips; 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_path_ac_pt_DX_DVIPS+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS if test -n "$ac_pt_DX_DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 $as_echo "$ac_pt_DX_DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_DVIPS" = x; then DX_DVIPS="" 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 DX_DVIPS=$ac_pt_DX_DVIPS fi else DX_DVIPS="$ac_cv_path_DX_DVIPS" fi if test "$DX_FLAG_ps$DX_DVIPS" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. set dummy ${ac_tool_prefix}egrep; 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_path_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_EGREP=$ac_cv_path_DX_EGREP if test -n "$DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 $as_echo "$DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_EGREP"; then ac_pt_DX_EGREP=$DX_EGREP # Extract the first word of "egrep", so it can be a program name with args. set dummy egrep; 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_path_ac_pt_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP if test -n "$ac_pt_DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 $as_echo "$ac_pt_DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_EGREP" = x; then DX_EGREP="" 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 DX_EGREP=$ac_pt_DX_EGREP fi else DX_EGREP="$ac_cv_path_DX_EGREP" fi if test "$DX_FLAG_ps$DX_EGREP" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi : fi if test "$DX_FLAG_ps" = 1; then if :; then DX_COND_ps_TRUE= DX_COND_ps_FALSE='#' else DX_COND_ps_TRUE='#' DX_COND_ps_FALSE= fi : else if false; then DX_COND_ps_TRUE= DX_COND_ps_FALSE='#' else DX_COND_ps_TRUE='#' DX_COND_ps_FALSE= fi : fi # PDF file generation: # Check whether --enable-doxygen-pdf was given. if test "${enable_doxygen_pdf+set}" = set; then : enableval=$enable_doxygen_pdf; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_pdf=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-pdf requires doxygen-pdf" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_pdf=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 ;; esac else DX_FLAG_pdf=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 fi if test "$DX_FLAG_pdf" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. set dummy ${ac_tool_prefix}pdflatex; 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_path_DX_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_PDFLATEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX if test -n "$DX_PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 $as_echo "$DX_PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_PDFLATEX"; then ac_pt_DX_PDFLATEX=$DX_PDFLATEX # Extract the first word of "pdflatex", so it can be a program name with args. set dummy pdflatex; 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_path_ac_pt_DX_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_PDFLATEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX if test -n "$ac_pt_DX_PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 $as_echo "$ac_pt_DX_PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_PDFLATEX" = x; then DX_PDFLATEX="" 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 DX_PDFLATEX=$ac_pt_DX_PDFLATEX fi else DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" fi if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 $as_echo "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} DX_FLAG_pdf=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. set dummy ${ac_tool_prefix}makeindex; 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_path_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX if test -n "$DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 $as_echo "$DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_MAKEINDEX"; then ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; 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_path_ac_pt_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX if test -n "$ac_pt_DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 $as_echo "$ac_pt_DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_MAKEINDEX" = x; then DX_MAKEINDEX="" 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 DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX fi else DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" fi if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 $as_echo "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} DX_FLAG_pdf=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. set dummy ${ac_tool_prefix}egrep; 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_path_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_DX_EGREP="$DX_EGREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi DX_EGREP=$ac_cv_path_DX_EGREP if test -n "$DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 $as_echo "$DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_EGREP"; then ac_pt_DX_EGREP=$DX_EGREP # Extract the first word of "egrep", so it can be a program name with args. set dummy egrep; 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_path_ac_pt_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP if test -n "$ac_pt_DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 $as_echo "$ac_pt_DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_EGREP" = x; then DX_EGREP="" 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 DX_EGREP=$ac_pt_DX_EGREP fi else DX_EGREP="$ac_cv_path_DX_EGREP" fi if test "$DX_FLAG_pdf$DX_EGREP" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 $as_echo "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} DX_FLAG_pdf=0 fi : fi if test "$DX_FLAG_pdf" = 1; then if :; then DX_COND_pdf_TRUE= DX_COND_pdf_FALSE='#' else DX_COND_pdf_TRUE='#' DX_COND_pdf_FALSE= fi : else if false; then DX_COND_pdf_TRUE= DX_COND_pdf_FALSE='#' else DX_COND_pdf_TRUE='#' DX_COND_pdf_FALSE= fi : fi # LaTeX generation for PS and/or PDF: if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then if :; then DX_COND_latex_TRUE= DX_COND_latex_FALSE='#' else DX_COND_latex_TRUE='#' DX_COND_latex_FALSE= fi DX_ENV="$DX_ENV GENERATE_LATEX='YES'" else if false; then DX_COND_latex_TRUE= DX_COND_latex_FALSE='#' else DX_COND_latex_TRUE='#' DX_COND_latex_FALSE= fi DX_ENV="$DX_ENV GENERATE_LATEX='NO'" fi # Paper size for PS and/or PDF: case "$DOXYGEN_PAPER_SIZE" in #( "") DOXYGEN_PAPER_SIZE="" ;; #( a4wide|a4|letter|legal|executive) DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" ;; #( *) as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 ;; esac #For debugging: #echo DX_FLAG_doc=$DX_FLAG_doc #echo DX_FLAG_dot=$DX_FLAG_dot #echo DX_FLAG_man=$DX_FLAG_man #echo DX_FLAG_html=$DX_FLAG_html #echo DX_FLAG_chm=$DX_FLAG_chm #echo DX_FLAG_chi=$DX_FLAG_chi #echo DX_FLAG_rtf=$DX_FLAG_rtf #echo DX_FLAG_xml=$DX_FLAG_xml #echo DX_FLAG_pdf=$DX_FLAG_pdf #echo DX_FLAG_ps=$DX_FLAG_ps #echo DX_ENV=$DX_ENV ac_config_headers="$ac_config_headers common/config.h" ac_config_files="$ac_config_files Makefile Doxyfile common/Makefile conf/Makefile conf/addns.xml conf/conf.xml conf/enforcerstate.xml conf/kasp.xml conf/signconf.xml conf/zonelist.xml enforcer/Makefile enforcer/common/Makefile enforcer/enforcerd/Makefile enforcer/enforcerd/ods-enforcerd.8 enforcer/ksm/Makefile enforcer/ksm/include/Makefile enforcer/ksm/include/ksm/Makefile enforcer/test/Makefile enforcer/test/cucumber/Makefile enforcer/test/cucumber/c_conf.xml enforcer/test/cucumber/c_kasp.xml enforcer/test/cucumber/c_zonelist.base.xml enforcer/test/cunit/Makefile enforcer/test/cunit/database_setup_mysql.sh enforcer/test/cunit/database_setup_sqlite3.sh enforcer/utils/Makefile enforcer/utils/ods-kaspcheck.1 enforcer/utils/ods-ksmutil.1 libhsm/Makefile libhsm/src/Makefile libhsm/src/bin/Makefile libhsm/src/bin/ods-hsmspeed.1 libhsm/src/bin/ods-hsmutil.1 libhsm/src/lib/Makefile libhsm/checks/Makefile libhsm/checks/conf-softhsm.xml libhsm/checks/conf-sca6000.xml libhsm/checks/conf-etoken.xml libhsm/checks/conf-multi.xml libhsm/checks/conf-opensc.xml libhsm/checks/conf-ncipher.xml libhsm/checks/conf-aepkeyper.xml signer/Makefile signer/man/Makefile signer/man/ods-signer.8 signer/man/ods-signerd.8 signer/src/Makefile tools/Makefile tools/ods-control tools/solaris/Makefile tools/solaris/ods-enforcerd.init tools/solaris/ods-signerd.init tools/ods-timing.5 tools/opendnssec.7 tools/ods-control.8 tools/ods-kasp2html" 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 if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi 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 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 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 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 if test -z "${USE_MYSQL_TRUE}" && test -z "${USE_MYSQL_FALSE}"; then as_fn_error $? "conditional \"USE_MYSQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENFORCER_TRUE}" && test -z "${ENABLE_ENFORCER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENFORCER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CUNIT_TRUE}" && test -z "${WITH_CUNIT_FALSE}"; then as_fn_error $? "conditional \"WITH_CUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SIGNER_TRUE}" && test -z "${ENABLE_SIGNER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SIGNER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CUCUMBER_TRUE}" && test -z "${WITH_CUCUMBER_FALSE}"; then as_fn_error $? "conditional \"WITH_CUCUMBER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then as_fn_error $? "conditional \"DX_COND_doc\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then as_fn_error $? "conditional \"DX_COND_doc\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then as_fn_error $? "conditional \"DX_COND_dot\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then as_fn_error $? "conditional \"DX_COND_dot\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then as_fn_error $? "conditional \"DX_COND_man\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then as_fn_error $? "conditional \"DX_COND_man\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_rtf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_rtf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then as_fn_error $? "conditional \"DX_COND_xml\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then as_fn_error $? "conditional \"DX_COND_xml\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chm\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chm\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chi\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chi\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then as_fn_error $? "conditional \"DX_COND_html\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then as_fn_error $? "conditional \"DX_COND_html\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then as_fn_error $? "conditional \"DX_COND_ps\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then as_fn_error $? "conditional \"DX_COND_ps\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_pdf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_pdf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then as_fn_error $? "conditional \"DX_COND_latex\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then as_fn_error $? "conditional \"DX_COND_latex\" 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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 if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## 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 opendnssec $as_me 1.4.3, which was generated by GNU Autoconf 2.68. 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 ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ opendnssec config.status 1.4.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." 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 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "common/config.h") CONFIG_HEADERS="$CONFIG_HEADERS common/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "conf/Makefile") CONFIG_FILES="$CONFIG_FILES conf/Makefile" ;; "conf/addns.xml") CONFIG_FILES="$CONFIG_FILES conf/addns.xml" ;; "conf/conf.xml") CONFIG_FILES="$CONFIG_FILES conf/conf.xml" ;; "conf/enforcerstate.xml") CONFIG_FILES="$CONFIG_FILES conf/enforcerstate.xml" ;; "conf/kasp.xml") CONFIG_FILES="$CONFIG_FILES conf/kasp.xml" ;; "conf/signconf.xml") CONFIG_FILES="$CONFIG_FILES conf/signconf.xml" ;; "conf/zonelist.xml") CONFIG_FILES="$CONFIG_FILES conf/zonelist.xml" ;; "enforcer/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/Makefile" ;; "enforcer/common/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/common/Makefile" ;; "enforcer/enforcerd/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/enforcerd/Makefile" ;; "enforcer/enforcerd/ods-enforcerd.8") CONFIG_FILES="$CONFIG_FILES enforcer/enforcerd/ods-enforcerd.8" ;; "enforcer/ksm/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/ksm/Makefile" ;; "enforcer/ksm/include/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/ksm/include/Makefile" ;; "enforcer/ksm/include/ksm/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/ksm/include/ksm/Makefile" ;; "enforcer/test/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/test/Makefile" ;; "enforcer/test/cucumber/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/Makefile" ;; "enforcer/test/cucumber/c_conf.xml") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/c_conf.xml" ;; "enforcer/test/cucumber/c_kasp.xml") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/c_kasp.xml" ;; "enforcer/test/cucumber/c_zonelist.base.xml") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/c_zonelist.base.xml" ;; "enforcer/test/cunit/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/test/cunit/Makefile" ;; "enforcer/test/cunit/database_setup_mysql.sh") CONFIG_FILES="$CONFIG_FILES enforcer/test/cunit/database_setup_mysql.sh" ;; "enforcer/test/cunit/database_setup_sqlite3.sh") CONFIG_FILES="$CONFIG_FILES enforcer/test/cunit/database_setup_sqlite3.sh" ;; "enforcer/utils/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/utils/Makefile" ;; "enforcer/utils/ods-kaspcheck.1") CONFIG_FILES="$CONFIG_FILES enforcer/utils/ods-kaspcheck.1" ;; "enforcer/utils/ods-ksmutil.1") CONFIG_FILES="$CONFIG_FILES enforcer/utils/ods-ksmutil.1" ;; "libhsm/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/Makefile" ;; "libhsm/src/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/src/Makefile" ;; "libhsm/src/bin/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/src/bin/Makefile" ;; "libhsm/src/bin/ods-hsmspeed.1") CONFIG_FILES="$CONFIG_FILES libhsm/src/bin/ods-hsmspeed.1" ;; "libhsm/src/bin/ods-hsmutil.1") CONFIG_FILES="$CONFIG_FILES libhsm/src/bin/ods-hsmutil.1" ;; "libhsm/src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/src/lib/Makefile" ;; "libhsm/checks/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/checks/Makefile" ;; "libhsm/checks/conf-softhsm.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-softhsm.xml" ;; "libhsm/checks/conf-sca6000.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-sca6000.xml" ;; "libhsm/checks/conf-etoken.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-etoken.xml" ;; "libhsm/checks/conf-multi.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-multi.xml" ;; "libhsm/checks/conf-opensc.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-opensc.xml" ;; "libhsm/checks/conf-ncipher.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-ncipher.xml" ;; "libhsm/checks/conf-aepkeyper.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-aepkeyper.xml" ;; "signer/Makefile") CONFIG_FILES="$CONFIG_FILES signer/Makefile" ;; "signer/man/Makefile") CONFIG_FILES="$CONFIG_FILES signer/man/Makefile" ;; "signer/man/ods-signer.8") CONFIG_FILES="$CONFIG_FILES signer/man/ods-signer.8" ;; "signer/man/ods-signerd.8") CONFIG_FILES="$CONFIG_FILES signer/man/ods-signerd.8" ;; "signer/src/Makefile") CONFIG_FILES="$CONFIG_FILES signer/src/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/ods-control") CONFIG_FILES="$CONFIG_FILES tools/ods-control" ;; "tools/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES tools/solaris/Makefile" ;; "tools/solaris/ods-enforcerd.init") CONFIG_FILES="$CONFIG_FILES tools/solaris/ods-enforcerd.init" ;; "tools/solaris/ods-signerd.init") CONFIG_FILES="$CONFIG_FILES tools/solaris/ods-signerd.init" ;; "tools/ods-timing.5") CONFIG_FILES="$CONFIG_FILES tools/ods-timing.5" ;; "tools/opendnssec.7") CONFIG_FILES="$CONFIG_FILES tools/opendnssec.7" ;; "tools/ods-control.8") CONFIG_FILES="$CONFIG_FILES tools/ods-control.8" ;; "tools/ods-kasp2html") CONFIG_FILES="$CONFIG_FILES tools/ods-kasp2html" ;; *) 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` 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 ' >$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 ' >$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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $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 opendnssec-1.4.3/common/0000775000175000017500000000000012247571202012155 500000000000000opendnssec-1.4.3/common/b64_pton.c0000664000175000017500000002622011665367343013712 00000000000000/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * Portions Copyright (c) 1995 by International Business Machines, Inc. * * International Business Machines, Inc. (hereinafter called IBM) grants * permission under its copyrights to use, copy, modify, and distribute this * Software with or without fee, provided that the above copyright notice and * all paragraphs of this notice appear in all copies, and that the name of IBM * not be used in connection with the marketing of any product incorporating * the Software or modifications thereof, without specific, written prior * permission. * * To the extent it has a right to do so, IBM grants an immunity from suit * under its patents, if any, for the use, sale or manufacture of products to * the extent that such products are used for performing Domain Name System * dynamic updates in TCP/IP networks by means of the Software. No immunity is * granted for any product per se or for any other function of any product. * * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include #include #include #include #include #include #include #include #include #include #define Assert(Cond) if (!(Cond)) abort() static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here in a slightly edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. */ /* skips all whitespace anywhere. converts characters, four at a time, starting at (or after) src from base - 64 numbers into three 8 bit bytes in the target area. it returns the number of data bytes stored at the target, or -1 on error. */ static int b64rmap_initialized = 0; static uint8_t b64rmap[256]; static const uint8_t b64rmap_special = 0xf0; static const uint8_t b64rmap_end = 0xfd; static const uint8_t b64rmap_space = 0xfe; static const uint8_t b64rmap_invalid = 0xff; /** * Initializing the reverse map is not thread safe. * Which is fine for NSD. For now... **/ static void b64_initialize_rmap () { int i; char ch; /* Null: end of string, stop parsing */ b64rmap[0] = b64rmap_end; for (i = 1; i < 256; ++i) { ch = (char)i; /* Whitespaces */ if (isspace(ch)) b64rmap[i] = b64rmap_space; /* Padding: stop parsing */ else if (ch == Pad64) b64rmap[i] = b64rmap_end; /* Non-base64 char */ else b64rmap[i] = b64rmap_invalid; } /* Fill reverse mapping for base64 chars */ for (i = 0; Base64[i] != '\0'; ++i) b64rmap[(uint8_t)Base64[i]] = i; b64rmap_initialized = 1; } static int b64_pton_do(char const *src, uint8_t *target, size_t targsize) { int tarindex, state, ch; uint8_t ofs; state = 0; tarindex = 0; while (1) { ch = *src++; ofs = b64rmap[ch]; if (ofs >= b64rmap_special) { /* Ignore whitespaces */ if (ofs == b64rmap_space) continue; /* End of base64 characters */ if (ofs == b64rmap_end) break; /* A non-base64 character. */ return (-1); } switch (state) { case 0: if ((size_t)tarindex >= targsize) return (-1); target[tarindex] = ofs << 2; state = 1; break; case 1: if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= ofs >> 4; target[tarindex+1] = (ofs & 0x0f) << 4 ; tarindex++; state = 2; break; case 2: if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= ofs >> 2; target[tarindex+1] = (ofs & 0x03) << 6; tarindex++; state = 3; break; case 3: if ((size_t)tarindex >= targsize) return (-1); target[tarindex] |= ofs; tarindex++; state = 0; break; default: abort(); } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == Pad64) { /* We got a pad char. */ ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return (-1); case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) break; /* Make sure there is another trailing = sign. */ if (ch != Pad64) return (-1); ch = *src++; /* Skip the = */ /* Fall through to "single trailing =" case. */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) return (-1); /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were * zeros. If we don't check them, they become a * subliminal channel. */ if (target[tarindex] != 0) return (-1); } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return (-1); } return (tarindex); } static int b64_pton_len(char const *src) { int tarindex, state, ch; uint8_t ofs; state = 0; tarindex = 0; while (1) { ch = *src++; ofs = b64rmap[ch]; if (ofs >= b64rmap_special) { /* Ignore whitespaces */ if (ofs == b64rmap_space) continue; /* End of base64 characters */ if (ofs == b64rmap_end) break; /* A non-base64 character. */ return (-1); } switch (state) { case 0: state = 1; break; case 1: tarindex++; state = 2; break; case 2: tarindex++; state = 3; break; case 3: tarindex++; state = 0; break; default: abort(); } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == Pad64) { /* We got a pad char. */ ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return (-1); case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) break; /* Make sure there is another trailing = sign. */ if (ch != Pad64) return (-1); ch = *src++; /* Skip the = */ /* Fall through to "single trailing =" case. */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) return (-1); } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return (-1); } return (tarindex); } int b64_pton(char const *src, uint8_t *target, size_t targsize) { if (!b64rmap_initialized) b64_initialize_rmap (); if (target) return b64_pton_do (src, target, targsize); else return b64_pton_len (src); } opendnssec-1.4.3/common/Makefile.in0000664000175000017500000004471412247571136014162 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6148 2012-02-07 15:23:10Z matthijs $ VPATH = @srcdir@ 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@ subdir = common DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libcompat_a_AR = $(AR) $(ARFLAGS) libcompat_a_LIBADD = am_libcompat_a_OBJECTS = strlcat.$(OBJEXT) strlcpy.$(OBJEXT) \ b64_ntop.$(OBJEXT) b64_pton.$(OBJEXT) pselect.$(OBJEXT) libcompat_a_OBJECTS = $(am_libcompat_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 = $(libcompat_a_SOURCES) DIST_SOURCES = $(libcompat_a_SOURCES) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LIBRARIES = libcompat.a libcompat_a_SOURCES = strlcat.c strlcpy.c b64_ntop.c b64_pton.c pselect.c compat.h all: config.h $(MAKE) $(AM_MAKEFLAGS) 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 common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/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): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status common/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libcompat.a: $(libcompat_a_OBJECTS) $(libcompat_a_DEPENDENCIES) $(EXTRA_libcompat_a_DEPENDENCIES) -rm -f libcompat.a $(libcompat_a_AR) libcompat.a $(libcompat_a_OBJECTS) $(libcompat_a_LIBADD) $(RANLIB) libcompat.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b64_ntop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b64_pton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.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 $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 $(LIBRARIES) config.h installdirs: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: 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: .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-hdr \ 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-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am # 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: opendnssec-1.4.3/common/pselect.c0000664000175000017500000000204511714240736013704 00000000000000/* * Copyright (c) 2001-2011, NLnet Labs. All rights reserved. * * Like select(2) but set the signals to block while waiting in * select. This version is not entirely race condition safe. Only * operating system support can make it so. */ #include #include #include #ifdef HAVE_SYS_SELECT_H #include #endif #include #include int pselect (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask) { int result; sigset_t saved_sigmask; struct timeval saved_timeout; if (sigmask && sigprocmask(SIG_SETMASK, sigmask, &saved_sigmask) == -1) return -1; if (timeout) { saved_timeout.tv_sec = timeout->tv_sec; saved_timeout.tv_usec = timeout->tv_nsec / 1000; result = select(n, readfds, writefds, exceptfds, &saved_timeout); } else { result = select(n, readfds, writefds, exceptfds, NULL); } if (sigmask && sigprocmask(SIG_SETMASK, &saved_sigmask, NULL) == -1) return -1; return result; } opendnssec-1.4.3/common/strlcpy.c0000664000175000017500000000342711410510050013730 00000000000000/* $OpenBSD: strlcpy.c,v 1.10 2005/11/10 05:26:17 dtucker Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ #include "config.h" #ifndef HAVE_STRLCPY #include #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } #endif /* !HAVE_STRLCPY */ opendnssec-1.4.3/common/b64_ntop.c0000664000175000017500000001626311665367343013720 00000000000000/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * Portions Copyright (c) 1995 by International Business Machines, Inc. * * International Business Machines, Inc. (hereinafter called IBM) grants * permission under its copyrights to use, copy, modify, and distribute this * Software with or without fee, provided that the above copyright notice and * all paragraphs of this notice appear in all copies, and that the name of IBM * not be used in connection with the marketing of any product incorporating * the Software or modifications thereof, without specific, written prior * permission. * * To the extent it has a right to do so, IBM grants an immunity from suit * under its patents, if any, for the use, sale or manufacture of products to * the extent that such products are used for performing Domain Name System * dynamic updates in TCP/IP networks by means of the Software. No immunity is * granted for any product per se or for any other function of any product. * * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include #include #include #include #include #include #include #include #include #include #define Assert(Cond) if (!(Cond)) abort() static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here in a slightly edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. */ int b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) { size_t datalength = 0; uint8_t input[3]; uint8_t output[4]; size_t i; while (2 < srclength) { input[0] = *src++; input[1] = *src++; input[2] = *src++; srclength -= 3; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = input[2] & 0x3f; Assert(output[0] < 64); Assert(output[1] < 64); Assert(output[2] < 64); Assert(output[3] < 64); if (datalength + 4 > targsize) return (-1); target[datalength++] = Base64[output[0]]; target[datalength++] = Base64[output[1]]; target[datalength++] = Base64[output[2]]; target[datalength++] = Base64[output[3]]; } /* Now we worry about padding. */ if (0 != srclength) { /* Get what's left. */ input[0] = input[1] = input[2] = '\0'; for (i = 0; i < srclength; i++) input[i] = *src++; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); Assert(output[0] < 64); Assert(output[1] < 64); Assert(output[2] < 64); if (datalength + 4 > targsize) return (-1); target[datalength++] = Base64[output[0]]; target[datalength++] = Base64[output[1]]; if (srclength == 1) target[datalength++] = Pad64; else target[datalength++] = Base64[output[2]]; target[datalength++] = Pad64; } if (datalength >= targsize) return (-1); target[datalength] = '\0'; /* Returned value doesn't count \0. */ return (datalength); } opendnssec-1.4.3/common/config.h.in0000664000175000017500000004204712247571135014134 00000000000000/* common/config.h.in. Generated from configure.ac by autoheader. */ /* Define if your setregid() is broken */ #undef BROKEN_SETREGID /* Define if your setresgid() is broken */ #undef BROKEN_SETRESGID /* Define if your setresuid() is broken */ #undef BROKEN_SETRESUID /* Define if your setreuid() is broken */ #undef BROKEN_SETREUID /* System cp(3) command */ #undef CP_COMMAND /* timeshift debug */ #undef ENFORCER_TIMESHIFT /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the `arc4random' function. */ #undef HAVE_ARC4RANDOM /* Define to 1 if you have the `arc4random_uniform' function. */ #undef HAVE_ARC4RANDOM_UNIFORM /* Define to 1 if you have the `atoi' function. */ #undef HAVE_ATOI /* Define to 1 if you have the `b64_ntop' function. */ #undef HAVE_B64_NTOP /* Define to 1 if you have the `b64_pton' function. */ #undef HAVE_B64_PTON /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define to 1 if you have the `calloc' function. */ #undef HAVE_CALLOC /* Define to 1 if your system has a working `chown' function. */ #undef HAVE_CHOWN /* Define to 1 if you have the `chroot' function. */ #undef HAVE_CHROOT /* Define if you have clock_gettime */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the `close' function. */ #undef HAVE_CLOSE /* Define to 1 if you have the `closelog' function. */ #undef HAVE_CLOSELOG /* Define to 1 if you have the `closelog_r' function. */ #undef HAVE_CLOSELOG_R /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have dlopen */ #undef HAVE_DLOPEN /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `EVP_sha1' function. */ #undef HAVE_EVP_SHA1 /* Define to 1 if you have the `EVP_sha256' function. */ #undef HAVE_EVP_SHA256 /* Define to 1 if you have the `exit' function. */ #undef HAVE_EXIT /* Define to 1 if you have the `fclose' function. */ #undef HAVE_FCLOSE /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `ferror' function. */ #undef HAVE_FERROR /* Define to 1 if you have the `fflush' function. */ #undef HAVE_FFLUSH /* Define to 1 if you have the `fgetc' function. */ #undef HAVE_FGETC /* Define to 1 if you have the `fopen' function. */ #undef HAVE_FOPEN /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `fprintf' function. */ #undef HAVE_FPRINTF /* Define to 1 if you have the `free' function. */ #undef HAVE_FREE /* Define to 1 if you have the `getgroups' function. */ #undef HAVE_GETGROUPS /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getpass' function. */ #undef HAVE_GETPASS /* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE /* Define to 1 if you have the `getpid' function. */ #undef HAVE_GETPID /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `cunit' library (-lcunit). */ #undef HAVE_LIBCUNIT /* Define to 1 if you have the `ldns' library (-lldns). */ #undef HAVE_LIBLDNS /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ #undef HAVE_LIBSQLITE3 /* Define to 1 if you have the `xml2' library (-lxml2). */ #undef HAVE_LIBXML2 /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_PARSER_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_RELAXNG_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XMLREADER_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XPATH_H /* Define to 1 if you have the `listen' function. */ #undef HAVE_LISTEN /* Define if you have LoadLibrary */ #undef HAVE_LOADLIBRARY /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_MYSQL_H /* Define to 1 if you have the `openlog' function. */ #undef HAVE_OPENLOG /* Define to 1 if you have the `openlog_r' function. */ #undef HAVE_OPENLOG_R /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the `pthread_cond_destroy' function. */ #undef HAVE_PTHREAD_COND_DESTROY /* Define to 1 if you have the `pthread_cond_init' function. */ #undef HAVE_PTHREAD_COND_INIT /* Define to 1 if you have the `pthread_cond_signal' function. */ #undef HAVE_PTHREAD_COND_SIGNAL /* Define to 1 if you have the `pthread_cond_timedwait' function. */ #undef HAVE_PTHREAD_COND_TIMEDWAIT /* Define to 1 if you have the `pthread_cond_wait' function. */ #undef HAVE_PTHREAD_COND_WAIT /* Define to 1 if you have the `pthread_create' function. */ #undef HAVE_PTHREAD_CREATE /* Define to 1 if you have the `pthread_detach' function. */ #undef HAVE_PTHREAD_DETACH /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `pthread_join' function. */ #undef HAVE_PTHREAD_JOIN /* Define to 1 if you have the `pthread_mutex_destroy' function. */ #undef HAVE_PTHREAD_MUTEX_DESTROY /* Define to 1 if you have the `pthread_mutex_init' function. */ #undef HAVE_PTHREAD_MUTEX_INIT /* Define to 1 if you have the `pthread_mutex_lock' function. */ #undef HAVE_PTHREAD_MUTEX_LOCK /* Define to 1 if you have the `pthread_mutex_unlock' function. */ #undef HAVE_PTHREAD_MUTEX_UNLOCK /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the `pthread_self' function. */ #undef HAVE_PTHREAD_SELF /* Define to 1 if you have the `pthread_sigmask' function. */ #undef HAVE_PTHREAD_SIGMASK /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setgroups' function. */ #undef HAVE_SETGROUPS /* Define to 1 if you have the `setregid' function. */ #undef HAVE_SETREGID /* Define to 1 if you have the `setresgid' function. */ #undef HAVE_SETRESGID /* Define to 1 if you have the `setresuid' function. */ #undef HAVE_SETRESUID /* Define to 1 if you have the `setreuid' function. */ #undef HAVE_SETREUID /* Define to 1 if you have the `sigfillset' function. */ #undef HAVE_SIGFILLSET /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Have the sockaddr_un.sun_len member. */ #undef HAVE_SOCKADDR_SUN_LEN /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_SQLITE3_H /* Define if you have the SSL libraries installed. */ #undef HAVE_SSL /* Define to 1 if you have the `stat' function. */ #undef HAVE_STAT /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strlen' function. */ #undef HAVE_STRLEN /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strncat' function. */ #undef HAVE_STRNCAT /* Define to 1 if you have the `strncmp' function. */ #undef HAVE_STRNCMP /* Define to 1 if you have the `strncpy' function. */ #undef HAVE_STRNCPY /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the `syslog_r' function. */ #undef HAVE_SYSLOG_R /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* union semun is defined */ #undef HAVE_UNION_SEMUN /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unlink' function. */ #undef HAVE_UNLINK /* Define to 1 if you have the `va_end' function. */ #undef HAVE_VA_END /* Define to 1 if you have the `va_start' function. */ #undef HAVE_VA_START /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `vsyslog_r' function. */ #undef HAVE_VSYSLOG_R /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the `xmlCleanupParser' function. */ #undef HAVE_XMLCLEANUPPARSER /* Define to 1 if you have the `xmlCleanupThreads' function. */ #undef HAVE_XMLCLEANUPTHREADS /* Define to 1 if you have the `xmlInitParser' function. */ #undef HAVE_XMLINITPARSER /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Default configuration file. */ #undef HSM_DEFAULT_CONFIG /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Path to the OpenDNSSEC ods-control binary */ #undef ODS_EN_CONTROL /* Path to the OpenDNSSEC kaspcheck binary */ #undef ODS_EN_KASPCHECK /* Command to send a SIGHUP to the ods-enforcerd process */ #undef ODS_EN_NOTIFY /* Path to the OpenDNSSEC config file */ #undef ODS_SE_CFGFILE /* Path to the OpenDNSSEC signer client binary */ #undef ODS_SE_CLI /* Path to the OpenDNSSEC signer engine binary */ #undef ODS_SE_ENGINE /* File magic for storing backups from the OpenDNSSEC signer engine */ #undef ODS_SE_FILE_MAGIC_V1 /* File magic for storing backups from the OpenDNSSEC signer engine */ #undef ODS_SE_FILE_MAGIC_V2 /* File magic for storing backups from the OpenDNSSEC signer engine */ #undef ODS_SE_FILE_MAGIC_V3 /* Maximum line length that the OpenDNSSEC signer client can handle */ #undef ODS_SE_MAXLINE /* Number of seconds the OpenDNSSEC signer engine should backoff when a task failed */ #undef ODS_SE_MAX_BACKOFF /* Path to the OpenDNSSEC signer engine pid file */ #undef ODS_SE_PIDFILE /* Path to the OpenDNSSEC data files */ #undef ODS_SE_RNGDIR /* Path to the OpenDNSSEC signer engine socket file */ #undef ODS_SE_SOCKFILE /* Shutdown message for the OpenDNSSEC signer client */ #undef ODS_SE_STOP_RESPONSE /* Default verbosity */ #undef ODS_SE_VERBOSITY /* Path to the OpenDNSSEC signer engine working directory */ #undef ODS_SE_WORKDIR /* Default number of worker threads for the OpenDNSSEC signer engine */ #undef ODS_SE_WORKERTHREADS /* Path to the OpenDNSSEC signer engine pid file */ #undef ODS_ZF_PIDFILE /* Path to the OpenDNSSEC configuration files */ #undef OPENDNSSEC_CONFIG_DIR /* Path to the main OpenDNSSEC configuration file */ #undef OPENDNSSEC_CONFIG_FILE /* Path to the OpenDNSSEC enforcer pid file */ #undef OPENDNSSEC_ENFORCER_PIDFILE /* Path to the OpenDNSSEC zone fetcher pid file */ #undef OPENDNSSEC_FETCH_PIDFILE /* Path to the OpenDNSSEC data files */ #undef OPENDNSSEC_SCHEMA_DIR /* Path to the OpenDNSSEC signer cli */ #undef OPENDNSSEC_SIGNER_CLI /* Path to the OpenDNSSEC signer engine */ #undef OPENDNSSEC_SIGNER_ENGINE /* Path to the OpenDNSSEC signer pid file */ #undef OPENDNSSEC_SIGNER_PIDFILE /* Path to the OpenDNSSEC signer socket */ #undef OPENDNSSEC_SIGNER_SOCKET /* Path to the OpenDNSSEC var directory */ #undef OPENDNSSEC_STATE_DIR /* 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 necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define if your platform breaks doing a seteuid before a setuid */ #undef SETEUID_BREAKS_SETUID /* Path to the OpenDNSSEC signer engine cli */ #undef SIGNER_CLI_UPDATE /* database binary */ #undef SQL_BIN /* database setup script */ #undef SQL_SETUP /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* strptime is available from time.h with some defines. */ #undef STRPTIME_NEEDS_DEFINES /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define as `fork' if `vfork' does not work. */ #undef vfork /* define before includes as it specifies what standard to use. */ #if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \ || !defined (HAVE_CTIME_R_PROTO) \ || defined (STRPTIME_NEEDS_DEFINES) # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 600 # endif # ifndef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200112 # endif # ifndef _BSD_SOURCE # define _BSD_SOURCE 1 # endif # ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 # endif # ifndef _STDC_C99 # define _STDC_C99 1 # endif # ifndef _ALL_SOURCE # define _ALL_SOURCE 1 # endif #endif opendnssec-1.4.3/common/compat.h0000664000175000017500000000356011665367343013551 00000000000000/* $Id: compat.h 5936 2011-11-30 08:52:51Z matthijs $ */ /* * Copyright (c) 2010 .SE (The Internet Infrastructure Foundation). * 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, 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 ``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 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. */ #include "config.h" #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifndef HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); #endif #ifndef B64_PTON int b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize); #endif #ifndef B64_NTOP int b64_pton(char const *src, uint8_t *target, size_t targsize); #endif opendnssec-1.4.3/common/strlcat.c0000664000175000017500000000357411410510050013707 00000000000000/* $OpenBSD: strlcat.c,v 1.11 2005/11/10 05:18:56 dtucker Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */ #include "config.h" #ifndef HAVE_STRLCAT #include #include /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NULL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } #endif /* !HAVE_STRLCAT */ opendnssec-1.4.3/common/Makefile.am0000664000175000017500000000033211714240736014132 00000000000000# $Id: Makefile.am 6148 2012-02-07 15:23:10Z matthijs $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LIBRARIES = libcompat.a libcompat_a_SOURCES = strlcat.c strlcpy.c b64_ntop.c b64_pton.c pselect.c compat.h opendnssec-1.4.3/aclocal.m40000664000175000017500000010603212247571132012451 00000000000000# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. 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_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [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 8's {/usr,}/bin/sh. touch 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_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # 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")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 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 AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [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. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # 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 AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl 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= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 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 ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/acx_broken_setres.m4]) m4_include([m4/acx_check_strptime.m4]) m4_include([m4/acx_cunit.m4]) m4_include([m4/acx_database_backend.m4]) m4_include([m4/acx_dbparams.m4]) m4_include([m4/acx_dlopen.m4]) m4_include([m4/acx_ldns.m4]) m4_include([m4/acx_libc.m4]) m4_include([m4/acx_libxml2.m4]) m4_include([m4/acx_mysql.m4]) m4_include([m4/acx_pedantic.m4]) m4_include([m4/acx_pkcs11_modules.m4]) m4_include([m4/acx_prefixhack.m4]) m4_include([m4/acx_rpath.m4]) m4_include([m4/acx_rt.m4]) m4_include([m4/acx_sqlite3.m4]) m4_include([m4/acx_ssl.m4]) m4_include([m4/acx_strict.m4]) m4_include([m4/ax_prog_doxygen.m4]) m4_include([m4/ax_pthread.m4]) m4_include([m4/check_compiler_flag.m4]) m4_include([m4/check_compiler_flag_needed.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/opendnssec_common.m4]) opendnssec-1.4.3/ltmain.sh0000644000175000017500000105204012247571126012432 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # 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. # Usage: $progname [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 # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # 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. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # 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' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # 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= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_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 $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # 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. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # 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$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # 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 func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= 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) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=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,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append 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. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # 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 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" 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 $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # 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 $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' 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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE 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 func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi 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 $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [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: $progname [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 -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler 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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [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 -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -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 -precious-files-regex REGEX don't remove output files matching REGEX -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 -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 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: $progname [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." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" 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 -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # 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 $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 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" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # 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. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; 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. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append 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 -e "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. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" 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 func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append 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 func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" 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 func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* 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 /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # 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 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/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) 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*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; 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 "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # 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. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug 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 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac 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" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # 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. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # 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 relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' 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 file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ 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 "\ # 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 "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${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\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_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 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } 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; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # 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= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_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" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append 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 func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" 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 func_append 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. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append 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 func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$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 # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir 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 func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework 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*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # 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 func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # 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 ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" 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 func_append 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. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append 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 func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" 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. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'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\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. 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 $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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 $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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 dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; 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 # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi 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%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" 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 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_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 func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" 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 func_dirname "$lib" "" "." ladir="$func_dirname_result" 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 *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; 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 use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac 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. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac 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 func_append 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*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; 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 $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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 "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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 use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" 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* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' 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 "$opt_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.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; 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 elif test -n "$old_library"; then 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 && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; 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 func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append 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:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; 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:"*) ;; *) func_append 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; 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 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*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append 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" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= 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 "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi 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 "*) ;; *) func_append 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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append 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 func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" 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 test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # 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="$1" number_minor="$2" number_revision="$3" # # 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 # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; 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]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" 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 func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 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) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result 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 func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result 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 func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; 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 func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_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 | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if 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 "*) ;; *) func_append 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 "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append 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. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi 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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append 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 ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append 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 func_append 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 ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; 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 " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) 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 ;; esac ;; 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 with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; 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 # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # 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 # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append 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 "$opt_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_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" 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" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # 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 test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # 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 func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append 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. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result 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~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "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" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi 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\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # 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 cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_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 "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_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 and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${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" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS 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" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status 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 func_append 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 func_append 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS 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" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED '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 "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "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}\" || $lt_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 func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; 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 $symfileobj" 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" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$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= len=$len0 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 func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "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}\" || $lt_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 func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { 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) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # 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' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_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; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug 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) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; 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 func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append 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 func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # 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: # vi:sw=2 opendnssec-1.4.3/MIGRATION0000664000175000017500000000706412064035712012066 00000000000000$Id: MIGRATION 6896 2012-12-18 09:47:54Z jerry $ This file gives you instructions on how to migrate from one version of OpenDNSSEC to another. *** Fix for MySQL zone delete issue *** As reported in: https://issues.opendnssec.org/browse/OPENDNSSEC-338 This effects MySQL databases created after 1.4.0a3 or 1.3.9 where zone deletion was changed. If you wish to fix this without losing any existing information then run the sql statements given in: enforcer/utils/migrate_zone_delete.mysql against your database. Note that sqlite is not effected as we do not enforce any constraints. *** Migrating from 1.3 to trunk/1.4 *** r5914 has some kasp database changes to allow for an update to the zonelist.xml schema. This means that if you want to use this version or any after it with a database created earlier you will need to do one of 2 things... 1) wipe and recreate your kasp database (run ods-ksmutl setup) which will lose all of your current state. If you need to keep your key information then, 2) run the sql statements given in: enforcer/utils/migrate_adapters_1.mysql or enforcer/utils/migrate_adapters_1.sqlite3 against your existing database. These changes allow flexibility in the input and output adapters. *** Migrating from v1.2 to v1.3 *** There are no migration scripts to run to make this transition. *** Migrating from v1.1 to v1.2 *** There is a kasp schema change from the 1.1 branch (or trunk if you built prior to r3823). To make this transition you have 2 options: 1) Run ods-ksmutil setup again. This will remove _all_ the current information from the kasp database and start you off again with a fresh environment. If that is not an option, or you want to try something else then: 2) run one of the migration scripts enforcer/utils/migrate_keyshare_mysql.pl or enforcer/utils/migrate_keyshare_sqlite3.pl depending on your database. NOTE: Although these scripts have been tested it is recommended to make a backup of your database prior to running them. *** Migrating to a larger keypairs(id) field (MySQL ONLY) *** The version of the MySQL database that was created with v1.2 (and prior to svn r4465) had a smallint datatype for the keypairs(id) field. This limits the number of keys that the system can store to 32767. If this number is not large enough then the script: enforcer/utils/migrate_id_mysql.pl will increase it to an int, which can store 2147483647 keys. NOTES: Although this scripts have been tested it is recommended to make a backup of your database prior to running them. This issue only applies to MySQL backends. *** Migrating between SQLite <=> MySQL (same OpenDNSSEC version) *** convert_database.pl located in enforcer/utils can be used to convert between SQLite and MySQL on the same OpenDNSSEC version. If you wish to convert to another OpenDNSSEC version you need to migrate existing database to that version first. NOTE: You must create the MySQL database and database user manually before converting to MySQL. Convert from SQLite to MySQL example: enforcer/utils/convert_database.pl \ --from dbi:SQLite:dbname=/var/opendnssec/kasp.db \ --to dbi:mysql:database=kasp;host=localhost \ --to-username --to-password Convert from MySQL to SQLite example: enforcer/utils/convert_database.pl \ --from dbi:mysql:database=kasp;host=localhost \ --from-username --from-password \ --to dbi:SQLite:dbname=/var/opendnssec/kasp.db opendnssec-1.4.3/version.m40000664000175000017500000000022112247570153012533 00000000000000# $Id: version.m4 7465 2013-12-04 09:05:47Z jakob $ # # this file contains the current OpenDNSSEC version define([OPENDNSSEC_VERSION], [1.4.3]) opendnssec-1.4.3/install-sh0000755000175000017500000003325612247571136012626 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: opendnssec-1.4.3/KNOWN_ISSUES0000664000175000017500000000474312211100573012515 00000000000000$Id: KNOWN_ISSUES 7257 2013-09-02 12:15:55Z sara $ OpenDNSSEC 1.4.0 - Known Restrictions The following are the known problems and/or restrictions of release 1.4.0 of OpenDNSSEC. BUGS: ----- OPENDNSSEC-332: Statistics on average sigs/sec not accurate OPENDNSSEC-437: Problem with invalid signatures on SOA RRset. Limitations on Number of Zones ------------------------------ Owing to contention in the key management database, performance is degraded if OpenDNSSEC is used to sign large numbers of zones that do not share common keys. The problem is worse if SQLite is used for the key and signature manager database. As a workaround, we suggest that either the same key is used for all zones, or that the number of zones be limited to about 5,000. This will be addressed in a future release of the software. Issue with rolling from one algorithm to another ------------------------------------------------ The current version will handle key rollovers that also change algorithm just the same as any other key rollover. This is not sufficient; and so rolling between algorithms is broken and should not be done with the current system. Handling of external command calls ---------------------------------- External commands (e.g. NotifyCommand or DelegationSignerSubmitCommand) are called with popen. This can lead to errors with these external scripts not being noticed by OpenDNSSEC. It is therefore recommended that when writing scripts like these that they log enough information for the user to tell independently if they failed. Maximum number of HSMs ---------------------- The datatype of the column storing HSMs in the kasp database is only large enough to store 127 separate HSMs (with a MySQL backend). Quotation marks in strings -------------------------- Enforcer does not remove/handle any quotation marks in the imported strings. This will create a problem when importing the information from e.g. the policy description field into the Enforcer database. Intermittent segmentation faults on FreeBSD 9 amd64 ------------------------------------------------- Segmentation faults in _pthread_mutex_init_calloc_cb () from /lib/libc.so.7 have been intermittently seen when running regression tests on our FreeBSD test server (amd64, FreeBSD 9.0-RELEASE-p3). The segfaults have been seen to originate in the enforcer, the signer and SQLite on different occasions. These appear to be due to a bug in the FreeBSD malloc/pthread implementation and are not due to issues in the OpenDNSSEC code. opendnssec-1.4.3/conf/0000775000175000017500000000000012247571206011616 500000000000000opendnssec-1.4.3/conf/conf.xml.in0000664000175000017500000000434212104210117013574 00000000000000 @pkcs11_softhsm_module@ OpenDNSSEC 1234 3 local0 @OPENDNSSEC_CONFIG_DIR@/kasp.xml @OPENDNSSEC_CONFIG_DIR@/zonelist.xml @OPENDNSSEC_STATE_DIR@/kasp.db PT3600S @OPENDNSSEC_STATE_DIR@/tmp 4 opendnssec-1.4.3/conf/enforcerstate.rng0000664000175000017500000001705012247571206015115 00000000000000 KSK ZSK CSK opendnssec-1.4.3/conf/enforcerstate.xml.in0000664000175000017500000000241211710346077015530 00000000000000 F4F29F9C-7E0A-4D0E-860D-95E3B0550B54 KSK 2008-01-18T08:00:00+01:00 9132541A-4255-4F40-893D-CD76CDF83F58 ZSK 2008-01-18T08:00:00+01:00 656d6d6b7469736169646f677461 2008-01-18T08:00:00+01:00 5 2048 SoftHSM-42 DFE7265B783F418685380AA784C2F31D default 2008-01-18T08:00:00+01:00 5 1024 SoftHSM-42 8D76C0C49FEB4A97B8E920C7552401CE default 2008-01-18T08:00:00+01:00 opendnssec-1.4.3/conf/addns.rnc0000664000175000017500000000442512021374616013334 00000000000000# $Id: addns.rnc 1920 2009-09-30 07:49:39Z matthijs $ # # Copyright (c) 2011 NLnet Labs # 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, 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 ``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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element Adapter { dns } dns = element DNS { # TSIG secrets tsig*, # inbound zone transfer settings element Inbound { element RequestTransfer { remote+ }?, element AllowNotify { peer+ }? }?, # outbound zone transfer settings element Outbound { element ProvideTransfer { peer+ }?, element Notify { remote+ }? }? } # TSIG secret tsig = element TSIG { element Name { xsd:string }, # http://www.iana.org/assignments/tsig-algorithm-names element Algorithm { xsd:string }, # base64 encoded secret element Secret { xsd:base64Binary } } remote = element Remote { address, port?, key? } peer = element Peer { prefix?, key? } address = element Address { xsd:string } # e.g., 192.0.2.1 or 2001:DB8::1 prefix = element Prefix { xsd:string } # e.g., 192.0.2.0/24 or 2001:DB8::/32 port = element Port { xsd:positiveInteger { maxInclusive = "65535" } } key = element Key { xsd:string } opendnssec-1.4.3/conf/zonelist.rnc0000664000175000017500000000422311665367373014125 00000000000000# $Id: zonelist.rnc 5937 2011-11-30 08:53:15Z matthijs $ # # Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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, 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 ``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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element ZoneList { element Zone { # Name of zone attribute name { xsd:string }, # What policy applies to this zone? # (matches symbolic name of policy in in kasp.xml) element Policy { xsd:string }, # What file containts the signer configuration for this zone? element SignerConfiguration { xsd:string }, element Adapters { # Where do the signer fetch the unsigned zone? element Input { adapter }, # Where do the signer deliver the signed zone? element Output { adapter } } }* } # adapters adapter = adfile | adother # file adapter adfile = element File { xsd:string } # other adapters adother = element Adapter { # Adapter type attribute type { xsd:string }, # Configuration file xsd:string } opendnssec-1.4.3/conf/Makefile.in0000664000175000017500000004462412247571136013617 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 6103 2012-01-26 22:00:03Z jakob $ VPATH = @srcdir@ 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@ subdir = conf DIST_COMMON = $(dist_data_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/addns.xml.in \ $(srcdir)/conf.xml.in $(srcdir)/enforcerstate.xml.in \ $(srcdir)/kasp.xml.in $(srcdir)/signconf.xml.in \ $(srcdir)/zonelist.xml.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = addns.xml conf.xml enforcerstate.xml kasp.xml \ signconf.xml zonelist.xml CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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; }; \ } am__installdirs = "$(DESTDIR)$(datadir)" DATA = $(dist_data_DATA) $(noinst_DATA) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@/opendnssec 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@/opendnssec target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in RNC = addns.rnc conf.rnc kasp.rnc zonelist.rnc signconf.rnc enforcerstate.rnc RNG = addns.rng conf.rng kasp.rng zonelist.rng signconf.rng enforcerstate.rng XML = addns.xml conf.xml kasp.xml zonelist.xml signconf.xml enforcerstate.xml XSL = kasp2html.xsl TRANG = $(srcdir)/trang/trang.jar noinst_DATA = ${XML} ${XSL} dist_data_DATA = ${RNG} ${RNC} ${XSL} CLEANFILES = + ${XML} DISTCLEANFILES = + ${RNG} SUFFIXES = .rng .rnc .xml all: all-am .SUFFIXES: .SUFFIXES: .rng .rnc .xml $(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 conf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign conf/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): addns.xml: $(top_builddir)/config.status $(srcdir)/addns.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf.xml: $(top_builddir)/config.status $(srcdir)/conf.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ enforcerstate.xml: $(top_builddir)/config.status $(srcdir)/enforcerstate.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ kasp.xml: $(top_builddir)/config.status $(srcdir)/kasp.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ signconf.xml: $(top_builddir)/config.status $(srcdir)/signconf.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ zonelist.xml: $(top_builddir)/config.status $(srcdir)/zonelist.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_dataDATA: $(dist_data_DATA) @$(NORMAL_INSTALL) test -z "$(datadir)" || $(MKDIR_P) "$(DESTDIR)$(datadir)" @list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dist_dataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 $(DATA) installdirs: for dir in "$(DESTDIR)$(datadir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_dataDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_dataDATA .MAKE: install-am install-data-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-hook \ install-dist_dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-dist_dataDATA TRANG_URL "https://code.google.com/p/jing-trang/" $(TRANG): @echo You need to manually fetch trang.jar from ${TRANG_URL} @echo and copy trang.jar to ${TRANG} before rebuilding @echo the RelaxNG schemas. .rnc.rng: @test -x "${JAVA}" || \ (echo "java is required for converting RelaxNG Compact to RelaxNG"; false) ${JAVA} -jar ${TRANG} $< $@ regress: $(RNG) @test -x "${XMLLINT}" || \ (echo "xmllint is required for regression tests"; false) @for i in ${XML}; do \ ${XMLLINT} --noout --relaxng \ `basename $$i .xml`.rng $$i || exit 1; \ done @test -x "${XSLTPROC}" || \ (echo "xsltproc is required for regression tests"; false) @${XSLTPROC} -o kasp.html $(srcdir)/kasp2html.xsl kasp.xml && \ (echo "kasp.xml built") install-data-hook: test -d ${DESTDIR}${sysconfdir} || mkdir -p ${DESTDIR}${sysconfdir} test -f ${DESTDIR}${sysconfdir}/conf.xml || \ ${INSTALL_DATA} -m 0640 conf.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} -m 640 conf.xml ${DESTDIR}${sysconfdir}/conf.xml.sample test -f ${DESTDIR}${sysconfdir}/addns.xml || \ ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir}/addns.xml.sample test -f ${DESTDIR}${sysconfdir}/zonelist.xml || \ ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir}/zonelist.xml.sample test -f ${DESTDIR}${sysconfdir}/kasp.xml || \ ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir}/kasp.xml.sample # 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: opendnssec-1.4.3/conf/conf.rnc0000664000175000017500000001164412021357234013166 00000000000000# $Id: conf.rnc 6606 2012-09-04 10:57:32Z jerry $ # # Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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, 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 ``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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element Configuration { # List of all known Key Repositories (aka HSM:s) element RepositoryList { element Repository { # Symbolic name of repository attribute name { xsd:string }, # PKCS#11 Module (aka shared library) element Module { xsd:string }, # PKCS#11 Token Label, element TokenLabel { xsd:string }, # PKCS#11 Login Credentials element PIN { xsd:string }?, # Maxmimum number of key pairs in the repository # DEFAULT: infinite element Capacity { xsd:positiveInteger }?, # Require backup of keys before use (optional) element RequireBackup { empty }?, # Do not maintain public keys in the repository (optional) element SkipPublicKey { empty }? }* }, # Common configuration options element Common { # Configuration parameters for logging element Logging { element Verbosity { xsd:nonNegativeInteger }?, element Syslog { # syslog facility element Facility { syslogFacility } }? }?, # Location to find the KASP file element PolicyFile { xsd:string }, # Location to store the zonelist XML file element ZoneListFile { xsd:string } }, # Configuration parameters for the KASP Enforcer element Enforcer { # User & group to drop privs to privs?, # Number of Worker Threads # DEFAULT: 1 element WorkerThreads { xsd:positiveInteger }?, # Where to store internal Enforcer state element Datastore { (mysql | sqlite) }, # Interval between runs of the key rollover procedure element Interval { xsd:duration }, # Use manual key generation? element ManualKeyGeneration { empty }?, # How long before a KSK Rollover should we start warning (optional) element RolloverNotification { xsd:duration }?, # Command to use for submitting new DS records to a parent - # the command should accept DNSKEY RRsets via STDIN element DelegationSignerSubmitCommand { xsd:string }? }, # Configuration parameters for the Signer element Signer { # User & group to drop privs to privs?, # Location to store intermediate zone information # DEFAULT: $(localstatedir)/opendnssec/tmp element WorkingDirectory { xsd:string }?, # Number of Worker Threads # DEFAULT: 4 element WorkerThreads { xsd:positiveInteger }?, # Number of Signer Threads # DEFAULT: 4 element SignerThreads { xsd:positiveInteger }?, # Listener element Listener { interface* }?, # System command to call after a zone has been (re)signed # # '%zone' in the string will be replaced by the zone name # '%zonefile' in the string will be replaced by the zone file element NotifyCommand { xsd:string }? }? } syslogFacility = ( "kern" | "user" | "mail" | "daemon" | "auth" | "lpr" | "news" | "uucp" | "cron" | "local0" | "local1" | "local2" | "local3" | "local4" | "local5" | "local6" | "local7" ) privs = element Privileges { # DEFAULT: do not drop privs element User { xsd:string }?, # DEFAULT: do not drop privs element Group { xsd:string }? } mysql = element MySQL { element Host { # DEFAULT: 3306 attribute port { xsd:positiveInteger { maxInclusive = "65535" } }?, # DEFAULT: 127.0.0.1 xsd:string }?, # database to use for KASP tables element Database { xsd:string }, # username and password used to connect to database element Username { xsd:string }, element Password { xsd:string } } sqlite = element SQLite { xsd:string } interface = element Interface { address?, port? } address = element Address { xsd:string } # e.g., 192.0.2.1 or 2001:DB8::1 port = element Port { xsd:positiveInteger { maxInclusive = "65535" } } opendnssec-1.4.3/conf/zonelist.xml.in0000664000175000017500000000160711665367373014553 00000000000000 opendnssec-1.4.3/conf/kasp.rng0000664000175000017500000002344212247571205013210 00000000000000 counter datecounter unixtime keep 255 65535 255 255 opendnssec-1.4.3/conf/signconf.rng0000664000175000017500000001362312247571205014060 00000000000000 65535 255 counter datecounter unixtime keep 65535 opendnssec-1.4.3/conf/kasp.rnc0000664000175000017500000001303012225762517013200 00000000000000# $Id: kasp.rnc 7358 2013-10-11 11:47:27Z matthijs $ # # Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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, 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 ``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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element KASP { element Policy { # (short) symbolic name for Policy attribute name { xsd:string }, # description of policy (free text) element Description { xsd:string }, # hold parameters related to signatures # These will go in the signature category in the DB # Most of these will be passed to the signer without # processing. element Signatures { # how often should the zone be (re)signed? element Resign { xsd:duration }, # the signatures are reused for a period of time # how long time before the expiration of the signature # should it be refreshed? element Refresh { xsd:duration }, # for how long should a signature be valid? element Validity { element Default { xsd:duration }, element Denial { xsd:duration } }, # how much should we jitter the signature expiration time? # (e.g. increase the expiration time by X) element Jitter { xsd:duration }, # how much should we predate the signature inception time? element InceptionOffset { xsd:duration } }, # use NSEC or NSEC3? element Denial { (nsec | nsec3) }, element Keys { # TTL for DNSKEYs ttl, # key retirement safety factor element RetireSafety { xsd:duration }, # key publication safety factor element PublishSafety { xsd:duration }, # do the zones share the same keys? element ShareKeys { empty }?, # enforcer may purge keys after this amount of time element Purge { xsd:duration }?, # Key Signing Keys (KSK) parameters element KSK { # generic key definition, see below anykey, # use RFC 5011 for key rollover? # Not implemented yet element RFC5011 { empty }? }*, # Zone Signing Keys (ZSK) parameters element ZSK { # generic key definition, see below anykey }* }, element Zone { # Expected propagation delay in child publication propagationdelay, # Expected zone SOA parameters element SOA { anysoa, serial } }, # Excepted paren parameters for key rollover usage. # These might be guess or obtained by querying the parent zone # NOTE: This assumes that all zones with the same policy have # the same parent or at least parents with the same parameters! element Parent { # Expected propagation delay in parent publication propagationdelay, # Expected TTL of DS in parent element DS { ttl }, # Expected parent SOA parameters element SOA { anysoa } } }* } serial = element Serial { # use increasing counter (sync with unsigned zone if possible) "counter" | # use increasing counter in YYYYMMDDxx format "datecounter" | # use unix timestamp as an 32-bit unsigned integer "unixtime" | # keep the serial from unsigned zone (do not resign unless incremented) "keep" } nsec = element NSEC { empty } nsec3 = element NSEC3 { # what value for NSEC3PARAM TTL to use? Default 0. ttl?, # use global NSEC3 opt-out? element OptOut { empty }?, # how often should we resalt? (e.g. create new NSEC3 chains) element Resalt { xsd:duration }, # NSEC3 hash parameters element Hash { element Algorithm { xsd:nonNegativeInteger { maxInclusive = "255" } }, element Iterations { xsd:nonNegativeInteger { maxInclusive = "65535" } }, # Salt length in octets element Salt { attribute length { xsd:nonNegativeInteger { maxInclusive = "255" } }, # The actual salt is generated by the Enforcer # Note: the enforcer may decide to store the # current salt in the DB and so it could be exported # here. xsd:string? } } } # Generic SOA definition anysoa = ttl, element Minimum { xsd:duration } # Generic key definition anykey = element Algorithm { attribute length { xsd:positiveInteger }?, xsd:nonNegativeInteger { maxInclusive = "255" } }, element Lifetime { xsd:duration }, element Repository { xsd:string }, # Number of Standby keys # Makes the rollover faster, since the key is # already pre-published and ready. element Standby { xsd:nonNegativeInteger }?, # Use manual key rollover? element ManualRollover { empty }? ttl = element TTL { xsd:duration } propagationdelay = element PropagationDelay { xsd:duration } partial = element Partial { empty } opendnssec-1.4.3/conf/zonelist.rng0000664000175000017500000000614212247571205014117 00000000000000 opendnssec-1.4.3/conf/addns.rng0000664000175000017500000001031312247571204013333 00000000000000 65535 opendnssec-1.4.3/conf/kasp.xml.in0000664000175000017500000000637412225762517013640 00000000000000 A default policy that will amaze you and your friends PT2H P3D P14D P14D PT12H PT3600S P100D 1 5 PT3600S PT3600S PT3600S P14D 8 P1Y SoftHSM 8 P90D SoftHSM PT43200S PT3600S PT3600S unixtime PT9999S PT3600S PT172800S PT10800S Quick turnaround policy for lab work PT10M PT30M PT1H PT1H PT1M PT3600S PT300S PT360S PT360S P14D 8 P1Y SoftHSM 8 PT4H SoftHSM PT300S PT300S PT300S unixtime PT9999S PT3600S PT172800S PT10800S opendnssec-1.4.3/conf/conf.rng0000664000175000017500000002315212247571204013174 00000000000000 kern user mail daemon auth lpr news uucp cron local0 local1 local2 local3 local4 local5 local6 local7 65535 65535 opendnssec-1.4.3/conf/kasp2html.xsl0000664000175000017500000004211611701063475014175 00000000000000 KASP

KASP: Key and Signature Policy

Policy:

Signatures

Resign
Refresh
Validity Default
Validity NSEC/NSEC3
Jitter
Inception Offset

Denial of Existence

Method NSEC
Method NSEC3
Opt-Out
Resalt
Hash Algorithm
Hash Iterations
Hash Salt Length

Key Parameters

TTL
Retire Safety
Publish Safety
Share Keys?
Purge dead keys after
KSK
ZSK
Use RFC5011?

Zone Parameters

Propagation Delay
SOA TTL
SOA Minimum
SOA Serial Format

Parent Parameters

Propagation Delay
DS TTL
SOA TTL
SOA Minimum
Reserved ( ) RSA/MD5 (deprecated) Diffie-Hellman DSA/SHA-1 Reserved for ECC RSA/SHA-1 DSA/SHA-1 for NSEC3 RSA/SHA-1 for NSEC3 RSA/SHA-256 RSA/SHA-512 Reserved for indirect keys Private algorithms - domain name Private algorithms - OID Reserved ( ) Unassigned ( ) SHA-1 Counter UNIX Timestamp (as 32-bit Unsigned Integer) YYYYMMDDnn (Date + 2-Digit-Counter) Keep Serial from the Unsigned Zone Yes No Algorithm , bits Lifetime Repository Number of Standby Keys Manual Rollover? day days month months year years second seconds minute minutes hour hours
opendnssec-1.4.3/conf/addns.xml.in0000664000175000017500000000275011711774050013757 00000000000000 secret.example.com hmac-sha256 sw0nMPCswVbes1tmQTm1pcMmpNRK+oGMYN+qKNR/BwQ=
1.2.3.4
dead:beef::1
5353 secret.example.com
1.2.3.4
1.2.3.5 secret.example.com
1.2.3.5
opendnssec-1.4.3/conf/signconf.rnc0000664000175000017500000000662512225762517014064 00000000000000# $Id: signconf.rnc 7358 2013-10-11 11:47:27Z matthijs $ # # Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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, 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 ``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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element SignerConfiguration { zone } zone = element Zone { # zone name attribute name { xsd:string }, # this section is taken directly from the corresponding KASP policy element Signatures { element Resign { xsd:duration }, element Refresh { xsd:duration }, element Validity { element Default { xsd:duration }, element Denial { xsd:duration } }, element Jitter { xsd:duration }, element InceptionOffset { xsd:duration } }, # use NSEC or NSEC3? element Denial { (nsec | nsec3) }, element Keys { # TTL for all DNSKEYs ttl, element Key { # DNSKEY flags element Flags { xsd:nonNegativeInteger { maxInclusive = "65535" } }, # DNSKEY algorithm algorithm, # The key locator is matched against the # PKCS#11 CKA_ID and is specified as a string # of hex characters. element Locator { xsd:hexBinary }, # sign all the DNSKEY RRsets with this key? element KSK { empty }?, # sign all non-DNSKEY RRsets with this key? element ZSK { empty }?, # include this key in the zonefile? element Publish { empty }?, # deactivate this key (i.e. do not recycle any signatures) element Deactivate { empty }? }+ }, # What parameters to use for the SOA record soa } algorithm = element Algorithm { xsd:nonNegativeInteger { maxInclusive = "255" } } ttl = element TTL { xsd:duration } soa = element SOA { ttl, element Minimum { xsd:duration }, serial } # see kasp.rnc for description serial = element Serial { "counter" | "datecounter" | "unixtime" | "keep" } # This section is taken directly from the corresponding KASP policy nsec = element NSEC { empty } # This section is taken directly from the corresponding KASP policy # (except that the NSEC3 Salt is not optional) nsec3 = element NSEC3 { ttl?, element OptOut { empty }?, element Hash { algorithm, element Iterations { xsd:nonNegativeInteger { maxInclusive = "65535" } }, element Salt { xsd:string } } } opendnssec-1.4.3/conf/enforcerstate.rnc0000664000175000017500000001173011710047241015077 00000000000000# $Id: enforcerstate.rnc 6098 2012-01-25 18:49:05Z jakob $ # # Copyright (c) 2012 OpenDNSSEC AB (svb). 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, 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 ``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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element EnforcerState { element Zones { zone+ }, element KeyPairs { keypair+ } } # create table zones( # id integer primary key autoincrement, -- id # name varchar(300) not null , -- name of the parameter # policy_id mediumint not null, # signconf varchar(4096), -- where is the signconf # input varchar(4096), -- where is the input # output varchar(4096), -- where is the output # in_type varchar(512), -- input adapter type # out_type varchar(512), -- output adapter type # # foreign key (policy_id) references policies (id) # ); zone = element Zone { # Name of zone attribute name { xsd:string }, element Keys { key+ }, element NSEC3 { element Salt { xsd:string }, # when was the Salt generated element Generated { xsd:dateTime }? }? } # create table dnsseckeys ( # id integer primary key autoincrement, -- unique id of the key # keypair_id smallint, # zone_id mediumint, # keytype smallint not null, -- zsk or ksk (use code in dnskey record) # state tinyint, -- state of the key (defines valid fields) # publish varchar(64) null default null, -- time when key published into the zone # ready varchar(64) null default null, -- time when the key is ready for use # active varchar(64) null default null, -- time when the key was made active # retire varchar(64) null default null, -- time when the key retires # dead varchar(64) null default null, -- time when key is slated for removal # # # foreign key (zone_id) references zones (id), # foreign key (keypair_id) references keypairs (id) # ); key = element Key { attribute id { xsd:string }, # reference to KeyPair@id element KeyPairId { xsd:string }, element Type { "KSK" | "ZSK" | "CSK" }, element Standby { empty }?, element Publish { xsd:dateTime | empty }?, element Ready { xsd:dateTime | empty }?, element Active { xsd:dateTime | empty }?, element Retire { xsd:dateTime | empty }?, element Dead { xsd:dateTime | empty }? } # create table keypairs( # id integer primary key autoincrement, # HSMkey_id varchar(255) not null, # algorithm tinyint not null, -- algorithm code # size smallint, # securitymodule_id tinyint, -- where the key is stored # generate varchar(64) null default null, -- time key inserted into database # policy_id mediumint, # compromisedflag tinyint, # publickey varchar(1024), -- public key data # pre_backup varchar(64) null default null, -- time when backup was started # backup varchar(64) null default null, -- time when backup was finished # fixedDate tinyint default 0, -- Set to 1 to stop dates from being set according to the policy timings # # foreign key (securitymodule_id) references securitymodules (id), # foreign key (policy_id) references policies (id) # ); keypair = element KeyPair { attribute id { xsd:string }, element Algorithm { xsd:nonNegativeInteger }, element Size { xsd:nonNegativeInteger }, # where to locate the key; HSM and CKA_ID element Repository { xsd:string }, element Locator { xsd:string }, # under what policy was the key pair generated (if applicable) element Policy { xsd:string }?, # when was the key originally generated element Generated { xsd:dateTime }?, # when was the key last backed up element LastBackup { xsd:dateTime }?, # is the key compromised? element Compromised { empty }? } opendnssec-1.4.3/conf/signconf.xml.in0000664000175000017500000000211712225762517014477 00000000000000 PT2H P3D P7D P14D PT12H PT300S 1 10 656d6d6b7469736169646f677461 PT3600S 257 5 DFE7265B783F418685380AA784C2F31D 256 5 8D76C0C49FEB4A97B8E920C7552401CE PT3600S PT3600S unixtime opendnssec-1.4.3/conf/Makefile.am0000664000175000017500000000411111710346343013563 00000000000000# $Id: Makefile.am 6103 2012-01-26 22:00:03Z jakob $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in RNC = addns.rnc conf.rnc kasp.rnc zonelist.rnc signconf.rnc enforcerstate.rnc RNG = addns.rng conf.rng kasp.rng zonelist.rng signconf.rng enforcerstate.rng XML = addns.xml conf.xml kasp.xml zonelist.xml signconf.xml enforcerstate.xml XSL= kasp2html.xsl TRANG= $(srcdir)/trang/trang.jar TRANG_URL "https://code.google.com/p/jing-trang/" sysconfdir = @sysconfdir@/opendnssec datadir = @datadir@/opendnssec noinst_DATA = ${XML} ${XSL} dist_data_DATA = ${RNG} ${RNC} ${XSL} CLEANFILES =+ ${XML} DISTCLEANFILES =+ ${RNG} SUFFIXES = .rng .rnc .xml $(TRANG): @echo You need to manually fetch trang.jar from ${TRANG_URL} @echo and copy trang.jar to ${TRANG} before rebuilding @echo the RelaxNG schemas. .rnc.rng: @test -x "${JAVA}" || \ (echo "java is required for converting RelaxNG Compact to RelaxNG"; false) ${JAVA} -jar ${TRANG} $< $@ regress: $(RNG) @test -x "${XMLLINT}" || \ (echo "xmllint is required for regression tests"; false) @for i in ${XML}; do \ ${XMLLINT} --noout --relaxng \ `basename $$i .xml`.rng $$i || exit 1; \ done @test -x "${XSLTPROC}" || \ (echo "xsltproc is required for regression tests"; false) @${XSLTPROC} -o kasp.html $(srcdir)/kasp2html.xsl kasp.xml && \ (echo "kasp.xml built") install-data-hook: test -d ${DESTDIR}${sysconfdir} || mkdir -p ${DESTDIR}${sysconfdir} test -f ${DESTDIR}${sysconfdir}/conf.xml || \ ${INSTALL_DATA} -m 0640 conf.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} -m 640 conf.xml ${DESTDIR}${sysconfdir}/conf.xml.sample test -f ${DESTDIR}${sysconfdir}/addns.xml || \ ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir}/addns.xml.sample test -f ${DESTDIR}${sysconfdir}/zonelist.xml || \ ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir}/zonelist.xml.sample test -f ${DESTDIR}${sysconfdir}/kasp.xml || \ ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir}/kasp.xml.sample opendnssec-1.4.3/enforcer/0000775000175000017500000000000012247571202012470 500000000000000opendnssec-1.4.3/enforcer/Makefile.in0000664000175000017500000005076112247571136014474 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 615 2009-05-06 08:52:03Z jakob $ VPATH = @srcdir@ 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@ subdir = enforcer DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = ksm common enforcerd utils test all: all-recursive .SUFFIXES: $(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 enforcer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign enforcer/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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am doxygen: rm -fr $(top_builddir)/enforcer/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-enforcer" \ SRCDIR=$(top_srcdir)/enforcer \ OUTPUTDIR=$(top_builddir)/enforcer/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) # 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: opendnssec-1.4.3/enforcer/common/0000775000175000017500000000000012247571203013761 500000000000000opendnssec-1.4.3/enforcer/common/kaspaccess.h0000664000175000017500000000351411750474637016210 00000000000000/* * $Id: kaspaccess.h 6301 2012-05-03 12:27:11Z jerry $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. * */ #ifndef ENFORCER_KASPACCESS_H #define ENFORCER_KASPACCESS_H /* * kaspaccess.h kasp acccess functions needed by keygend */ #include int kaspReadConfig(DAEMONCONFIG* config); void kaspSetPolicyDefaults(KSM_POLICY *policy, char *name); void kaspConnect(DAEMONCONFIG* config, DB_HANDLE *handle); int kaspTryConnect(DAEMONCONFIG* config, DB_HANDLE *handle); void kaspDisconnect(DB_HANDLE *handle); int kaspReadPolicy(KSM_POLICY* policy); #endif /* ENFORCER_KASPACCESS_H */ opendnssec-1.4.3/enforcer/common/kaspaccess.c0000664000175000017500000001115611750474637016204 00000000000000/* * $Id: kaspaccess.c 6301 2012-05-03 12:27:11Z jerry $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. * */ /* * kaspaccess.c kasp acccess functions needed by keygend */ #include #include #include "daemon.h" #include "daemon_util.h" #include "kaspaccess.h" #include "ksm/string_util.h" #include "ksm/string_util2.h" /* * Set defaults for policies * Make sure that we set everything, any new policy items need to be added here. */ void kaspSetPolicyDefaults(KSM_POLICY *policy, char *name) { if (policy == NULL) { log_msg(NULL, LOG_ERR, "Error in kaspSetPolicyDefaults, no policy provided"); return; } if (name) { snprintf(policy->name, KSM_NAME_LENGTH, "%s", name); } policy->signer->refresh = 0; policy->signer->jitter = 0; policy->signer->propdelay = 0; policy->signer->soamin = 0; policy->signer->soattl = 0; policy->signer->serial = 0; policy->signature->clockskew = 0; policy->signature->resign = 0; policy->signature->valdefault = 0; policy->signature->valdenial = 0; policy->denial->version = 0; policy->denial->resalt = 0; policy->denial->algorithm = 0; policy->denial->iteration = 0; policy->denial->optout = 0; policy->denial->ttl = 0; policy->denial->saltlength = 0; policy->keys->ttl = 0; policy->keys->retire_safety = 0; policy->keys->publish_safety = 0; policy->keys->share_keys = 0; policy->keys->purge = -1; policy->ksk->algorithm = 0; policy->ksk->bits = 0; policy->ksk->lifetime = 0; policy->ksk->sm = 0; policy->ksk->overlap = 0; policy->ksk->ttl = 0; policy->ksk->rfc5011 = 0; policy->ksk->type = KSM_TYPE_KSK; policy->ksk->standby_keys = 0; policy->ksk->manual_rollover = 0; policy->ksk->rollover_scheme = KSM_ROLL_DEFAULT; policy->zsk->algorithm = 0; policy->zsk->bits = 0; policy->zsk->lifetime = 0; policy->zsk->sm = 0; policy->zsk->overlap = 0; policy->zsk->ttl = 0; policy->zsk->rfc5011 = 0; policy->zsk->type = KSM_TYPE_ZSK; policy->zsk->standby_keys = 0; policy->zsk->manual_rollover = 0; policy->zsk->rollover_scheme = 0; policy->enforcer->keycreate = 0; policy->enforcer->backup_interval = 0; policy->enforcer->keygeninterval = 0; policy->zone->propdelay = 0; policy->zone->soa_ttl = 0; policy->zone->soa_min = 0; policy->zone->serial = 0; policy->parent->propdelay = 0; policy->parent->ds_ttl = 0; policy->parent->soa_ttl = 0; policy->parent->soa_min = 0; } /* * Connect to the DB */ void kaspConnect(DAEMONCONFIG* config, DB_HANDLE *handle) { /* Note that all these XML derived strings are unsigned chars */ if (DbConnect(handle, (char *)config->schema, (char *)config->host, (char *)config->password, (char *)config->user, (char *)config->port) != 0) { unlink(config->pidfile); exit(-1); } } /* * Try and connect to the DB */ int kaspTryConnect(DAEMONCONFIG* config, DB_HANDLE *handle) { /* Note that all these XML derived strings are unsigned chars */ if (DbConnect(handle, (char *)config->schema, (char *)config->host, (char *)config->password, (char *)config->user, (char *)config->port) != 0) { return 1; } return 0; } /* * Disconnect from the DB */ void kaspDisconnect(DB_HANDLE*handle) { (void) DbDisconnect(*handle); } /* * Read a policy */ int kaspReadPolicy(KSM_POLICY* policy) { /* This fn checks that the policy exists for us */ return KsmPolicyRead(policy); } opendnssec-1.4.3/enforcer/common/daemon.h0000664000175000017500000000723012236213021015304 00000000000000/* * $Id: daemon.h 7385 2013-11-05 16:00:17Z sara $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. * */ #ifndef ENFORCER_DAEMON_H #define ENFORCER_DAEMON_H /* * daemon.h code needed to get a daemon up and running * * edit the DAEMONCONFIG and cmlParse function * in daemon_util.[c|h] to add options specific * to your app * * gcc -o daemon daemon_util.c daemon.c * * Most of this is based on stuff I have seen in NSD */ #include "config.h" #include #ifdef HAVE_STDBOOL_H # include #else # ifndef HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else # define _Bool signed char # endif /* __cplusplus */ # endif /* HAVE__BOOL */ # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif /* HAVE_STDBOOL_H */ #include #include #include /* Define some lengths of the char*s in the struct MySQL allows e.g. 81 characters for the username, set these stupidly high though */ #define MAX_PROG_NAME_LENGTH 255 #define MAX_USER_LENGTH 255 #define MAX_HOST_LENGTH 255 #define MAX_PASSWORD_LENGTH 255 #define MAX_SCHEMA_LENGTH 255 #define MAX_PORT_LENGTH 16 #define MAX_PID_LENGTH 255 #define MAX_LOG_USER_LENGTH 32 #ifdef LOG_DAEMON #define DEFAULT_LOG_FACILITY LOG_DAEMON #define DEFAULT_LOG_FACILITY_STRING "LOG_DAEMON" #else #define DEFAULT_LOG_FACILITY LOG_USER #define DEFAULT_LOG_FACILITY_STRING "LOG_USER" #endif /* LOG_DAEMON */ /* struct to hold configuration */ typedef struct { /* stuff that daemons always have */ const char *program; bool debug; bool once; pid_t pid; char *pidfile; uid_t uid; gid_t gid; char *username; char *groupname; #if 0 char *chrootdir; #endif /* flag to indicate that SIGTERM was recieved */ int term; /* Add app specific stuff here */ char *configfile; unsigned char* user; unsigned char* host; unsigned char* password; unsigned char* schema; unsigned char* port; uint16_t interval; uint16_t keygeninterval; /* TODO remove this */ int keycreate; int manualKeyGeneration; int rolloverNotify; char* DSSubmitCmd; int DSSubCKA_ID; char* policy; int log_user; /* log facility (or default of LOG_DAEMON) */ } DAEMONCONFIG; extern int daemon_our_pidfile; #define AUTHOR_NAME "John Dickinson" #define COPYRIGHT_STR "Copyright (C) 2008 2009 Nominet UK" #endif /* ENFORCER_DAEMON_H */ opendnssec-1.4.3/enforcer/common/daemon.c0000664000175000017500000001721312236213021015301 00000000000000/* * $Id: daemon.c 7385 2013-11-05 16:00:17Z sara $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. * */ /* * daemon.c code needed to get a daemon up and running * * edit the DAEMONCONFIG and cmlParse function * in daemon_util.[c|h] to add options specific * to your app * * gcc -o daemon daemon_util.c daemon.c * * Most of this is based on stuff I have seen in NSD */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "daemon.h" #include "daemon_util.h" #include "privdrop.h" #include "ksm/ksm.h" #include "ksm/dbsmsg.h" #include "ksm/dbsdef.h" #include "ksm/kmemsg.h" #include "ksm/kmedef.h" #include "ksm/message.h" #include "ksm/string_util.h" #ifndef MAXPATHLEN # define MAXPATHLEN 4096 #endif extern int server_init(DAEMONCONFIG *config); extern void server_main(DAEMONCONFIG *config); DAEMONCONFIG config; void sig_handler (int sig) { switch (sig) { case SIGCHLD: return; case SIGHUP: return; case SIGALRM: break; case SIGILL: break; case SIGUSR1: break; case SIGINT: config.term = 2; break; case SIGTERM: config.term = 1; break; default: break; } } int daemon_our_pidfile = 0; void exit_function(void) { /* Only unlink pidfile if its our pidfile */ if (daemon_our_pidfile) { unlink(config.pidfile); } } int main(int argc, char *argv[]){ int fd; struct sigaction action; const char* program; /* Temporary for program name */ config.debug = false; config.once = false; config.pidfile = NULL; config.program = NULL; config.host = NULL; config.port = NULL; config.user = (unsigned char *)calloc(MAX_USER_LENGTH, sizeof(char)); config.password = (unsigned char *)calloc(MAX_PASSWORD_LENGTH, sizeof(char)); config.schema = (unsigned char *)calloc(MAX_SCHEMA_LENGTH, sizeof(char)); config.DSSubmitCmd = (char *)calloc(MAXPATHLEN + 1024, sizeof(char)); config.policy = NULL; if (config.user == NULL || config.password == NULL || config.schema == NULL) { log_msg(&config, LOG_ERR, "Malloc for config struct failed"); exit(1); } config.term = 0; /* Lets set up the logging first */ /* The program name is the last component of the program file name */ if ((program = strrchr(argv[0], '/'))) { /* EQUALS */ ++program; /* Point to character after last "/" */ } else { program = argv[0]; /* No slash, so use string given */ } config.program = program; config.log_user = DEFAULT_LOG_FACILITY; log_init(config.log_user, config.program); /* useful message */ log_msg(&config, LOG_INFO, "%s starting...", PACKAGE_NAME); #ifdef ENFORCER_TIMESHIFT if (getenv("ENFORCER_TIMESHIFT")) { log_msg(&config, LOG_INFO, "Timeshift mode detected, running once only!"); fprintf(stderr, "WARNING: Timeshift mode detected, running once only!\n"); config.once = true; config.debug = true; } #endif /* ENFORCER_TIMESHIFT */ /* Process command line */ cmdlParse(&config, &argc, argv); if(config.debug) log_msg(&config, LOG_INFO, "%s DEBUG ON.", PACKAGE_NAME); /* If we dont debug then fork */ if(!config.debug){ /* Fork */ switch ((config.pid = fork())) { case 0: break; case -1: log_msg(&config, LOG_ERR, "fork failed: %s", strerror(errno)); unlink(config.pidfile); exit(1); default: fprintf(stdout, "OpenDNSSEC ods-enforcerd started (version %s), pid %d\n", PACKAGE_VERSION, (int) config.pid); log_msg(&config, LOG_INFO, "%s Parent exiting...", PACKAGE_NAME); exit(0); } /* Detach ourselves... */ if (setsid() == -1) { log_msg(&config, LOG_ERR, "setsid() failed: %s", strerror(errno)); exit(1); } if ((fd = open("/dev/null", O_RDWR, 0)) != -1) { (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDERR_FILENO); if (fd > 2) (void)close(fd); } log_msg(&config, LOG_INFO, "%s forked OK...", PACKAGE_NAME); } else { log_msg(&config, LOG_INFO, "%s in debug mode - not forking...", PACKAGE_NAME); } action.sa_handler = sig_handler; sigfillset(&action.sa_mask); action.sa_flags = 0; sigaction(SIGTERM, &action, NULL); sigaction(SIGHUP, &action, NULL); sigaction(SIGINT, &action, NULL); sigaction(SIGILL, &action, NULL); sigaction(SIGUSR1, &action, NULL); sigaction(SIGALRM, &action, NULL); sigaction(SIGCHLD, &action, NULL); action.sa_handler = SIG_IGN; sigaction(SIGPIPE, &action, NULL); /* Get perms that we will be dropping to */ if (getPermsForDrop(&config) != 0) { exit(1); } /* Run the server specific code. You need to provide this function somewhere this sets our pidfile */ if (server_init(&config) != 0) { exit(1); } /* make the directory for the pidfile if required; do this before we drop privs */ if (createPidDir(&config) != 0) { exit(1); } /* * Drop permissions. * This function exits if something goes wrong */ privdrop(config.username, config.groupname, NULL); config.uid = geteuid(); config.gid = getegid(); config.pid = getpid(); atexit(exit_function); log_msg(&config, LOG_NOTICE, "%s started (version %s), pid %d", PACKAGE_NAME, PACKAGE_VERSION, (int) config.pid); MsgInit(); MsgRegister(KME_MIN_VALUE, KME_MAX_VALUE, m_messages, ksm_log_msg); MsgRegister(DBS_MIN_VALUE, DBS_MAX_VALUE, d_messages, ksm_log_msg); /* Do something. You need to provide this function somewhere */ server_main(&config); /* Free stuff here (exit from sigs pass through) */ MsgRundown(); if (config.host) free(config.host); if (config.port) free(config.port); free(config.user); free(config.password); free(config.schema); free(config.DSSubmitCmd); StrFree(config.username); StrFree(config.groupname); #if 0 StrFree(config.chrootdir); #endif exit(0); } opendnssec-1.4.3/enforcer/common/Makefile.in0000664000175000017500000004415412247571136015763 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ # $Id: Makefile.am 5348 2011-08-03 13:01:40Z rb $ VPATH = @srcdir@ 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@ subdir = enforcer/common DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libenforcer_a_AR = $(AR) $(ARFLAGS) libenforcer_a_LIBADD = am_libenforcer_a_OBJECTS = daemon.$(OBJEXT) daemon_util.$(OBJEXT) \ kaspaccess.$(OBJEXT) privdrop.$(OBJEXT) libenforcer_a_OBJECTS = $(am_libenforcer_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common 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 = $(libenforcer_a_SOURCES) DIST_SOURCES = $(libenforcer_a_SOURCES) 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@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ 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@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/../ksm/include \ -I$(builddir)/../ksm/include \ @XML2_INCLUDES@ \ @DB_INCLUDES@ noinst_LIBRARIES = libenforcer.a libenforcer_a_SOURCES = daemon.c daemon.h \ daemon_util.c daemon_util.h \ kaspaccess.c kaspaccess.h \ privdrop.c privdrop.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 enforcer/common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign enforcer/common/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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libenforcer.a: $(libenforcer_a_OBJECTS) $(libenforcer_a_DEPENDENCIES) $(EXTRA_libenforcer_a_DEPENDENCIES) -rm -f libenforcer.a $(libenforcer_a_AR) libenforcer.a $(libenforcer_a_OBJECTS) $(libenforcer_a_LIBADD) $(RANLIB) libenforcer.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kaspaccess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privdrop.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 $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 $(LIBRARIES) installdirs: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES 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-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # 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: opendnssec-1.4.3/enforcer/common/daemon_util.h0000664000175000017500000000574411770104425016362 00000000000000/* * $Id: daemon_util.h 6442 2012-06-19 14:13:41Z jerry $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. * */ #ifndef ENFORCER_DAEMON_UTIL_H #define ENFORCER_DAEMON_UTIL_H /* * daemon_util.h code needed to get a daemon up and running * * edit the DAEMONCONFIG and cmlParse function * in daemon_util.[c|h] to add options specific * to your app * * gcc -o daemon daemon_util.c daemon.c * * Most of this is based on stuff I have seen in NSD */ #include "daemon.h" #include /** * Use _r() functions on platforms that have. They are thread safe versions of * the normal syslog functions. Platforms without _r() usually have thread safe * normal functions. */ #if defined(HAVE_SYSLOG_R) && defined(HAVE_OPENLOG_R) && defined(HAVE_CLOSELOG_R) && defined(HAVE_VSYSLOG_R) extern struct syslog_data sdata; #else #undef HAVE_SYSLOG_R #undef HAVE_OPENLOG_R #undef HAVE_CLOSELOG_R #undef HAVE_VSYSLOG_R #endif void cmdlParse(DAEMONCONFIG*, int*, char**); void log_init(int facility, const char *program_name); void log_switch(int facility, const char *facility_name, const char *program_name, int verbose); void log_msg(DAEMONCONFIG* config, int priority, const char *format, ...); void ksm_log_msg(const char *format); void log_xml_error(void *ignore, const char *format, ...); void log_xml_warn(void *ignore, const char *format, ...); int getPermsForDrop(DAEMONCONFIG* config); int writepid (DAEMONCONFIG *config); int createPidDir (DAEMONCONFIG *config); int make_directory(DAEMONCONFIG *config, const char* path); int ReadConfig(DAEMONCONFIG *config, int verbose); int get_lite_lock(char *lock_filename, FILE* lock_fd); int release_lite_lock(FILE* lock_fd); int get_log_user(const char* username, int* usernumber); #endif /* ENFORCER_DAEMON_UTIL_H */ opendnssec-1.4.3/enforcer/common/daemon_util.c0000664000175000017500000011742412236213021016343 00000000000000/* * $Id: daemon_util.c 7385 2013-11-05 16:00:17Z sara $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. * */ /* * daemon_util.c code needed to get a daemon up and running * * edit the DAEMONCONFIG and cmlParse function * in daemon_util.[c|h] to add options specific * to your app * * gcc -o daemon daemon_util.c daemon.c * * Most of this is based on stuff I have seen in NSD */ #include "config.h" #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "daemon.h" #include "daemon_util.h" #include "ksm/database.h" #include "ksm/datetime.h" #include "ksm/string_util.h" #include "ksm/string_util2.h" /** * Use _r() functions on platforms that have. They are thread safe versions of * the normal syslog functions. Platforms without _r() usually have thread safe * normal functions. */ #if defined(HAVE_SYSLOG_R) && defined(HAVE_OPENLOG_R) && defined(HAVE_CLOSELOG_R) && defined(HAVE_VSYSLOG_R) struct syslog_data sdata = SYSLOG_DATA_INIT; #else #undef HAVE_SYSLOG_R #undef HAVE_OPENLOG_R #undef HAVE_CLOSELOG_R #undef HAVE_VSYSLOG_R #endif int getPermsForDrop(DAEMONCONFIG* config) { int status = 0; xmlDocPtr doc = NULL; xmlDocPtr rngdoc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlRelaxNGParserCtxtPtr rngpctx = NULL; xmlRelaxNGValidCtxtPtr rngctx = NULL; xmlRelaxNGPtr schema = NULL; xmlChar *user_expr = (unsigned char*) "//Configuration/Enforcer/Privileges/User"; xmlChar *group_expr = (unsigned char*) "//Configuration/Enforcer/Privileges/Group"; char* filename = NULL; char* rngfilename = OPENDNSSEC_SCHEMA_DIR "/conf.rng"; char* temp_char = NULL; struct passwd *pwd; struct group *grp; FILE *file; if (config->configfile != NULL) { filename = StrStrdup(config->configfile); } else { filename = StrStrdup(OPENDNSSEC_CONFIG_FILE); } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { /* To get a better error message try to open the file */ file = fopen(filename, "r"); if (file == NULL) { log_msg(config, LOG_ERR, "Error: unable to open file \"%s\"", filename); } else { log_msg(config, LOG_ERR, "Error: unable to parse file \"%s\"", filename); fclose(file); } return(-1); } /* Load rng document */ rngdoc = xmlParseFile(rngfilename); if (rngdoc == NULL) { /* To get a better error message try to open the file */ file = fopen(rngfilename, "r"); if (file == NULL) { log_msg(config, LOG_ERR, "Error: unable to open file \"%s\"", rngfilename); } else { log_msg(config, LOG_ERR, "Error: unable to parse file \"%s\"", rngfilename); fclose(file); } return(-1); } /* Create an XML RelaxNGs parser context for the relax-ng document. */ rngpctx = xmlRelaxNGNewDocParserCtxt(rngdoc); if (rngpctx == NULL) { log_msg(config, LOG_ERR, "Error: unable to create XML RelaxNGs parser context"); return(-1); } /* parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. */ schema = xmlRelaxNGParse(rngpctx); if (schema == NULL) { log_msg(config, LOG_ERR, "Error: unable to parse a schema definition resource"); return(-1); } /* Create an XML RelaxNGs validation context based on the given schema */ rngctx = xmlRelaxNGNewValidCtxt(schema); if (rngctx == NULL) { log_msg(config, LOG_ERR, "Error: unable to create RelaxNGs validation context based on the schema"); return(-1); } xmlRelaxNGSetValidErrors(rngctx, (xmlRelaxNGValidityErrorFunc) log_xml_error, (xmlRelaxNGValidityWarningFunc) log_xml_warn, NULL); /* Validate a document tree in memory. */ status = xmlRelaxNGValidateDoc(rngctx,doc); if (status != 0) { log_msg(config, LOG_ERR, "Error validating file \"%s\"", filename); return(-1); } /* Now parse a value out of the conf */ /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { log_msg(config, LOG_ERR,"Error: unable to create new XPath context"); xmlFreeDoc(doc); return(-1); } /* Set the group if specified */ xpathObj = xmlXPathEvalExpression(group_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", group_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { temp_char = (char*) xmlXPathCastToString(xpathObj); StrAppend(&config->groupname, temp_char); StrFree(temp_char); } else { config->groupname = NULL; } xmlXPathFreeObject(xpathObj); /* Set the user to drop to if specified */ xpathObj = xmlXPathEvalExpression(user_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", user_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { temp_char = (char*) xmlXPathCastToString(xpathObj); StrAppend(&config->username, temp_char); StrFree(temp_char); } else { config->username = NULL; } xmlXPathFreeObject(xpathObj); /* Set uid and gid if required */ if (config->username != NULL) { /* Lookup the user id in /etc/passwd */ if ((pwd = getpwnam(config->username)) == NULL) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "user '%s' does not exist. exiting...\n", config->username); #else syslog(LOG_ERR, "user '%s' does not exist. exiting...\n", config->username); #endif exit(1); } else { config->uid = pwd->pw_uid; } endpwent(); } if (config->groupname) { /* Lookup the group id in /etc/groups */ if ((grp = getgrnam(config->groupname)) == NULL) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "group '%s' does not exist. exiting...\n", config->groupname); #else syslog(LOG_ERR, "group '%s' does not exist. exiting...\n", config->groupname); #endif exit(1); } else { config->gid = grp->gr_gid; } endgrent(); } xmlRelaxNGFree(schema); xmlRelaxNGFreeValidCtxt(rngctx); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(doc); xmlFreeDoc(rngdoc); StrFree(filename); return 0; } /* Set up logging as per default (facility may be switched based on config file) */ void log_init(int facility, const char *program_name) { #ifdef HAVE_OPENLOG_R openlog_r(program_name, 0, facility, &sdata); #else openlog(program_name, 0, facility); #endif } /* Switch log to new facility */ void log_switch(int facility, const char *facility_name, const char *program_name, int verbose) { #ifdef HAVE_CLOSELOG_R closelog_r(&sdata); #else closelog(); #endif #ifdef HAVE_OPENLOG_R openlog_r(program_name, 0, facility, &sdata); #else openlog(program_name, 0, facility); #endif if (verbose) { log_msg(NULL, LOG_INFO, "Switched log facility to: %s", facility_name); } } void log_msg(DAEMONCONFIG *config, int priority, const char *format, ...) { /* If the variable arg list is bad then random errors can occur */ va_list args; if (config && config->debug) priority = LOG_ERR; va_start(args, format); #ifdef HAVE_VSYSLOG_R vsyslog_r(priority, &sdata, format, args); #else vsyslog(priority, format, args); #endif va_end(args); } /* * log function suitable for libksm callback */ void ksm_log_msg(const char *format) { if (strncmp(format, "ERROR:", 6) == 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "%s", format); #else syslog(LOG_ERR, "%s", format); #endif } else if (strncmp(format, "INFO:", 5) == 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_INFO, &sdata, "%s", format); #else syslog(LOG_INFO, "%s", format); #endif } else if (strncmp(format, "WARNING:", 8) == 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_WARNING, &sdata, "%s", format); #else syslog(LOG_WARNING, "%s", format); #endif } else if (strncmp(format, "DEBUG:", 6) == 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_DEBUG, &sdata, "%s", format); #else syslog(LOG_DEBUG, "%s", format); #endif } else { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "%s", format); #else syslog(LOG_ERR, "%s", format); #endif } } /* XML Error Message */ void log_xml_error(void *ignore, const char *format, ...) { va_list args; (void) ignore; /* If the variable arg list is bad then random errors can occur */ va_start(args, format); #ifdef HAVE_VSYSLOG_R vsyslog_r(LOG_ERR, &sdata, format, args); #else vsyslog(LOG_ERR, format, args); #endif va_end(args); } /* XML Warning Message */ void log_xml_warn(void *ignore, const char *format, ...) { va_list args; (void) ignore; /* If the variable arg list is bad then random errors can occur */ va_start(args, format); #ifdef HAVE_VSYSLOG_R vsyslog_r(LOG_INFO, &sdata, format, args); #else vsyslog(LOG_INFO, format, args); #endif va_end(args); } static void usage(const char* prog) { fprintf(stderr, "Usage: %s [OPTION]...\n", prog); fprintf(stderr, "OpenDNSSEC Enforcer version %s\n\n", VERSION); fprintf(stderr, "Supported options:\n"); fprintf(stderr, " -c Use alternate conf.xml.\n"); fprintf(stderr, " -d Debug.\n"); fprintf(stderr, " -1 Run once, then exit.\n"); fprintf(stderr, " -p Run once processing only the specified policy, then exit.\n"); /* fprintf(stderr, " -u user Change effective uid to the specified user.\n");*/ fprintf(stderr, " -P Specify the PID file to write.\n"); fprintf(stderr, " -V Print version.\n"); fprintf(stderr, " -[?|h] This help.\n"); } static void version(void) { fprintf(stderr, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); fprintf(stderr, "Written by %s.\n\n", AUTHOR_NAME); fprintf(stderr, "%s. This is free software.\n", COPYRIGHT_STR); fprintf(stderr, "See source files for more license information\n"); exit(0); } int write_data(DAEMONCONFIG *config, FILE *file, const void *data, size_t size) { size_t result; if (size == 0) return 1; result = fwrite(data, 1, size, file); if (result == 0) { log_msg(config, LOG_ERR, "write failed: %s", strerror(errno)); return 0; } else if (result < size) { log_msg(config, LOG_ERR, "short write (disk full?)"); return 0; } else { return 1; } } static pid_t readpid(const char *file) { int fd; pid_t pid; char pidbuf[32]; char *t; int l; if ((fd = open(file, O_RDONLY)) == -1) { return -1; } if (((l = read(fd, pidbuf, sizeof(pidbuf)))) == -1) { close(fd); return -1; } close(fd); /* Empty pidfile means no pidfile... */ if (l == 0) { errno = ENOENT; return -1; } pid = strtol(pidbuf, &t, 10); if (*t && *t != '\n') { return -1; } return pid; } int writepid (DAEMONCONFIG *config) { FILE * fd; char pidbuf[32]; struct stat stat_ret; pid_t oldpid; /* If the file exists then either we didn't shutdown cleanly or an enforcer is * already running; in either case shutdown */ if (stat(config->pidfile, &stat_ret) != 0) { if (errno != ENOENT) { log_msg(config, LOG_ERR, "cannot stat pidfile %s: %s", config->pidfile, strerror(errno)); return -1; } } else { if (S_ISREG(stat_ret.st_mode)) { /* The file exists already */ if ((oldpid = readpid(config->pidfile)) == -1) { /* consider stale pidfile */ if (errno != ENOENT) { log_msg(config, LOG_ERR, "cannot read pidfile %s: %s", config->pidfile, strerror(errno)); } } else { if (kill(oldpid, 0) == 0 || errno == EPERM) { log_msg(config, LOG_ERR, "pidfile %s already exists, " "a process with pid %u is already running. " "If no ods-enforcerd process is running, a previous " "instance didn't shutdown cleanly, please remove this " "file and try again.", config->pidfile, oldpid); exit(1); } else { log_msg(config, LOG_WARNING, "pidfile %s already exists, " "but no process with pid %u is running. " "A previous instance didn't shutdown cleanly, this " "pidfile is stale.", config->pidfile, oldpid); } } } } /* All good, carry on */ snprintf(pidbuf, sizeof(pidbuf), "%lu\n", (unsigned long) config->pid); if ((fd = fopen(config->pidfile, "w")) == NULL ) { return -1; } if (!write_data(config, fd, pidbuf, strlen(pidbuf))) { fclose(fd); return -1; } fclose(fd); if (chown(config->pidfile, config->uid, config->gid) == -1) { log_msg(config, LOG_ERR, "cannot chown(%u,%u) %s: %s", (unsigned) config->uid, (unsigned) config->gid, config->pidfile, strerror(errno)); return -1; } /* Mark this our pidfile so exit_function unlink's it */ daemon_our_pidfile = 1; return 0; } int createPidDir (DAEMONCONFIG *config) { char* directory = NULL; char* slash; struct stat stat_ret; char *path = getenv("PWD"); /* Find the directory part of the (fully qualified) pidfile */ if (*config->pidfile != '/') { StrAppend(&directory, path); StrAppend(&directory, "/"); StrAppend(&directory, config->pidfile); } else { directory = StrStrdup(config->pidfile); } slash = strrchr(directory, '/'); *slash = 0; /* Check that it exists */ if (stat(directory, &stat_ret) != 0) { if (errno != ENOENT) { log_msg(config, LOG_ERR, "cannot stat directory %s: %s", directory, strerror(errno)); return -1; } } if (S_ISDIR(stat_ret.st_mode)) { /* Do nothing, the directory exists already */ } else { /* try to create it */ if (make_directory(config, directory) != 0) { StrFree(directory); return -1; } } StrFree(directory); return 0; } int make_directory(DAEMONCONFIG* config, const char* path) { char* parent; char* slash; struct stat stat_ret; parent = StrStrdup(path); slash = strrchr(parent, '/'); *slash = 0; if (stat(parent, &stat_ret) != 0) { if (errno != ENOENT) { log_msg(NULL, LOG_ERR, "cannot stat %s: %s\n", parent, strerror(errno)); return 1; } } if (!S_ISDIR(stat_ret.st_mode)) { make_directory(config, parent); } StrFree(parent); if (mkdir(path, (S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) != 0) { log_msg(NULL, LOG_ERR, "cannot create directory %s: %s\n", path, strerror(errno)); return 1; } if (chown(path, config->uid, config->gid) == -1) { log_msg(config, LOG_ERR, "cannot chown(%u,%u) %s: %s", (unsigned) config->uid, (unsigned) config->gid, path, strerror(errno)); return 1; } return 0; } void cmdlParse(DAEMONCONFIG* config, int *argc, char **argv) { int c; /* * Read the command line */ while ((c = getopt(*argc, argv, "1c:hdV?u:P:p:")) != -1) { switch (c) { case '1': config->once = true; break; case 'c': config->configfile = optarg; break; case 'd': config->debug = true; break; case 'P': config->pidfile = optarg; break; case 'u': break; /* disable this feature */ config->username = optarg; /* Parse the username into uid and gid */ config->gid = getgid(); config->uid = getuid(); if (*config->username) { struct passwd *pwd; if (isdigit(*config->username)) { char *t; config->uid = strtol(config->username, &t, 10); if (*t != 0) { if (*t != '.' || !isdigit(*++t)) { log_msg(config, LOG_ERR, "-u user or -u uid or -u uid.gid. exiting..."); exit(1); } config->gid = strtol(t, &t, 10); } else { /* Lookup the group id in /etc/passwd */ if ((pwd = getpwuid(config->uid)) == NULL) { log_msg(config, LOG_ERR, "user id %u does not exist. exiting...", (unsigned) config->uid); exit(1); } else { config->gid = pwd->pw_gid; } endpwent(); } } else { /* Lookup the user id in /etc/passwd */ if ((pwd = getpwnam(config->username)) == NULL) { log_msg(config, LOG_ERR, "user '%s' does not exist. exiting...", config->username); exit(1); } else { config->uid = pwd->pw_uid; config->gid = pwd->pw_gid; } endpwent(); } } break; case 'p': config->policy = optarg; config->once = true; fprintf(stdout, "Will only process policy \"%s\", will only run once. Check the logs for results. \n", config->policy); break; case 'h': usage(config->program); exit(0); case '?': usage(config->program); exit(0); case 'V': version(); exit(0); default: usage(config->program); exit(0); } } } /* * Returns 0 if the the config file could be read and non-zero if it could not. * * Any function calling this should exit on a non-zero return. */ int ReadConfig(DAEMONCONFIG *config, int verbose) { xmlDocPtr doc = NULL; xmlDocPtr rngdoc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlRelaxNGParserCtxtPtr rngpctx = NULL; xmlRelaxNGValidCtxtPtr rngctx = NULL; xmlRelaxNGPtr schema = NULL; xmlChar *iv_expr = (unsigned char*) "//Configuration/Enforcer/Interval"; xmlChar *mk_expr = (unsigned char*) "//Configuration/Enforcer/ManualKeyGeneration"; xmlChar *rn_expr = (unsigned char*) "//Configuration/Enforcer/RolloverNotification"; xmlChar *ds_expr = (unsigned char*) "//Configuration/Enforcer/DelegationSignerSubmitCommand"; xmlChar *litexpr = (unsigned char*) "//Configuration/Enforcer/Datastore/SQLite"; xmlChar *mysql_host = (unsigned char*) "//Configuration/Enforcer/Datastore/MySQL/Host"; xmlChar *mysql_port = (unsigned char*) "//Configuration/Enforcer/Datastore/MySQL/Host/@port"; xmlChar *mysql_db = (unsigned char*) "//Configuration/Enforcer/Datastore/MySQL/Database"; xmlChar *mysql_user = (unsigned char*) "//Configuration/Enforcer/Datastore/MySQL/Username"; xmlChar *mysql_pass = (unsigned char*) "//Configuration/Enforcer/Datastore/MySQL/Password"; xmlChar *log_user_expr = (unsigned char*) "//Configuration/Common/Logging/Syslog/Facility"; int mysec = 0; char *logFacilityName; int my_log_user = DEFAULT_LOG_FACILITY; int status; int db_found = 0; char* filename = NULL; char* rngfilename = OPENDNSSEC_SCHEMA_DIR "/conf.rng"; char* temp_char = NULL; char* str = NULL; /* used to split DSSub command */ FILE *file; /* Change the config file location if one was provided on the command line */ if (config->configfile != NULL) { filename = StrStrdup(config->configfile); } else { filename = StrStrdup(OPENDNSSEC_CONFIG_FILE); } if (verbose) { log_msg(config, LOG_INFO, "Reading config \"%s\"", filename); } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { /* To get a better error message try to open the file */ file = fopen(filename, "r"); if (file == NULL) { log_msg(config, LOG_ERR, "Error: unable to open file \"%s\"", filename); } else { log_msg(config, LOG_ERR, "Error: unable to parse file \"%s\"", filename); fclose(file); } return(-1); } /* Load rng document */ if (verbose) { log_msg(config, LOG_INFO, "Reading config schema \"%s\"", rngfilename); } rngdoc = xmlParseFile(rngfilename); if (rngdoc == NULL) { /* To get a better error message try to open the file */ file = fopen(rngfilename, "r"); if (file == NULL) { log_msg(config, LOG_ERR, "Error: unable to open file \"%s\"", rngfilename); } else { log_msg(config, LOG_ERR, "Error: unable to parse file \"%s\"", rngfilename); fclose(file); } return(-1); } /* Create an XML RelaxNGs parser context for the relax-ng document. */ rngpctx = xmlRelaxNGNewDocParserCtxt(rngdoc); if (rngpctx == NULL) { log_msg(config, LOG_ERR, "Error: unable to create XML RelaxNGs parser context"); return(-1); } /* parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. */ schema = xmlRelaxNGParse(rngpctx); if (schema == NULL) { log_msg(config, LOG_ERR, "Error: unable to parse a schema definition resource"); return(-1); } /* Create an XML RelaxNGs validation context based on the given schema */ rngctx = xmlRelaxNGNewValidCtxt(schema); if (rngctx == NULL) { log_msg(config, LOG_ERR, "Error: unable to create RelaxNGs validation context based on the schema"); return(-1); } xmlRelaxNGSetValidErrors(rngctx, (xmlRelaxNGValidityErrorFunc) log_xml_error, (xmlRelaxNGValidityWarningFunc) log_xml_warn, NULL); /* Validate a document tree in memory. */ status = xmlRelaxNGValidateDoc(rngctx,doc); if (status != 0) { log_msg(config, LOG_ERR, "Error validating file \"%s\"", filename); return(-1); } xmlRelaxNGFreeValidCtxt(rngctx); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); /* Now parse a value out of the conf */ /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { log_msg(config, LOG_ERR,"Error: unable to create new XPath context"); xmlFreeDoc(doc); return(-1); } /* Evaluate xpath expression for interval */ xpathObj = xmlXPathEvalExpression(iv_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", iv_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } temp_char = (char *)xmlXPathCastToString(xpathObj); status = DtXMLIntervalSeconds(temp_char, &mysec); if (status > 0) { log_msg(config, LOG_ERR, "Error: unable to convert Interval %s to seconds, error: %i", temp_char, status); StrFree(temp_char); return status; } else if (status == -1) { log_msg(config, LOG_INFO, "Info: converting %s to seconds; M interpreted as 31 days, Y interpreted as 365 days", temp_char); } config->interval = mysec; if (verbose) { log_msg(config, LOG_INFO, "Communication Interval: %i", config->interval); } StrFree(temp_char); xmlXPathFreeObject(xpathObj); /* Evaluate xpath expression for Manual key generation */ xpathObj = xmlXPathEvalExpression(mk_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", mk_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { /* Manual key generation tag is present */ config->manualKeyGeneration = 1; } else { /* Tag absent */ config->manualKeyGeneration = 0; } xmlXPathFreeObject(xpathObj); /* Evaluate xpath expression for rollover notification interval */ xpathObj = xmlXPathEvalExpression(rn_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", rn_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { /* Tag RolloverNotification is present; set rolloverNotify */ temp_char = (char *)xmlXPathCastToString(xpathObj); status = DtXMLIntervalSeconds(temp_char, &mysec); if (status > 0) { log_msg(config, LOG_ERR, "Error: unable to convert RolloverNotification %s to seconds, error: %i", temp_char, status); StrFree(temp_char); xmlXPathFreeObject(xpathObj); return status; } else if (status == -1) { log_msg(config, LOG_INFO, "Info: converting %s to seconds; M interpreted as 31 days, Y interpreted as 365 days", temp_char); } config->rolloverNotify = mysec; if (verbose) { log_msg(config, LOG_INFO, "Rollover Notification Interval: %i", config->rolloverNotify); } StrFree(temp_char); } else { /* Tag RolloverNotification absent, set rolloverNotify to -1 */ config->rolloverNotify = -1; } xmlXPathFreeObject(xpathObj); /* Evaluate xpath expression for DelegationSignerSubmitCommand */ xpathObj = xmlXPathEvalExpression(ds_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", ds_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { /* Tag DelegationSignerSubmitCommand is present; set DSSubmitCmd */ if (config->DSSubmitCmd != NULL) { StrFree(config->DSSubmitCmd); } config->DSSubmitCmd = (char *)xmlXPathCastToString(xpathObj); /* If the string ends " --cka_id" strip that off and set flag */ str = strstr(config->DSSubmitCmd, " --cka_id"); if (str) { config->DSSubCKA_ID = 1; *str = 0; } else { config->DSSubCKA_ID = 0; } if (verbose) { log_msg(config, LOG_INFO, "Using command: %s to submit DS records", config->DSSubmitCmd); } } else { if (verbose) { log_msg(config, LOG_INFO, "No DS Submit command supplied"); } config->DSSubmitCmd[0] = '\0'; } xmlXPathFreeObject(xpathObj); /* Evaluate xpath expression for SQLite file location */ xpathObj = xmlXPathEvalExpression(litexpr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", litexpr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { db_found = SQLITE_DB; if (config->schema != NULL) { StrFree(config->schema); } config->schema = xmlXPathCastToString(xpathObj); if (verbose) { log_msg(config, LOG_INFO, "SQLite database set to: %s", config->schema); } } xmlXPathFreeObject(xpathObj); if (db_found == 0) { db_found = MYSQL_DB; /* Get all of the MySQL stuff read in too */ /* HOST */ xpathObj = xmlXPathEvalExpression(mysql_host, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", mysql_host); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { if (config->host != NULL) { StrFree(config->host); } config->host = xmlXPathCastToString(xpathObj); if (verbose) { log_msg(config, LOG_INFO, "MySQL database host set to: %s", config->host); } } xmlXPathFreeObject(xpathObj); /* PORT */ xpathObj = xmlXPathEvalExpression(mysql_port, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", mysql_port); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { if (config->port != NULL) { StrFree(config->port); } config->port = xmlXPathCastToString(xpathObj); if (verbose) { log_msg(config, LOG_INFO, "MySQL database port set to: %s", config->port); } } xmlXPathFreeObject(xpathObj); /* SCHEMA */ xpathObj = xmlXPathEvalExpression(mysql_db, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", mysql_db); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { if (config->schema != NULL) { StrFree(config->schema); } config->schema = xmlXPathCastToString(xpathObj); if (verbose) { log_msg(config, LOG_INFO, "MySQL database schema set to: %s", config->schema); } } else { db_found = 0; } xmlXPathFreeObject(xpathObj); /* DB USER */ xpathObj = xmlXPathEvalExpression(mysql_user, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", mysql_user); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { if (config->user != NULL) { StrFree(config->user); } config->user = xmlXPathCastToString(xpathObj); if (verbose) { log_msg(config, LOG_INFO, "MySQL database user set to: %s", config->user); } } else { db_found = 0; } xmlXPathFreeObject(xpathObj); /* DB PASSWORD */ xpathObj = xmlXPathEvalExpression(mysql_pass, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", mysql_pass); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } /* password may be blank */ if (config->password != NULL) { StrFree(config->password); } config->password = xmlXPathCastToString(xpathObj); if (verbose) { log_msg(config, LOG_INFO, "MySQL database password set"); } xmlXPathFreeObject(xpathObj); } /* Check that we found one or the other database */ if(db_found == 0) { log_msg(config, LOG_ERR, "Error: unable to find complete database connection expression in %s", filename); xmlFreeDoc(doc); return(-1); } /* Check that we found the right database type */ if (db_found != DbFlavour()) { log_msg(config, LOG_ERR, "Error: Config file %s specifies database type %s but system is compiled to use %s", filename, (db_found==1) ? "MySQL" : "sqlite3", (db_found==2) ? "MySQL" : "sqlite3"); xmlFreeDoc(doc); return(-1); } /* Evaluate xpath expression for log facility (user) */ xpathObj = xmlXPathEvalExpression(log_user_expr, xpathCtx); if(xpathObj == NULL) { log_msg(config, LOG_ERR, "Error: unable to evaluate xpath expression: %s", log_user_expr); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return(-1); } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { /* tag present */ logFacilityName = (char *)xmlXPathCastToString(xpathObj); status = get_log_user(logFacilityName, &my_log_user); if (status > 0) { log_msg(config, LOG_ERR, "Error: unable to set log user: %s, error: %i", logFacilityName, status); StrFree(logFacilityName); xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); return status; } config->log_user = my_log_user; if (verbose) { log_msg(config, LOG_INFO, "Log User set to: %s", logFacilityName); } } else { /* tag _not_ present, use default */ logFacilityName = StrStrdup( (char *)DEFAULT_LOG_FACILITY_STRING ); config->log_user = DEFAULT_LOG_FACILITY; if (verbose) { log_msg(config, LOG_INFO, "Using default log user: %s", logFacilityName); } } xmlXPathFreeObject(xpathObj); log_switch(my_log_user, logFacilityName, config->program, verbose); /* Cleanup */ /* TODO: some other frees are needed */ xmlFreeDoc(doc); StrFree(logFacilityName); StrFree(filename); return(0); } /* To overcome the potential differences in sqlite compile flags assume that it is not happy with multiple connections. The following 2 functions take out a lock and release it */ int get_lite_lock(char *lock_filename, FILE* lock_fd) { struct flock fl; struct timeval tv; if (lock_fd == NULL) { log_msg(NULL, LOG_ERR, "%s could not be opened", lock_filename); return 1; } memset(&fl, 0, sizeof(struct flock)); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; fl.l_pid = getpid(); while (fcntl(fileno(lock_fd), F_SETLK, &fl) == -1) { if (errno == EACCES || errno == EAGAIN) { log_msg(NULL, LOG_INFO, "%s already locked, sleep", lock_filename); /* sleep for 10 seconds TODO make this configurable? */ tv.tv_sec = 10; tv.tv_usec = 0; select(0, NULL, NULL, NULL, &tv); } else { log_msg(NULL, LOG_INFO, "couldn't get lock on %s, %s", lock_filename, strerror(errno)); return 1; } } return 0; } int release_lite_lock(FILE* lock_fd) { struct flock fl; if (lock_fd == NULL) { return 1; } memset(&fl, 0, sizeof(struct flock)); fl.l_type = F_UNLCK; fl.l_whence = SEEK_SET; if (fcntl(fileno(lock_fd), F_SETLK, &fl) == -1) { return 1; } return 0; } /* convert the name of a log facility (user) into a number */ int get_log_user(const char* username, int* usernumber) { char* case_username = NULL; if (username == NULL) { return 1; } /* Start with our default */ *usernumber = DEFAULT_LOG_FACILITY; case_username = StrStrdup(username); (void) StrToUpper(case_username); /* POSIX only specifies LOG_USER and LOG_LOCAL[0 .. 7] */ if (strncmp(case_username, "USER", 4) == 0) { *usernumber = LOG_USER; } #ifdef LOG_KERN else if (strncmp(case_username, "KERN", 4) == 0) { *usernumber = LOG_KERN; } #endif /* LOG_KERN */ #ifdef LOG_MAIL else if (strncmp(case_username, "MAIL", 4) == 0) { *usernumber = LOG_MAIL; } #endif /* LOG_MAIL */ #ifdef LOG_DAEMON else if (strncmp(case_username, "DAEMON", 6) == 0) { *usernumber = LOG_DAEMON; } #endif /* LOG_DAEMON */ #ifdef LOG_AUTH else if (strncmp(case_username, "AUTH", 4) == 0) { *usernumber = LOG_AUTH; } #endif /* LOG_AUTH */ #ifdef LOG_SYSLOG else if (strncmp(case_username, "SYSLOG", 6) == 0) { *usernumber = LOG_SYSLOG; } #endif /* LOG_SYSLOG */ #ifdef LOG_LPR else if (strncmp(case_username, "LPR", 3) == 0) { *usernumber = LOG_LPR; } #endif /* LOG_LPR */ #ifdef LOG_NEWS else if (strncmp(case_username, "NEWS", 4) == 0) { *usernumber = LOG_NEWS; } #endif /* LOG_NEWS */ #ifdef LOG_UUCP else if (strncmp(case_username, "UUCP", 4) == 0) { *usernumber = LOG_UUCP; } #endif /* LOG_UUCP */ #ifdef LOG_AUDIT /* Ubuntu at least doesn't want us to use LOG_AUDIT */ else if (strncmp(case_username, "AUDIT", 5) == 0) { *usernumber = LOG_AUDIT; } #endif /* LOG_AUDIT */ #ifdef LOG_CRON else if (strncmp(case_username, "CRON", 4) == 0) { *usernumber = LOG_CRON; } #endif /* LOG_CRON */ else if (strncmp(case_username, "LOCAL0", 6) == 0) { *usernumber = LOG_LOCAL0; } else if (strncmp(case_username, "LOCAL1", 6) == 0) { *usernumber = LOG_LOCAL1; } else if (strncmp(case_username, "LOCAL2", 6) == 0) { *usernumber = LOG_LOCAL2; } else if (strncmp(case_username, "LOCAL3", 6) == 0) { *usernumber = LOG_LOCAL3; } else if (strncmp(case_username, "LOCAL4", 6) == 0) { *usernumber = LOG_LOCAL4; } else if (strncmp(case_username, "LOCAL5", 6) == 0) { *usernumber = LOG_LOCAL5; } else if (strncmp(case_username, "LOCAL6", 6) == 0) { *usernumber = LOG_LOCAL6; } else if (strncmp(case_username, "LOCAL7", 6) == 0) { *usernumber = LOG_LOCAL7; } StrFree(case_username); return 0; } opendnssec-1.4.3/enforcer/common/Makefile.am0000664000175000017500000000065111616243264015741 00000000000000# $Id: Makefile.am 5348 2011-08-03 13:01:40Z rb $ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/../ksm/include \ -I$(builddir)/../ksm/include \ @XML2_INCLUDES@ \ @DB_INCLUDES@ noinst_LIBRARIES = libenforcer.a libenforcer_a_SOURCES = daemon.c daemon.h \ daemon_util.c daemon_util.h \ kaspaccess.c kaspaccess.h \ privdrop.c privdrop.h opendnssec-1.4.3/enforcer/common/privdrop.c0000664000175000017500000001625011770104425015714 00000000000000/* * $Id: privdrop.c 6442 2012-06-19 14:13:41Z jerry $ * * Copyright (c) 2009 Nominet UK. All rights reserved. * * Based heavily on uidswap.c from openssh-5.2p1 * * 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, 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 ``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 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. * */ #define _GNU_SOURCE /* defines for setres(g|u)id */ #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "privdrop.h" #include "daemon_util.h" int privdrop(const char *username, const char *groupname, const char *newroot) { int status; struct passwd *pwd; struct group *grp; uid_t uid, olduid; gid_t gid, oldgid; long ngroups_max; gid_t *final_groups; int final_group_len = -1; /* Save effective uid/gid */ uid = olduid = geteuid(); gid = oldgid = getegid(); /* Check if we're going to drop uid */ if (username) { /* Lookup the user id in /etc/passwd */ if ((pwd = getpwnam(username)) == NULL) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "user '%s' does not exist. exiting...\n", username); #else syslog(LOG_ERR, "user '%s' does not exist. exiting...\n", username); #endif exit(1); } else { uid = pwd->pw_uid; } endpwent(); } /* Check if we're going to drop gid */ if (groupname) { /* Lookup the group id in /etc/groups */ if ((grp = getgrnam(groupname)) == NULL) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "group '%s' does not exist. exiting...\n", groupname); #else syslog(LOG_ERR, "group '%s' does not exist. exiting...\n", groupname); #endif exit(1); } else { gid = grp->gr_gid; } endgrent(); } /* Change root if requested */ if (newroot) { if (chroot(newroot) != 0 || chdir("/") != 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "chroot to '%s' failed. exiting...\n", newroot); #else syslog(LOG_ERR, "chroot to '%s' failed. exiting...\n", newroot); #endif exit(1); } } /* Do Additional groups first */ if (username != NULL && !olduid) { if (initgroups(username, gid) < 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "initgroups failed: %s: %.100s", username, strerror(errno)); #else syslog(LOG_ERR, "initgroups failed: %s: %.100s", username, strerror(errno)); #endif exit(1); } ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; final_groups = (gid_t *)malloc(ngroups_max *sizeof(gid_t)); if (final_groups == NULL) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "Malloc for group struct failed"); #else syslog(LOG_ERR, "Malloc for group struct failed"); #endif exit(1); } final_group_len = getgroups(ngroups_max, final_groups); /* If we are root then drop all groups other than the final one */ if (!olduid) setgroups(final_group_len, final_groups); free(final_groups); } else { /* If we are root then drop all groups other than the final one */ if (!olduid) setgroups(1, &(gid)); } /* Drop gid? */ if (groupname) { #if defined(HAVE_SETRESGID) && !defined(BROKEN_SETRESGID) status = setresgid(gid, gid, gid); #elif defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID) status = setregid(gid, gid); #else status = setegid(gid); if (status != 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "unable to drop group privileges: %s (%lu). exiting...\n", groupname, (unsigned long) gid); #else syslog(LOG_ERR, "unable to drop group privileges: %s (%lu). exiting...\n", groupname, (unsigned long) gid); #endif exit(1); } status = setgid(gid); #endif if (status != 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "unable to drop group privileges: %s (%lu). exiting...\n", groupname, (unsigned long) gid); #else syslog(LOG_ERR, "unable to drop group privileges: %s (%lu). exiting...\n", groupname, (unsigned long) gid); #endif exit(1); return -1; } else { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "group set to: %s (%lu)\n", groupname, (unsigned long) gid); #else syslog(LOG_ERR, "group set to: %s (%lu)\n", groupname, (unsigned long) gid); #endif } } /* Drop uid? */ if (username) { /* Set the user to drop to if specified; else just set the uid as the real one */ #if defined(HAVE_SETRESUID) && !defined(BROKEN_SETRESUID) status = setresuid(uid, uid, uid); #elif defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID) status = setreuid(uid, uid); #else # ifndef SETEUID_BREAKS_SETUID status = seteuid(uid); if (status != 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "unable to drop user privileges (seteuid): %s (%lu). exiting...\n", username, (unsigned long) uid); #else syslog(LOG_ERR, "unable to drop user privileges (seteuid): %s (%lu). exiting...\n", username, (unsigned long) uid); #endif exit(1); } # endif /* SETEUID_BREAKS_SETUID */ status = setuid(uid); #endif if (status != 0) { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "unable to drop user privileges: %s (%lu). exiting...\n", username, (unsigned long) uid); #else syslog(LOG_ERR, "unable to drop user privileges: %s (%lu). exiting...\n", username, (unsigned long) uid); #endif exit(1); return -1; } else { #ifdef HAVE_SYSLOG_R syslog_r(LOG_ERR, &sdata, "user set to: %s (%lu)\n", username, (unsigned long) uid); #else syslog(LOG_ERR, "user set to: %s (%lu)\n", username, (unsigned long) uid); #endif } } return 0; } opendnssec-1.4.3/enforcer/common/privdrop.h0000664000175000017500000000304611260617577015733 00000000000000/* * $Id: daemon_util.h 1360 2009-07-24 10:45:25Z sion $ * * Copyright (c) 2009 Nominet UK. 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, 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 ``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 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. * */ #ifndef ENFORCER_PRIVDROP_H #define ENFORCER_PRIVDROP_H int privdrop(const char *username, const char *groupname, const char *newroot); #endif /* ENFORCER_PRIVDROP_H */ opendnssec-1.4.3/enforcer/utils/0000775000175000017500000000000012247571203013631 500000000000000opendnssec-1.4.3/enforcer/utils/kaspcheck.c0000664000175000017500000003347512106675735015676 00000000000000/* * $Id: kaspcheck.c 7028 2013-02-13 11:41:17Z sion $ * * Copyright (c) 2012 Nominet UK. 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, 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 ``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 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. */ #define _GNU_SOURCE #include #include #include #include #include "config.h" #include "kaspcheck.h" #include "kc_helper.h" #include "ksm/database.h" #include #include #include #include #include const char *progname = NULL; char *config = (char *) OPENDNSSEC_CONFIG_FILE; char *kasp = NULL; int verbose = 0; char **repo_list = NULL; int repo_count = 0; #define StrFree(ptr) {if(ptr != NULL) {free(ptr); (ptr) = NULL;}} /* * Display usage */ void usage () { fprintf(stderr, "usage: %s [options]\n\n" "Options:\n" " -c, --conf [PATH_TO_CONF_FILE] Path to OpenDNSSEC configuration file\n" " (defaults to %s)\n" " -k, --kasp [PATH_TO_KASP_FILE] Path to KASP policy file\n" " (defaults to the path from the conf.xml file)\n" " -V, --version Display the version information\n" " -v, --verbose Print extra DEBUG messages\n" " -h, --help Show this message\n", progname, OPENDNSSEC_CONFIG_FILE); } /* * Fairly basic main. */ int main (int argc, char *argv[]) { int status = 0; /* Will be non-zero on error (NOT warning) */ int ch; int option_index = 0; int i = 0; int free_config = 0; static struct option long_options[] = { {"config", required_argument, 0, 'c'}, {"help", no_argument, 0, 'h'}, {"kasp", required_argument, 0, 'k'}, {"version", no_argument, 0, 'V'}, {"verbose", no_argument, 0, 'v'}, {0,0,0,0} }; /* The program name is the last component of the program file name */ if ((progname = strrchr(argv[0], '/'))) { /* EQUALS */ ++progname; /* Point to character after last "/" */ } else { progname = argv[0]; } while ((ch = getopt_long(argc, argv, "c:hk:Vv", long_options, &option_index)) != -1) { switch (ch) { case 'c': config = StrStrdup(optarg); free_config = 1; break; case 'h': usage(); exit(0); break; case 'k': kasp = StrStrdup(optarg); break; case 'V': printf("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit(0); break; case 'v': verbose = 1; break; } } /* 0) Some basic setup */ log_init(DEFAULT_LOG_FACILITY, progname); /* 1) Check on conf.xml - set kasp.xml (if -k flag not given) */ status = check_conf(&kasp); /* 2) Checks on kasp.xml */ status += check_kasp(); if (verbose) { dual_log("DEBUG: finished %d\n", status); } xmlCleanupParser(); for (i = 0; i < repo_count; i++) { StrFree(repo_list[i]); } StrFree(repo_list); if (free_config) { StrFree(config); } StrFree(kasp); return status; } /* * Check the conf.xml file * Set kasp.xml from file (unless -k flag was given) * Return status (0 == success; 1 == error) */ int check_conf(char** kasp) { int status = 0; int i = 0; int j = 0; int temp_status = 0; xmlDocPtr doc; xmlXPathContextPtr xpath_ctx; xmlXPathObjectPtr xpath_obj; xmlNode *curNode; xmlChar *xexpr; char* temp_char = NULL; KC_REPO* repo = NULL; int* repo_mods = NULL; /* To see if we have looked at this module before */ const char* rngfilename = OPENDNSSEC_SCHEMA_DIR "/conf.rng"; const char* zonerngfilename = OPENDNSSEC_SCHEMA_DIR "/zonelist.rng"; /* Check that the file is well-formed */ status = check_rng(config, rngfilename); if (status == 0) { dual_log("INFO: The XML in %s is valid\n", config); } else { return status; /* Don't try to read the file if it is invalid */ } /* Load XML document */ doc = xmlParseFile(config); if (doc == NULL) { return 1; } /* Create xpath evaluation context */ xpath_ctx = xmlXPathNewContext(doc); if(xpath_ctx == NULL) { xmlFreeDoc(doc); return 1; } /* REPOSITORY section */ xexpr = (xmlChar *)"//Configuration/RepositoryList/Repository"; xpath_obj = xmlXPathEvalExpression(xexpr, xpath_ctx); if(xpath_obj == NULL) { xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); return 1; } if (xpath_obj->nodesetval) { repo_count = xpath_obj->nodesetval->nodeNr; repo = (KC_REPO*)malloc(sizeof(KC_REPO) * repo_count); repo_mods = (int*)malloc(sizeof(int) * repo_count); repo_list = (char**)malloc(sizeof(char*) * repo_count); if (repo == NULL || repo_mods == NULL || repo_list == NULL) { dual_log("ERROR: malloc for repo information failed\n"); exit(1); } for (i = 0; i < repo_count; i++) { repo_mods[i] = 0; curNode = xpath_obj->nodesetval->nodeTab[i]->xmlChildrenNode; /* Default for capacity */ repo[i].name = (char *) xmlGetProp(xpath_obj->nodesetval->nodeTab[i], (const xmlChar *)"name"); repo_list[i] = StrStrdup(repo[i].name); while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"TokenLabel")) repo[i].TokenLabel = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"Module")) repo[i].module = (char *) xmlNodeGetContent(curNode); curNode = curNode->next; } } } xmlXPathFreeObject(xpath_obj); /* Now we have all the information we need do the checks */ for (i = 0; i < repo_count; i++) { if (repo_mods[i] == 0) { /* 1) Check that the module exists */ status += check_file(repo[i].module, "Module"); repo_mods[i] = 1; /* Done this module */ /* 2) Check repos on the same modules have different TokenLabels */ for (j = i+1; j < repo_count; j++) { if ( repo_mods[j] == 0 && (strcmp(repo[i].module, repo[j].module) == 0) ) { repo_mods[j] = 1; /* done */ if (strcmp(repo[i].TokenLabel, repo[j].TokenLabel) == 0) { dual_log("ERROR: Multiple Repositories (%s and %s) in %s have the same Module (%s) and TokenLabel (%s)\n", repo[i].name, repo[j].name, config, repo[i].module, repo[i].TokenLabel); status += 1; } } } } /* 3) Check that the name is unique */ for (j = i+1; j < repo_count; j++) { if (strcmp(repo[i].name, repo[j].name) == 0) { dual_log("ERROR: Two repositories exist with the same name (%s)\n", repo[i].name); status += 1; } } } /* COMMON section */ /* PolicyFile (aka KASP); we will validate it later */ if (*kasp == NULL) { xexpr = (xmlChar *)"//Configuration/Common/PolicyFile"; xpath_obj = xmlXPathEvalExpression(xexpr, xpath_ctx); if(xpath_obj == NULL) { xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); for (i = 0; i < repo_count; i++) { free(repo[i].name); free(repo[i].module); free(repo[i].TokenLabel); } free(repo); free(repo_mods); return -1; } temp_char = (char*) xmlXPathCastToString(xpath_obj); StrAppend(kasp, temp_char); StrFree(temp_char); xmlXPathFreeObject(xpath_obj); } /* Check that the Zonelist file is well-formed */ xexpr = (xmlChar *)"//Configuration/Common/ZoneListFile"; xpath_obj = xmlXPathEvalExpression(xexpr, xpath_ctx); if(xpath_obj == NULL) { xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); for (i = 0; i < repo_count; i++) { free(repo[i].name); free(repo[i].module); free(repo[i].TokenLabel); } free(repo); free(repo_mods); return -1; } temp_char = (char*) xmlXPathCastToString(xpath_obj); if (check_rng(temp_char, zonerngfilename) == 0) { dual_log("INFO: The XML in %s is valid\n", temp_char); } else { status += 1; } xmlXPathFreeObject(xpath_obj); StrFree(temp_char); /* ENFORCER section */ /* Check defined user/group */ status += check_user_group(xpath_ctx, (xmlChar *)"//Configuration/Enforcer/Privileges/User", (xmlChar *)"//Configuration/Enforcer/Privileges/Group"); /* Check datastore exists (if sqlite) */ /* TODO check datastore matches libksm without building against libksm */ temp_status = check_file_from_xpath(xpath_ctx, "SQLite datastore", (xmlChar *)"//Configuration/Enforcer/Datastore/SQLite"); if (temp_status == -1) { /* Configured for Mysql DB */ /*if (DbFlavour() != MYSQL_DB) { dual_log("ERROR: libksm compiled for sqlite3 but conf.xml configured for MySQL\n"); }*/ } else { status += temp_status; /* Configured for sqlite DB */ /*if (DbFlavour() != SQLITE_DB) { dual_log("ERROR: libksm compiled for MySQL but conf.xml configured for sqlite3\n"); }*/ } /* Warn if Interval is M or Y */ status += check_time_def_from_xpath(xpath_ctx, (xmlChar *)"//Configuration/Enforcer/Interval", "Configuration", "Enforcer/Interval", config); /* Warn if RolloverNotification is M or Y */ status += check_time_def_from_xpath(xpath_ctx, (xmlChar *)"//Configuration/Enforcer/RolloverNotification", "Configuration", "Enforcer/RolloverNotification", config); /* Check DelegationSignerSubmitCommand exists (if set) */ temp_status = check_file_from_xpath(xpath_ctx, "DelegationSignerSubmitCommand", (xmlChar *)"//Configuration/Enforcer/DelegationSignerSubmitCommand"); if (temp_status > 0) { status += temp_status; } /* SIGNER section */ /* Check defined user/group */ status += check_user_group(xpath_ctx, (xmlChar *)"//Configuration/Signer/Privileges/User", (xmlChar *)"//Configuration/Signer/Privileges/Group"); /* Check WorkingDirectory exists (or default) */ temp_status = check_path_from_xpath(xpath_ctx, "WorkingDirectory", (xmlChar *)"//Configuration/Signer/WorkingDirectory"); if (temp_status == -1) { /* Check the default location */ check_path(OPENDNSSEC_STATE_DIR "/tmp", "default WorkingDirectory"); } else { status += temp_status; } xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); for (i = 0; i < repo_count; i++) { free(repo[i].name); free(repo[i].module); free(repo[i].TokenLabel); } free(repo); free(repo_mods); return status; } /* * Check the kasp.xml file * Return status (0 == success; 1 == error) */ int check_kasp() { int status = 0; int i = 0; int j = 0; const char* rngfilename = OPENDNSSEC_SCHEMA_DIR "/kasp.rng"; xmlDocPtr doc; xmlXPathContextPtr xpath_ctx; xmlXPathObjectPtr xpath_obj; xmlNode *curNode; xmlChar *xexpr; int policy_count = 0; char **policy_names = NULL; int default_found = 0; if (kasp == NULL) { dual_log("ERROR: No location for kasp.xml set\n"); return 1; } /* Check that the file is well-formed */ status = check_rng(kasp, rngfilename); if (status ==0) { dual_log("INFO: The XML in %s is valid\n", kasp); } else { return 1; } /* Load XML document */ doc = xmlParseFile(kasp); if (doc == NULL) { return 1; } /* Create xpath evaluation context */ xpath_ctx = xmlXPathNewContext(doc); if(xpath_ctx == NULL) { xmlFreeDoc(doc); return 1; } /* First pass through the whole document to test for a policy called "default" and no duplicate names */ xexpr = (xmlChar *)"//KASP/Policy"; xpath_obj = xmlXPathEvalExpression(xexpr, xpath_ctx); if(xpath_obj == NULL) { xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); return 1; } if (xpath_obj->nodesetval) { policy_count = xpath_obj->nodesetval->nodeNr; policy_names = (char**)malloc(sizeof(char*) * policy_count); if (policy_names == NULL) { dual_log("ERROR: Malloc for policy names failed\n"); exit(1); } for (i = 0; i < policy_count; i++) { policy_names[i] = (char *) xmlGetProp(xpath_obj->nodesetval->nodeTab[i], (const xmlChar *)"name"); } } /* Now we have all the information we need do the checks */ for (i = 0; i < policy_count; i++) { if (strcmp(policy_names[i], "default") == 0) { default_found = 1; } for (j = i+1; j < policy_count; j++) { if ( (strcmp(policy_names[i], policy_names[j]) == 0) ) { dual_log("ERROR: Two policies exist with the same name (%s)\n", policy_names[i]); status += 1; } } } if (default_found == 0) { dual_log("WARNING: No policy named 'default' in %s. This means you will need to refer explicitly to the policy for each zone\n", kasp); } /* Go again; this time check each policy */ for (i = 0; i < policy_count; i++) { curNode = xpath_obj->nodesetval->nodeTab[i]->xmlChildrenNode; status += check_policy(curNode, policy_names[i], repo_list, repo_count, kasp); } for (i = 0; i < policy_count; i++) { free(policy_names[i]); } free(policy_names); xmlXPathFreeObject(xpath_obj); xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); return status; } opendnssec-1.4.3/enforcer/utils/migrate_zone_delete.mysql0000664000175000017500000000015612041743054020644 00000000000000# Migrate existing database for zone delete fix alter table dnsseckeys drop foreign key dnsseckeys_ibfk_1; opendnssec-1.4.3/enforcer/utils/ksmutil.c0000664000175000017500000113310112243342572015406 00000000000000/* * $Id: ksmutil.c 7416 2013-11-21 08:34:02Z matthijs $ * * Copyright (c) 2008-2009 Nominet UK. 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, 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 ``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 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. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include "config.h" #include #include #include #include #include #include #include #include #include #include "ksm/database_statement.h" #include "ksm/db_fields.h" #include #include #include #include "ksm/kmemsg.h" #include "ksm/kmedef.h" #include "ksm/dbsmsg.h" #include "ksm/dbsdef.h" #include "ksm/message.h" #include #include #include #include #include #include #include #include #include #include #include #define MAX(a, b) ((a) > (b) ? (a) : (b)) /* Some value type flags */ #define INT_TYPE 0 #define DURATION_TYPE 1 #define BOOL_TYPE 2 #define REPO_TYPE 3 #define SERIAL_TYPE 4 #define ROLLOVER_TYPE 5 #define INT_TYPE_NO_FREE 6 #ifndef MAXPATHLEN # define MAXPATHLEN 4096 #endif /* We write one log message to syslog */ #ifdef LOG_DAEMON #define DEFAULT_LOG_FACILITY LOG_DAEMON #else #define DEFAULT_LOG_FACILITY LOG_USER #endif /* LOG_DAEMON */ extern char *optarg; extern int optind; const char *progname = NULL; char *config = (char *) OPENDNSSEC_CONFIG_FILE; char *o_keystate = NULL; char *o_algo = NULL; char *o_input = NULL; char *o_in_type = NULL; char *o_cka_id = NULL; char *o_size = NULL; char *o_interval = NULL; char *o_output = NULL; char *o_out_type = NULL; char *o_policy = NULL; char *o_repository = NULL; char *o_signerconf = NULL; char *o_keytype = NULL; char *o_time = NULL; char *o_retire = NULL; char *o_zone = NULL; char *o_zonetotal = NULL; char *o_keytag = NULL; static int all_flag = 0; static int auto_accept_flag = 0; static int ds_flag = 0; static int retire_flag = 1; static int notify_flag = 1; static int verbose_flag = 0; static int xml_flag = 1; static int td_flag = 0; static int force_flag = 0; static int hsm_flag = 1; static int check_repository_flag = 0; static int restart_enforcerd(void); /** * Use _r() functions on platforms that have. They are thread safe versions of * the normal syslog functions. Platforms without _r() usually have thread safe * normal functions. */ #if defined(HAVE_SYSLOG_R) && defined(HAVE_OPENLOG_R) && defined(HAVE_CLOSELOG_R) struct syslog_data sdata = SYSLOG_DATA_INIT; #else #undef HAVE_SYSLOG_R #undef HAVE_OPENLOG_R #undef HAVE_CLOSELOG_R #endif void usage_general () { fprintf(stderr, " help\n" " --version aka -V\n"); } void usage_setup () { fprintf(stderr, " setup\n" "\tImport config into a database (deletes current contents)\n"); } void usage_control () { fprintf(stderr, " start|stop|notify\n" "\tStart, stop or SIGHUP the ods-enforcerd\n"); } void usage_update () { fprintf(stderr, " update kasp\n" " update zonelist\n" " update conf\n" " update all\n" "\tUpdate database from config\n"); } void usage_zoneadd () { fprintf(stderr, " zone add\n" "\t--zone aka -z\n" "\t[--policy ] aka -p\n" "\t[--signerconf ] aka -s\n" "\t[--input ] aka -i\n" "\t[--in-type ] aka -j\n" "\t[--output ] aka -o\n" "\t[--out-type ] aka -q\n" "\t[--no-xml] aka -m\n"); } void usage_zonedel () { fprintf(stderr, " zone delete\n" "\t--zone | --all aka -z / -a\n" "\t[--no-xml] aka -m\n"); } void usage_zonelist () { fprintf(stderr, " zone list\n"); } void usage_zone () { fprintf(stderr, "usage: %s [-c | --config ] zone \n\n", progname); usage_zoneadd (); usage_zonedel (); usage_zonelist (); } void usage_repo () { fprintf(stderr, " repository list\n"); } void usage_policyexport () { fprintf(stderr, " policy export\n" "\t--policy [policy_name] | --all aka -p / -a\n"); } void usage_policyimport () { fprintf(stderr, " policy import\n"); } void usage_policylist () { fprintf(stderr, " policy list\n"); } void usage_policypurge () { fprintf(stderr, " policy purge\n"); } void usage_policy () { fprintf(stderr, "usage: %s [-c | --config ] \n\n", progname); usage_policyexport (); usage_policyimport (); usage_policylist (); usage_policypurge (); } void usage_keylist () { fprintf(stderr, " key list\n" "\t[--verbose]\n" "\t--zone | --all aka -z / -a\n" #if 0 "\t(will appear soon:\n" "\t[--keystate ] aka -e\n" "\t[--keytype ] aka -t\n" "\t[--ds] aka -d)\n" #endif ); } void usage_keyexport () { fprintf(stderr, " key export\n" "\t--zone | --all aka -z / -a\n" "\t[--keystate ] aka -e\n" "\t[--keytype ] aka -t\n" "\t[--ds] aka -d\n"); } void usage_keyimport () { fprintf(stderr, " key import\n" "\t--cka_id aka -k\n" "\t--repository aka -r\n" "\t--zone aka -z\n" "\t--bits aka -b\n" "\t--algorithm aka -g\n" "\t--keystate aka -e\n" "\t--keytype aka -t\n" "\t--time