From f50ae72ec3417cae55dd4e085991c01af9fdc5f1 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Wed, 11 Feb 2009 20:37:59 +0100 Subject: Initial commit --- contrib/zkt/CHANGELOG | 446 ++ contrib/zkt/LICENSE | 30 + contrib/zkt/Makefile.in | 151 + contrib/zkt/README | 44 + contrib/zkt/README.logging | 99 + contrib/zkt/TODO | 37 + contrib/zkt/config.h.in | 217 + contrib/zkt/config_zkt.h | 121 + contrib/zkt/configure | 6838 ++++++++++++++++++++ contrib/zkt/debug.h | 66 + contrib/zkt/dki.c | 1185 ++++ contrib/zkt/dki.h | 185 + contrib/zkt/dnssec-signer.8 | 436 ++ contrib/zkt/dnssec-signer.c | 1002 +++ contrib/zkt/dnssec-zkt.8 | 481 ++ contrib/zkt/dnssec-zkt.c | 823 +++ contrib/zkt/domaincmp.c | 190 + contrib/zkt/domaincmp.h | 40 + contrib/zkt/examples/dnskey.db | 24 + contrib/zkt/examples/dnssec-signer.sh | 12 + contrib/zkt/examples/dnssec-zkt.sh | 12 + contrib/zkt/examples/flat/dist.sh | 70 + contrib/zkt/examples/flat/dnssec.conf | 41 + .../Kdyn.example.net.+003+42138.key | 3 + .../Kdyn.example.net.+003+42138.private | 7 + .../Kdyn.example.net.+005+01355.key | 3 + .../Kdyn.example.net.+005+01355.private | 10 + .../zkt/examples/flat/dyn.example.net./dnskey.db | 29 + .../zkt/examples/flat/dyn.example.net./dnssec.conf | 5 + .../flat/dyn.example.net./dsset-dyn.example.net. | 2 + .../flat/dyn.example.net./keyset-dyn.example.net. | 18 + contrib/zkt/examples/flat/dyn.example.net./zone.db | 136 + .../examples/flat/dyn.example.net./zone.db.dsigned | 136 + .../zkt/examples/flat/dyn.example.net./zone.org | 30 + .../flat/example.net./Kexample.net.+005+01764.key | 3 + .../example.net./Kexample.net.+005+01764.published | 10 + .../flat/example.net./Kexample.net.+005+41151.key | 3 + .../example.net./Kexample.net.+005+41151.private | 10 + .../flat/example.net./Kexample.net.+005+41300.key | 3 + .../example.net./Kexample.net.+005+41300.private | 10 + contrib/zkt/examples/flat/example.net./dnskey.db | 33 + .../examples/flat/example.net./dsset-example.net. | 4 + .../flat/example.net./kexample.net.+005+14829.key | 4 + .../example.net./kexample.net.+005+14829.private | 10 + .../examples/flat/example.net./keyset-example.net. | 19 + contrib/zkt/examples/flat/example.net./zone.db | 43 + .../zkt/examples/flat/example.net./zone.db.signed | 166 + .../examples/flat/keysets/dlvset-sub.example.net. | 2 + .../examples/flat/keysets/dsset-dyn.example.net. | 2 + .../zkt/examples/flat/keysets/dsset-example.net. | 4 + .../examples/flat/keysets/dsset-sub.example.net. | 2 + .../examples/flat/keysets/keyset-dyn.example.net. | 18 + .../zkt/examples/flat/keysets/keyset-example.net. | 19 + .../examples/flat/keysets/keyset-sub.example.net. | 8 + contrib/zkt/examples/flat/named.conf | 99 + .../Ksub.example.net.+001+04254.key | 3 + .../Ksub.example.net.+001+04254.private | 10 + .../Ksub.example.net.+001+56744.key | 3 + .../Ksub.example.net.+001+56744.published | 10 + .../Ksub.example.net.+005+54876.key | 1 + .../Ksub.example.net.+005+54876.private | 10 + .../flat/sub.example.net./dlvset-sub.example.net. | 2 + .../zkt/examples/flat/sub.example.net./dnskey.db | 29 + .../zkt/examples/flat/sub.example.net./dnssec.conf | 14 + contrib/zkt/examples/flat/sub.example.net./zone.db | 25 + .../examples/flat/sub.example.net./zone.db.signed | 103 + contrib/zkt/examples/flat/zkt.log | 2501 +++++++ contrib/zkt/examples/flat/zone.conf | 10 + .../de./example.de./Kexample.de.+005+11867.key | 3 + .../example.de./Kexample.de.+005+11867.published | 10 + .../de./example.de./Kexample.de.+005+17439.key | 4 + .../de./example.de./Kexample.de.+005+17439.private | 10 + .../de./example.de./Kexample.de.+005+35672.key | 3 + .../de./example.de./Kexample.de.+005+35672.private | 10 + .../de./example.de./Kexample.de.+005+41145.key | 3 + .../de./example.de./Kexample.de.+005+41145.private | 10 + .../de./example.de./Kexample.de.+005+59244.key | 3 + .../example.de./Kexample.de.+005+59244.published | 10 + .../hierarchical/de./example.de./dnskey.db | 48 + .../hierarchical/de./example.de./dsset-example.de. | 6 + .../de./example.de./keyset-example.de. | 28 + .../de./example.de./keyset-sub.example.de. | 8 + .../sub.example.de./Ksub.example.de.+001+19793.key | 3 + .../Ksub.example.de.+001+19793.private | 10 + .../Ksub.example.de.+001+51977.depreciated | 10 + .../sub.example.de./Ksub.example.de.+001+51977.key | 3 + .../sub.example.de./Ksub.example.de.+001+55699.key | 3 + .../Ksub.example.de.+001+55699.published | 10 + .../sub.example.de./Ksub.example.de.+005+40998.key | 3 + .../Ksub.example.de.+005+40998.private | 10 + .../sub.example.de./dlvset-sub.example.de. | 2 + .../de./example.de./sub.example.de./dnskey.db | 35 + .../de./example.de./sub.example.de./dnssec.conf | 17 + .../sub.example.de./dsset-sub.example.de. | 2 + .../sub.example.de./keyset-sub.example.de. | 8 + .../de./example.de./sub.example.de./zone.db | 25 + .../de./example.de./sub.example.de./zone.db.signed | 108 + .../examples/hierarchical/de./example.de./zone.db | 37 + .../hierarchical/de./example.de./zone.db.signed | 147 + .../examples/hierarchical/de./keyset-example.de. | 28 + contrib/zkt/examples/hierarchical/dnssec.conf | 40 + contrib/zkt/examples/hierarchical/named.conf | 102 + contrib/zkt/examples/hierarchical/zone.conf | 10 + contrib/zkt/examples/views/dnssec-extern.conf | 39 + contrib/zkt/examples/views/dnssec-intern.conf | 39 + contrib/zkt/examples/views/dnssec-signer-extern | 7 + contrib/zkt/examples/views/dnssec-signer-intern | 7 + contrib/zkt/examples/views/dnssec-zkt-extern | 7 + contrib/zkt/examples/views/dnssec-zkt-intern | 7 + .../example.net./Kexample.net.+005+10367.key | 3 + .../example.net./Kexample.net.+005+10367.published | 10 + .../example.net./Kexample.net.+005+23553.key | 1 + .../example.net./Kexample.net.+005+23553.private | 10 + .../example.net./Kexample.net.+005+35744.key | 4 + .../example.net./Kexample.net.+005+35744.private | 10 + .../examples/views/extern/example.net./dnskey.db | 30 + .../views/extern/example.net./dsset-example.net. | 2 + .../views/extern/example.net./keyset-example.net. | 10 + .../zkt/examples/views/extern/example.net./zone.db | 33 + .../views/extern/example.net./zone.db.signed | 109 + contrib/zkt/examples/views/extern/zkt-ext.log | 28 + .../example.net./Kexample.net.+005+00126.key | 1 + .../example.net./Kexample.net.+005+00126.private | 10 + .../example.net./Kexample.net.+005+05972.key | 1 + .../example.net./Kexample.net.+005+05972.private | 10 + .../example.net./Kexample.net.+005+23375.key | 3 + .../example.net./Kexample.net.+005+23375.published | 10 + .../examples/views/intern/example.net./dnskey.db | 30 + .../views/intern/example.net./dsset-example.net. | 2 + .../views/intern/example.net./keyset-example.net. | 10 + .../zkt/examples/views/intern/example.net./zone.db | 33 + .../views/intern/example.net./zone.db.signed | 109 + contrib/zkt/examples/views/intern/zkt-int.log | 169 + contrib/zkt/examples/views/named.conf | 97 + contrib/zkt/examples/views/named.log | 17 + contrib/zkt/examples/views/root.hint | 45 + contrib/zkt/examples/views/viewtest.sh | 20 + contrib/zkt/examples/zone.db | 45 + contrib/zkt/examples/zone.db.signed | 146 + contrib/zkt/log.c | 443 ++ contrib/zkt/log.h | 66 + contrib/zkt/misc.c | 1157 ++++ contrib/zkt/misc.h | 84 + contrib/zkt/ncparse.c | 317 + contrib/zkt/ncparse.h | 41 + contrib/zkt/rollover.c | 615 ++ contrib/zkt/rollover.h | 52 + contrib/zkt/strlist.c | 166 + contrib/zkt/strlist.h | 46 + contrib/zkt/tags | 324 + contrib/zkt/zconf.c | 775 +++ contrib/zkt/zconf.h | 173 + contrib/zkt/zkt-soaserial.c | 222 + contrib/zkt/zkt.c | 354 + contrib/zkt/zkt.h | 46 + contrib/zkt/zone.c | 336 + contrib/zkt/zone.h | 66 + 157 files changed, 23288 insertions(+) create mode 100644 contrib/zkt/CHANGELOG create mode 100644 contrib/zkt/LICENSE create mode 100644 contrib/zkt/Makefile.in create mode 100644 contrib/zkt/README create mode 100644 contrib/zkt/README.logging create mode 100644 contrib/zkt/TODO create mode 100644 contrib/zkt/config.h.in create mode 100644 contrib/zkt/config_zkt.h create mode 100755 contrib/zkt/configure create mode 100644 contrib/zkt/debug.h create mode 100644 contrib/zkt/dki.c create mode 100644 contrib/zkt/dki.h create mode 100644 contrib/zkt/dnssec-signer.8 create mode 100644 contrib/zkt/dnssec-signer.c create mode 100644 contrib/zkt/dnssec-zkt.8 create mode 100644 contrib/zkt/dnssec-zkt.c create mode 100644 contrib/zkt/domaincmp.c create mode 100644 contrib/zkt/domaincmp.h create mode 100644 contrib/zkt/examples/dnskey.db create mode 100755 contrib/zkt/examples/dnssec-signer.sh create mode 100755 contrib/zkt/examples/dnssec-zkt.sh create mode 100755 contrib/zkt/examples/flat/dist.sh create mode 100644 contrib/zkt/examples/flat/dnssec.conf create mode 100644 contrib/zkt/examples/flat/dyn.example.net./Kdyn.example.net.+003+42138.key create mode 100644 contrib/zkt/examples/flat/dyn.example.net./Kdyn.example.net.+003+42138.private create mode 100644 contrib/zkt/examples/flat/dyn.example.net./Kdyn.example.net.+005+01355.key create mode 100644 contrib/zkt/examples/flat/dyn.example.net./Kdyn.example.net.+005+01355.private create mode 100644 contrib/zkt/examples/flat/dyn.example.net./dnskey.db create mode 100644 contrib/zkt/examples/flat/dyn.example.net./dnssec.conf create mode 100644 contrib/zkt/examples/flat/dyn.example.net./dsset-dyn.example.net. create mode 100644 contrib/zkt/examples/flat/dyn.example.net./keyset-dyn.example.net. create mode 100644 contrib/zkt/examples/flat/dyn.example.net./zone.db create mode 100644 contrib/zkt/examples/flat/dyn.example.net./zone.db.dsigned create mode 100644 contrib/zkt/examples/flat/dyn.example.net./zone.org create mode 100644 contrib/zkt/examples/flat/example.net./Kexample.net.+005+01764.key create mode 100644 contrib/zkt/examples/flat/example.net./Kexample.net.+005+01764.published create mode 100644 contrib/zkt/examples/flat/example.net./Kexample.net.+005+41151.key create mode 100644 contrib/zkt/examples/flat/example.net./Kexample.net.+005+41151.private create mode 100644 contrib/zkt/examples/flat/example.net./Kexample.net.+005+41300.key create mode 100644 contrib/zkt/examples/flat/example.net./Kexample.net.+005+41300.private create mode 100644 contrib/zkt/examples/flat/example.net./dnskey.db create mode 100644 contrib/zkt/examples/flat/example.net./dsset-example.net. create mode 100644 contrib/zkt/examples/flat/example.net./kexample.net.+005+14829.key create mode 100644 contrib/zkt/examples/flat/example.net./kexample.net.+005+14829.private create mode 100644 contrib/zkt/examples/flat/example.net./keyset-example.net. create mode 100644 contrib/zkt/examples/flat/example.net./zone.db create mode 100644 contrib/zkt/examples/flat/example.net./zone.db.signed create mode 100644 contrib/zkt/examples/flat/keysets/dlvset-sub.example.net. create mode 100644 contrib/zkt/examples/flat/keysets/dsset-dyn.example.net. create mode 100644 contrib/zkt/examples/flat/keysets/dsset-example.net. create mode 100644 contrib/zkt/examples/flat/keysets/dsset-sub.example.net. create mode 100644 contrib/zkt/examples/flat/keysets/keyset-dyn.example.net. create mode 100644 contrib/zkt/examples/flat/keysets/keyset-example.net. create mode 100644 contrib/zkt/examples/flat/keysets/keyset-sub.example.net. create mode 100644 contrib/zkt/examples/flat/named.conf create mode 100644 contrib/zkt/examples/flat/sub.example.net./Ksub.example.net.+001+04254.key create mode 100644 contrib/zkt/examples/flat/sub.example.net./Ksub.example.net.+001+04254.private create mode 100644 contrib/zkt/examples/flat/sub.example.net./Ksub.example.net.+001+56744.key create mode 100644 contrib/zkt/examples/flat/sub.example.net./Ksub.example.net.+001+56744.published create mode 100644 contrib/zkt/examples/flat/sub.example.net./Ksub.example.net.+005+54876.key create mode 100644 contrib/zkt/examples/flat/sub.example.net./Ksub.example.net.+005+54876.private create mode 100644 contrib/zkt/examples/flat/sub.example.net./dlvset-sub.example.net. create mode 100644 contrib/zkt/examples/flat/sub.example.net./dnskey.db create mode 100644 contrib/zkt/examples/flat/sub.example.net./dnssec.conf create mode 100644 contrib/zkt/examples/flat/sub.example.net./zone.db create mode 100644 contrib/zkt/examples/flat/sub.example.net./zone.db.signed create mode 100644 contrib/zkt/examples/flat/zkt.log create mode 100644 contrib/zkt/examples/flat/zone.conf create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+11867.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+11867.published create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+17439.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+17439.private create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+35672.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+35672.private create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+41145.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+41145.private create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+59244.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./Kexample.de.+005+59244.published create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./dnskey.db create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./dsset-example.de. create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./keyset-example.de. create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./keyset-sub.example.de. create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+001+19793.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+001+19793.private create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+001+51977.depreciated create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+001+51977.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+001+55699.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+001+55699.published create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+005+40998.key create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./Ksub.example.de.+005+40998.private create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./dlvset-sub.example.de. create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./dnskey.db create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./dnssec.conf create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./dsset-sub.example.de. create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./keyset-sub.example.de. create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./zone.db create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./sub.example.de./zone.db.signed create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./zone.db create mode 100644 contrib/zkt/examples/hierarchical/de./example.de./zone.db.signed create mode 100644 contrib/zkt/examples/hierarchical/de./keyset-example.de. create mode 100644 contrib/zkt/examples/hierarchical/dnssec.conf create mode 100644 contrib/zkt/examples/hierarchical/named.conf create mode 100644 contrib/zkt/examples/hierarchical/zone.conf create mode 100644 contrib/zkt/examples/views/dnssec-extern.conf create mode 100644 contrib/zkt/examples/views/dnssec-intern.conf create mode 100755 contrib/zkt/examples/views/dnssec-signer-extern create mode 100755 contrib/zkt/examples/views/dnssec-signer-intern create mode 100755 contrib/zkt/examples/views/dnssec-zkt-extern create mode 100755 contrib/zkt/examples/views/dnssec-zkt-intern create mode 100644 contrib/zkt/examples/views/extern/example.net./Kexample.net.+005+10367.key create mode 100644 contrib/zkt/examples/views/extern/example.net./Kexample.net.+005+10367.published create mode 100644 contrib/zkt/examples/views/extern/example.net./Kexample.net.+005+23553.key create mode 100644 contrib/zkt/examples/views/extern/example.net./Kexample.net.+005+23553.private create mode 100644 contrib/zkt/examples/views/extern/example.net./Kexample.net.+005+35744.key create mode 100644 contrib/zkt/examples/views/extern/example.net./Kexample.net.+005+35744.private create mode 100644 contrib/zkt/examples/views/extern/example.net./dnskey.db create mode 100644 contrib/zkt/examples/views/extern/example.net./dsset-example.net. create mode 100644 contrib/zkt/examples/views/extern/example.net./keyset-example.net. create mode 100644 contrib/zkt/examples/views/extern/example.net./zone.db create mode 100644 contrib/zkt/examples/views/extern/example.net./zone.db.signed create mode 100644 contrib/zkt/examples/views/extern/zkt-ext.log create mode 100644 contrib/zkt/examples/views/intern/example.net./Kexample.net.+005+00126.key create mode 100644 contrib/zkt/examples/views/intern/example.net./Kexample.net.+005+00126.private create mode 100644 contrib/zkt/examples/views/intern/example.net./Kexample.net.+005+05972.key create mode 100644 contrib/zkt/examples/views/intern/example.net./Kexample.net.+005+05972.private create mode 100644 contrib/zkt/examples/views/intern/example.net./Kexample.net.+005+23375.key create mode 100644 contrib/zkt/examples/views/intern/example.net./Kexample.net.+005+23375.published create mode 100644 contrib/zkt/examples/views/intern/example.net./dnskey.db create mode 100644 contrib/zkt/examples/views/intern/example.net./dsset-example.net. create mode 100644 contrib/zkt/examples/views/intern/example.net./keyset-example.net. create mode 100644 contrib/zkt/examples/views/intern/example.net./zone.db create mode 100644 contrib/zkt/examples/views/intern/example.net./zone.db.signed create mode 100644 contrib/zkt/examples/views/intern/zkt-int.log create mode 100644 contrib/zkt/examples/views/named.conf create mode 100644 contrib/zkt/examples/views/named.log create mode 100644 contrib/zkt/examples/views/root.hint create mode 100755 contrib/zkt/examples/views/viewtest.sh create mode 100644 contrib/zkt/examples/zone.db create mode 100644 contrib/zkt/examples/zone.db.signed create mode 100644 contrib/zkt/log.c create mode 100644 contrib/zkt/log.h create mode 100644 contrib/zkt/misc.c create mode 100644 contrib/zkt/misc.h create mode 100644 contrib/zkt/ncparse.c create mode 100644 contrib/zkt/ncparse.h create mode 100644 contrib/zkt/rollover.c create mode 100644 contrib/zkt/rollover.h create mode 100644 contrib/zkt/strlist.c create mode 100644 contrib/zkt/strlist.h create mode 100644 contrib/zkt/tags create mode 100644 contrib/zkt/zconf.c create mode 100644 contrib/zkt/zconf.h create mode 100644 contrib/zkt/zkt-soaserial.c create mode 100644 contrib/zkt/zkt.c create mode 100644 contrib/zkt/zkt.h create mode 100644 contrib/zkt/zone.c create mode 100644 contrib/zkt/zone.h (limited to 'contrib/zkt') diff --git a/contrib/zkt/CHANGELOG b/contrib/zkt/CHANGELOG new file mode 100644 index 0000000..40fb02e --- /dev/null +++ b/contrib/zkt/CHANGELOG @@ -0,0 +1,446 @@ +zkt 0.97 -- + +* bug LG_* logging level wasn't mapped to syslog level in lg_mesg(). + gettock() in ncparse.c did not recognize C single line comments "//" + (Thanks to Frank Behrens for finding this out) + +* misc dist_and_reload () now calls the "Distribute_Cmd" twice: + First with argument "distribute" for signed zone file distribution, + second with argument "reload" to initiate a reload. + Again see example/flat/dist.sh for an example script. + +* bug full KSK rollover will (mostly) also work for dynamic zones + This is a hack and requires further investigation. Currently + it will not work if someone is using non standard zone file + names. + +* misc default ZSK lifetime set to 3 month + +* misc get_mtime() renamed to file_mtime() + +* func is_exec_ok() added and called in dist_and_reload () + +* func New parameter "Distribute_Cmd" added for specifing a user + defined distribution (and reload) command (See example/flat/dist.sh). + +* misc Changed wording to be a bit more consistent to + draft-gudmundsson-life-of-dnskey-00.txt + - State of published key will be print as "pub" instead of "pre" + by dnssec-zkt. + - Option --pre-publish of dnssec-zkt changed to --published. + - Changed wording in all comments and log message from "pre-publish" + to "published". + +* func Highly experimental code to do a full automatic ksk rollover + in hierachical mode. + ksk_rollover() added in rollover.c; parameter change for ksk_status() + +* misc Changed name of "dnssec-soaserial" to "zkt-soaserial" + +* bug Fixed verbose logging error if -N or -D option was used + +* func Some LG_INFO messages added about key status change + +* func Remove of function to register a new ksk (zktr.[ch]) + +* misc Changed licence from GNU GPLv2 to BSD licence + +* bug Fixed bug in logging of ZSK rollover + +* misc Changed tar file to zipped one and archive the files with + toplevel directory + +* bug Fixed use of uninitialized vars in zconf.c (line) + +* port Preparation for use of autoconf + - config.h renamed to config_zkt.h and change of include directives + - conditional include of config.h + - ./configure script is able to determine BIND utility path + (BIND_UTIL_PATH) and version (BIND_VERSION) + - compile time options are settable via configure script (--enable-xxx) + - For now, the configure script is not able to set the install dir. + +* bug ksk rollover phase2 did not trigger resigning of parent + (the parent file was copied to the parent directory only + after child zone resigning) + +* bug fixed bad notice message in zskstatus () + +* func dnssec-zkt -Z print out syslog facility & level with + upper case letter and without quotation marks + +* func Syslog facility DAEMON added + +zkt 0.96 -- 19. June 2008 + +* func Config file option "SIG_Parameter" added. + +* func Function verbmesg() added and used for verbose logging + to stdout and/or to syslog resp. file. + Config file parameter VerboseLog added to config file. + +* bug Option -O wasn't recognized by dnssec-signer + +* func Better support of initial setup of dynamic signed + zones (just create an empty "zone.db.dsigned" file + and run dnssec-signer with option -d). + +* func Improved error logging; incr_soa() errors are written + as clear text message instead of error number + +* func elog_mesg() function replaced by a more general + logging mechanism. + ErrorLog config parameter replaced by LogFile, + LogLevel and SyslogFacility, SyslogLevel parameter + +* func New function filesize() added + +* func dki_prt_trustedkey print out old key id if key + is revoked + +* func dki_new() writes gentime (GMT) and proposed key + lifetime (days) as comment into the *.key file + +* bug Doing some housekeeping + +zkt 0.95 -- 19. April 2008 + +* misc This is not a public released version of zkt. + +* func All config file option are now settable via + commandline option -O (--option or --config-option) + +* misc Function fatal() now has an exit code of 127. + This is neccessary because values from 1 to 64 are + reflecting the number of errors occured. + +* func Errorlog functionality added + All dnssec-signer errors will be logged in the file + specified by the Errorlog config file parameter or + specified by the command line option -L (--errorlog). + If a directory is given, then the logging will occur + in a file within this directory which is named + like "zkt-.log". + The dnssec-signer command has an exit code of 0 if + no error occured, an exit code of 127 on fatal errors, + an exit code from 1 to 63 reflecting the number of errors + occured, or an exit code of 64 if more than 63 errors + occured. + +* func dnssec-signer: Introducing long options + +* bug New skript added to example/views directory to + read in the right config file + +* func New option -f (--lifetime) and -F (--setlifetime) + added to dnssec-zkt. + +* func New option -e (--expire) added to dnssec-zkt. + (Seems to be that the dnssec-zkt command is a little + bit overloaded with options.) + +* func dki.c and zkt.c supports storage of key lifetime, + generation time and expiration time as a comment in the + .key file. With this, it's possible to change the default + lifetime without any impact on already used keys. + +zkt 0.94 -- 6. Dec 2007 + +* bug Case mismatch of zone name and key file name prevent + dki_read() from reading the key. + Thanks to Alan Clegg for finding this out. + Added some additional error processing and convert + zone name to lower case. + +* misc Builtin default for KSK_randfile changed + from NULL to "/dev/urandom". + +* bug dnssec-signer has to use private keys for signing + even if the revoke bit is set. + To achieve this the file pattern K*.private is added + to the dnssec-signzone run. + +* bug Uninitialized variable "len" in sign_zone(). + +* func Default config file is settable via environment + variable ZKT_CONFFILE + +* func Support of views added + Link dnssec-zkt to dnssec-zkt- and + dnssec-signer to dnssec-signer-. + Option -V and --view added to dnssec-zkt. + Option -V added to dnssec-signer. + View support added to parse_namedconf(). + +zkt 0.93 -- 1. Nov 2007 + +* func The ksk registration mechanism is disabled by + default (see REG_URL in config.h). + +* func Basic support for revoke flag added (RFC5011). + Semantic of option -R of dnssec-zkt changed. + +* func Undocumented option -S changed to lower case. + Pre-pulished KSK will be shown as "standby" key. + New Option -S (standby) for pre-publish KSK. + +* func New command dnssec-soaserial added. + +* bug dnssec-signer do not print the incremented serial + number anymore. + time2str() fixed bug in time format (HAS_STRFTIME=0). + +* port New build dependencies "solaris", "macos" and "help" + added to Makefile. + +zkt 0.92 -- 1. Oct 2007 + +* func Parameter "Serialformat" in dnssec.conf added . + Now it is possible to use the unixtime format for + the SOA serial number. If you use BIND 9.4 or + greater in conjunction with this, than there is no + need for the special SOA serial formating in + the zonefile. (Thanks to Jakob Schlyter for the + -N option of dnssec-signzone and the suggestion to + add the unixtime support to zkt) + +* func Option --ksk-roll-stat added. + +* port Added macro HAS_GETOPT_LONG to support OS with + lack of getopt_long() (e.g. solaris). + Options -[01239] added. + +* misc Unused macro HAS_ULONG removed from config.h. + Deklaration of unsigned types moved from dki.h to + config.h (so it will be available in _all_ source + files). Thanks to Mans Nilsson. + Unused macro isblank() (ncparse.c) removed. + +* bug In dosigning(): freeze the dynamic zone _before_ copying + the zone file. + +zkt 0.91 -- 1. Apr 2007 + +* doc --ksk-rollover option added to usage(). + +* func some experimental code for dynamic zones added. + new functions added: copyzonefile(), dyn_update_freeze(). + New option "-d" added. + +zkt 0.90 -- 6. Dec 2006 + +* func CHECK_RESIGN interval added to config.h. + This is the dnssec-signer calling interval (at least 1 day or 86400 sec). + +* func new function dki_destroy() added; semantic of dk_remove() + changed to rename the key files instead of physical deletion. + +* doc Setup of new example directory (flat and hierarchical). + +* doc dnssec-zkt man page updated. + Added some comments in misc.c + +* misc function strtaint() renamed to str_untaint(), + dki_keycmp() renamed to dki_tagcmp(). + +* func New parameter key_ttl added to dnssec.conf. + New func dki_prt_dnskeyttl () added. + Now dnskey.db is written with key_ttl value. + +* func dnssec-signer: In hierarchical mode sign_zone() copies the + parent-file (if such a file exist) instead of the + keyset-file to the parent directory. + +* func dnssec-zkt: Option --ksk-roll-phase[123] and function + ksk_rollover() added. + +* misc zconf: default values for sigvalidity, resign_int etc. changed, + new dnssec.conf example file created. + +* func dnssec-zkt: Long option support added. + +zkt 0.83 -- 11. Sep 2006 + +* bug dosigning(): Fixed bug in the bug fixing of printing undefined + serial number if incr_serial() failed. (Thanks to Randy McCasskill). + +zkt 0.82 -- 8. Sep 2006 + +* bug Use option -e for dnssec-keygen calls in dki_new(), because + an RSA exponent of 3 is vulnerable. + +* bug dosigning(): Fixed bug in printing undefined serial + number if incr_serial() failed. + + an RSA exponent of 3 is vulnerable. + +* bug dosigning(): Fixed bug in printing undefined serial + number if incr_serial() failed. + +zkt 0.81 -- 13. July 2006 + +* bug The function ceatekey() won't work with USE_TREE. + Size of MAX_DNAME increased. + +zkt 0.8 -- 09. July 2006 + +* func Now a hierarchical directory structure with subdomains stored in + subfolders of the parent domain are allowed. Added copyfile(), + cmpfile() and new_keysetfiles() for that. + +* func Config parameter added to choose if the domain name is + right or left justified listed by dnssec-zkt (printkeyinfo). + +* func New class of key added ("sep"). A SEP key is a (public) key file + without the private counterpart. So we could use the key solely + as an secure entry point. (dki.h, dki_read). + +zkt 0.70 -- 15. Sep 2005 + +* func Experimental code added to use a binary search tree instead of a + single linked list. This is mainly for performance improvement for large + sites. If you don't want to use it, set USE_TREE in config.h to zero. + In the first step only dnssec-zkt use the new data structure. + The tree is build over the domain names and each node is the starting point + of a linked list of keys. + As a result, it's not possible anymore to search on key tags only. You have + to specify the domain name plus the tag. :-( + +* func Function parseurl added. + +* func Experimental code to register a new ksk. Currently it's more like + a key announcement because of the lack of identification and + authentication. + +zkt 0.65 -- 22. Aug 2005 + +* misc Rewrite of the domaincmp() function. Now it's round about 2 times faster. + After some additional changes and the compiler option -O3 the dnssec-zkt + on the ~ 12000 zones requires only a minute + $ time dnssec-zkt -z -r sec > /dev/null + real 0m58.287s + user 0m54.610s + sys 0m3.680s + +* func A keyset directory is introduced (experimental) + The parameter -d is added to the call of the dnssec-signzone command + if the config option KeySetDir is set. + As a result, all dsset-, keyset- and dlvset- files are stored in one directory. + The advantage is, that the chain of trust of all local subzone is build + automatically (This is the reason why we sort the zones with the child zones + first). + The disadvantage is that we store many files in single directory (3 files + per zone). + +zkt 0.64 -- 1. Aug 2005 + +* bug The code for option -Z of dnssec-zkt should be executed before we read the + complete directory tree. This is usefull if we have a very deep directory + structure and the recursive flag is switched on. + +* func SIG_Pseudorand parameter added. + +* func ([KZ]SK)|(SIG)_randfile parameter added. + +* func measure the time used for signing of each zone. + +* bug function logflush() added to misc.c and called by dosigning(). + +* misc some perfomance test made: + - Directory structure "sec//domain" with round about 12200 domains + - One of the domain is a big one (~ 820000 RRs), the others are mostly very small ones + - We use a dsa with 704 bits as ksk and a rsamd5 with 512 bits as zsk on each domain. + - All test made on Sun Fire V440 with 4 CPU and 4x2GB main memory + + # sequential signing of all zones + $ time dnssec-signer -v -v -f -D sec + real 434m (~ 7h 14min) + user 188 + sys 175 + + # with option -p and -r /dev/urandom + $ time dnssec-signer -v -v -f -D sec > log + real 96m28.306s + user 290m41.980s + sys 6m13.790s + + # one process for each firstletter subdirectory + $ time par_signer.sh + real 394m12.334s + user 295m58.390s + sys 786m42.479s + + # with option -p and -r /dev/urandom + $ time par_signer.sh + real 78m49.323s + user 284m58.350s + sys 5m39.340s + + + $ time dnssec-zkt -z -r sec > /dev/null + real 2m5.722s + user 2m0.060s + sys 0m4.510s + + + # signing the big (820000 RR) domain only + $ time dnssec-signer -v -v -f -D sec/b/big-domain + real 196m23.165 (~ 3h 16min) + user 176m57.610 + sys 167m27.570 + + # with option -p and -r /dev/urandom + $ time dnssec-signer -v -v -f -D sec/b/big-domain + real 49m53.152 + user 173m59.520 + sys 1m40.150 + +zkt 0.63 -- 14. June 2005 + +* bug allow TTL value in keyfiles (see TTL_IN_KEYFILES_ALLOWED + in dki_readfile()). + +* misc function strchop() added to misc.c. + +zkt 0.62 -- 13. May 2005 + +* func dnssec-signer: Option -o added. + Now it works a little bit more like dnssec-signzone. + +* func strlist.c: prepstrlist and unprepstrlist functions get a + second parameter for the delimiter. + +* bug fixed some typos and inaccurate usage of symbolic constants. + Doing some housekeeping. + +zkt 0.61 -- 3. May 2005 + +* bug local config file will not be mentioned if -N switch is used. + +zkt 0.6 -- 1. May 2005 + +* doc dnssec-signer: man page added. + +* func dnssec-signer: Print out a warning message if ksk lifetime is exceeded. + +* func dnssec-signer: Remaining arguments will be interpreted as zone names + (in_strarr () added). + +* func dnssec-signer: Option -D added. + + +zkt 0.51 -- 8. April 2005 + +* func dnssec-signer: Option -N added. + +* func dnssec-signer: change of keystatus from pre-published to active + resets timestamp of key, thus age of active key counts 0. + +* bug prepstrlist: resulting string was not terminated with '\0'. + +* bug dnssec-signer: do signing if there are additional keys, or the + status of any key is changed (function check_keytimestamp). + +* func dnssec-zkt: -l option added. + +* func dnssec-zkt: -p flag defaults to on in key creation mode (-C). diff --git a/contrib/zkt/LICENSE b/contrib/zkt/LICENSE new file mode 100644 index 0000000..1af01c7 --- /dev/null +++ b/contrib/zkt/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2005 - 2008, Holger Zuleger HZnet. All rights reserved. + +This software is open source. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +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. + +Neither the name of Holger Zuleger HZnet nor the names of its contributors may +be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/contrib/zkt/Makefile.in b/contrib/zkt/Makefile.in new file mode 100644 index 0000000..197fd14 --- /dev/null +++ b/contrib/zkt/Makefile.in @@ -0,0 +1,151 @@ +################################################################# +# +# @(#) Makefile for dnssec zone key tool (c) Mar 2005 hoz +# +################################################################# + +INSTALL_DIR ?= $$HOME/bin + +CC ?= @CC@ + +PROFILE = # -pg +OPTIM = # -O3 -DNDEBUG + +#CFLAGS ?= @CFLAGS@ @DEFS@ -I@top_srcdir@ +CFLAGS += -g @DEFS@ -I@top_srcdir@ +CFLAGS += -Wall #-DDBG +CFLAGS += -Wmissing-prototypes +CFLAGS += $(PROFILE) $(OPTIM) +LDFLAGS += $(PROFILE) + +PROJECT = @PACKAGE_TARNAME@ +VERSION = @PACKAGE_VERSION@ + +HEADER = dki.h misc.h domaincmp.h zconf.h config_zkt.h \ + config.h.in strlist.h zone.h zkt.h debug.h \ + ncparse.h log.h rollover.h +SRC_ALL = dki.c misc.c domaincmp.c zconf.c log.c +OBJ_ALL = $(SRC_ALL:.c=.o) + +SRC_SIG = dnssec-signer.c zone.c ncparse.c rollover.c +OBJ_SIG = $(SRC_SIG:.c=.o) +MAN_SIG = dnssec-signer.8 +PROG_SIG= dnssec-signer + +SRC_ZKT = dnssec-zkt.c strlist.c zkt.c +OBJ_ZKT = $(SRC_ZKT:.c=.o) +MAN_ZKT = dnssec-zkt.8 +PROG_ZKT= dnssec-zkt + +SRC_SER = zkt-soaserial.c +OBJ_SER = $(SRC_SER:.c=.o) +#MAN_SER = zkt-soaserial.8 +PROG_SER= zkt-soaserial + +MAN = $(MAN_ZKT) $(MAN_SIG) #$(MAN_SER) +OTHER = README README.logging TODO LICENSE CHANGELOG tags Makefile.in \ + configure examples +SAVE = $(HEADER) $(SRC_ALL) $(SRC_SIG) $(SRC_ZKT) $(SRC_SER) $(MAN) $(OTHER) +MNTSAVE = $(SAVE) configure.ac config.h.in doc + + +all: $(PROG_ZKT) $(PROG_SIG) $(PROG_SER) + +macos: ## for MAC OS +macos: + $(MAKE) CFLAGS="$(CFLAGS) -D HAS_UTYPES=0" all + +solaris: ## for solaris +solaris: + @$(MAKE) CFLAGS="$(CFLAGS) -D HAVE_GETOPT_LONG=0" all + +linux: ## for linux (default) +linux: + @$(MAKE) all + +$(PROG_SIG): $(OBJ_SIG) $(OBJ_ALL) Makefile + $(CC) $(LDFLAGS) $(OBJ_SIG) $(OBJ_ALL) -o $(PROG_SIG) + +$(PROG_ZKT): $(OBJ_ZKT) $(OBJ_ALL) Makefile + $(CC) $(LDFLAGS) $(OBJ_ZKT) $(OBJ_ALL) -o $(PROG_ZKT) + +$(PROG_SER): $(OBJ_SER) Makefile + $(CC) $(LDFLAGS) $(OBJ_SER) -o $(PROG_SER) + +install: ## install binaries in INSTALL_DIR +install: $(PROG_ZKT) $(PROG_SIG) $(PROG_SER) + cp $(PROG_ZKT) $(PROG_SIG) $(PROG_SER) $(INSTALL_DIR) + +tags: ## create tags file +tags: $(SRC_ALL) $(SRC_SIG) $(SRC_ZKT) $(SRC_SER) + ctags $(SRC_ALL) $(SRC_SIG) $(SRC_ZKT) $(SRC_SER) + +clean: ## remove objectfiles and binaries +clean: + rm -f $(OBJ_SIG) $(OBJ_ZKT) $(OBJ_SER) $(OBJ_ALL) + +dist: ## create tar file for distribution +dist: $(PROJECT)-$(VERSION).tar.gz +tar: ## create tar file for distribution +tar: $(PROJECT)-$(VERSION).tar.gz + +maintain: ## create configure script +maintain: configure + +mainttar: ## create tar file for maintenance +mainttar: $(PROJECT)-maint-$(VERSION).tar.gz + +configure: configure.ac + autoconf && autoheader + +man: $(MAN_ZKT).html $(MAN_ZKT).pdf $(MAN_SIG).html $(MAN_SIG).pdf + +$(MAN_ZKT).html: $(MAN_ZKT) + groff -Thtml -man -mhtml $(MAN_ZKT) > $(MAN_ZKT).html +$(MAN_ZKT).pdf: $(MAN_ZKT) + groff -Tps -man $(MAN_ZKT) | ps2pdf - $(MAN_ZKT).pdf +$(MAN_SIG).html: $(MAN_SIG) + groff -Thtml -man -mhtml $(MAN_SIG) > $(MAN_SIG).html +$(MAN_SIG).pdf: $(MAN_SIG) + groff -Tps -man $(MAN_SIG) | ps2pdf - $(MAN_SIG).pdf + + +$(PROJECT)-$(VERSION).tar.gz: $(SAVE) + rm -f examples/hierarchical/log/zkt-* + ( \ + distfiles=`ls -d $(SAVE) | sed 's|^|$(PROJECT)-$(VERSION)/|'` ;\ + cd .. && tar czvf $(PROJECT)-$(VERSION)/$(PROJECT)-$(VERSION).tar.gz $$distfiles ;\ + ) + +$(PROJECT)-maint-$(VERSION).tar.gz: $(MNTSAVE) + ( \ + distfiles=`ls -d $(SAVE) | sed 's|^|$(PROJECT)-$(VERSION)/|'` ;\ + cd .. && tar czvf $(PROJECT)-$(VERSION)/$(PROJECT)-maint-$(VERSION).tar.gz $$distfiles ;\ + ) + +depend: + $(CC) -MM $(SRC_SIG) $(SRC_ZKT) $(SRC_SER) $(SRC_ALL) + +help: + @grep "^.*:[ ]*##" Makefile + +## all dependicies +#:r !make depend +#gcc -MM dnssec-signer.c zone.c ncparse.c rollover.c dnssec-zkt.c strlist.c zkt.c zkt-soaserial.c dki.c misc.c domaincmp.c zconf.c log.c +dnssec-signer.o: dnssec-signer.c config_zkt.h zconf.h debug.h misc.h \ + ncparse.h zone.h dki.h rollover.h log.h +zone.o: zone.c config_zkt.h debug.h domaincmp.h misc.h zconf.h dki.h \ + zone.h +ncparse.o: ncparse.c debug.h misc.h zconf.h log.h ncparse.h +rollover.o: rollover.c config_zkt.h zconf.h debug.h misc.h zone.h dki.h \ + log.h rollover.h +dnssec-zkt.o: dnssec-zkt.c config_zkt.h debug.h misc.h zconf.h strlist.h \ + dki.h zkt.h +strlist.o: strlist.c strlist.h +zkt.o: zkt.c config_zkt.h dki.h misc.h zconf.h strlist.h zkt.h +zkt-soaserial.o: zkt-soaserial.c config_zkt.h +dki.o: dki.c config_zkt.h debug.h domaincmp.h misc.h zconf.h dki.h +misc.o: misc.c config_zkt.h zconf.h log.h debug.h misc.h +domaincmp.o: domaincmp.c domaincmp.h +zconf.o: zconf.c config_zkt.h debug.h misc.h zconf.h dki.h +log.o: log.c config_zkt.h misc.h zconf.h debug.h log.h diff --git a/contrib/zkt/README b/contrib/zkt/README new file mode 100644 index 0000000..0798932 --- /dev/null +++ b/contrib/zkt/README @@ -0,0 +1,44 @@ +# +# README dnssec zone key tool +# +# (c) March 2005 - Aug 2008 by Holger Zuleger hznet +# (c) for domaincmp Aug 2005 by Karle Boss & H. Zuleger (kaho) +# (c) for zconf.c by Jeroen Masar & Holger Zuleger +# + +For more information about the DNSSEC Zone Key Tool please +have a look at "http://www.hznet.de/dns/zkt/" + +You can also subscribe to the zkt-users@sourceforge.net mailing list +on the following website: https://lists.sourceforge.net/lists/listinfo/zkt-users + +The complete software stands under BSD licence (see LICENCE file) + +To build the software: +a) Get the current version of zkt + $ wget http://www.hznet.de/dns/zkt/zkt-0.97.tar.gz + +b) Unpack + $ tar xzvf zkt-0.97.tar.gz + +c) Change to dir + $ cd zkt-0.97 + +d) Run configure script + $ ./configure + +e) (optional) Edit config_zkt.h + +f) Compile + $ make + For MAC users: # this should not needed anymore + $ make macos + For Solaris: # this should not needed anymore + $ make solaris + +g) Install + $ make install # this will copy the binarys to $HOME/bin + +h) (optional) Install and modify the default dnssec.conf file + $ ./dnssec-zkt -c "" -Z > /var/named/dnssec.conf + $ vi /var/named/dnssec.conf diff --git a/contrib/zkt/README.logging b/contrib/zkt/README.logging new file mode 100644 index 0000000..f0f3f90 --- /dev/null +++ b/contrib/zkt/README.logging @@ -0,0 +1,99 @@ +# +# README.logging +# +# Introduction into the new logging feature +# available since v0.96 +# + +In previous version of dnssec-signer every message was written +to the default stdout and stderr channels, and the logging itself +was handled by a redirection of those chanels to the logger command +or to a file. + +Now, since version v0.96, the dnssec-signer command is able to log all +messages by itself. File and SYSLOG logging is supported. + +To enable the logging into a file channel, you have to specify +the file or directory name via the commandline option -L (--logfile) +or via the config file parameter "LogFile". + LogFile: ""|""|"" (default is "") +If a file is specified, than each run of dnssec-signer will append the +messages to tat file. If a directory is specified, than a file with a +name of zkt-.log" will be created on each dnssec-signer run. + +Logging into the syslog channel could be enabled via the config file +parameter "SyslogFacility". + SyslogFacility: NONE|USER|DAEMON|LOCAL0|..|LOCAL7 (default is USER) + +For both channels, the log level could be independently set to one +of six log levels: + LG_FATAL, LG_ERROR, LG_WARNING + LB_NOTICE, LG_INFO, LG_DEBUG + +The loglevel is settable via the config file parameter : + SyslogLevel: FATAL|ERROR|WARNING|NOTICE|INFO|DEBUG + (default is ERROR) +and + LogLevel: FATAL|ERROR|WARNING|NOTICE|INFO|DEBUG + (default is NOTICE) + +All the log parameters are settable on the commandline via the generic +option -O "optstring" (--config-option="opt"). + +A verbose message output to stdout could be achieved by the commandline +option -v (or -v -v). +If you want to log the same messages with loglevel LG_DEBUG to a file or +to syslog, you could enable this by setting the config file option +"VerboseLog" to a value of 1 or 2. + +Current logging messages: + LG_FATAL: Not all of the fatal errors are logged + (e.g.: config file or command line option fatal errors are + not logged) + LG_ERROR: All error messages will be logged + LG_WARNING: KSK lifetime expiration + LG_NOTICE: + Start and stop of dnssec-signer + Re-signing events + Key rollover events + Zone reload resp. freeze/thaw of dynamic zone + LG_INFO: Currently none + planned: + Mesages for key generation and key status change + (e.g.: pre-publish -> activate; revoked -> removed etc.) + LG_DEBUG: all "verbose" (-v) and "very verbose" (-v -v) messages + +Some recomended and useful logging settings + +- The default setting + LogFile: "" + SyslogFacility: USER + SyslogLevel: NOTICE + VerboseLog: 0 + +- Setting as in version v0.95 + LogFile: "zkt-error.log" # or a directory for seperate logfiles + LogLevel: ERROR + SyslogFacility: NONE + VerboseLog: 0 + +- Setting as in previous versions + LogFile: "" + SyslogFacility: NONE + VerboseLog: 0 + +- Recommended setting for normal usage + LogFile: "zkt.log" # or a directory for seperate logfiles + LogLevel: ERROR + SyslogFacility: USER + SyslogLevel: NOTICE + VerboseLog: 0 + +- Recommended setting for debugging + LogFile: "zkt.log" # or a directory for seperate logfiles + LogLevel: DEBUG + SyslogFacility: USER + SyslogLevel: NOTICE + VerboseLog: 2 + +- diff --git a/contrib/zkt/TODO b/contrib/zkt/TODO new file mode 100644 index 0000000..fc53210 --- /dev/null +++ b/contrib/zkt/TODO @@ -0,0 +1,37 @@ +TODO list as of zkt-0.97 + +general: + Renaming of the tools to zkt-* ? + +dnssec-zkt: + feat option to specify the key age as remaining lifetime + (Option -i inverse age ?) As of v0.95 the key lifetime + is stored at the key itself, so this could be possibly + implemented without big effort(?). + +dnssec-signer: + bug Distribute_Cmd will not work properly on dynamic zones + + bug Automatic KSK rollover of dynamic zones will only work if the parent + uses the standard name for the signed zonefile (zonefile.db.signed). + + bug Phase3 of manual ksk rollover do not trigger a resigning of the zone + (Key removal is not recognized by dosigning () function ) + + bug There is no online checking of the key material by design. + So the signer command checks the status of the key as they + are represented in the file system and not in the zone. + The dnssec maintainer is responsible for the lifeliness of the + data in the hosted domain. + In other words: It's highly recommended to use the + option -r when you use dnssec-signer on a production zone. + Then the time of propagation is (more or less) equal to the timestamp + of the zone.db.signed file. + + bug The max_TTL and Key_TTL parameter should be set to the value found + in the zone. A mechanism for setting up a dnssec.conf file for the + zone specific TTL values is needed. + +dki: + feat Use dynamic memory for dname in dki_t + diff --git a/contrib/zkt/config.h.in b/contrib/zkt/config.h.in new file mode 100644 index 0000000..fa6ef0f --- /dev/null +++ b/contrib/zkt/config.h.in @@ -0,0 +1,217 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Path to BIND utilities */ +#undef BIND_UTIL_PATH + +/* BIND version as integer number without dots */ +#undef BIND_VERSION + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* set path of config file (defaults to /var/named) */ +#undef CONFIG_PATH + +/* Define to 1 if you have the `alarm' function. */ +#undef HAVE_ALARM + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* 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, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +#undef HAVE_STAT_EMPTY_STRING_BUG + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* 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 `strftime' function. */ +#undef HAVE_STRFTIME + +/* 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 `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_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 `tzset' function. */ +#undef HAVE_TZSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ +#undef HAVE_UTIME_NULL + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* log with level */ +#undef LOG_WITH_LEVEL + +/* log with progname */ +#undef LOG_WITH_PROGNAME + +/* log with timestamp */ +#undef LOG_WITH_TIMESTAMP + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* print age of year */ +#undef PRINT_AGE_OF_YEAR + +/* print out timezone */ +#undef PRINT_TIMEZONE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* TTL in keyfiles allowed */ +#undef TTL_IN_KEYFILE_ALLOWED + +/* Use TREE data structure for dnssec-zkt */ +#undef USE_TREE + +/* ZKT version string */ +#undef ZKT_VERSION + +/* 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 `unsigned' if does not define. */ +#undef size_t + +/* Define to `unsigned char' if does not define. */ +#undef uchar + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define to `unsigned int' if does not define. */ +#undef uint + +/* Define to `unsigned long' if does not define. */ +#undef ulong + +/* Define to `unsigned short' if does not define. */ +#undef ushort diff --git a/contrib/zkt/config_zkt.h b/contrib/zkt/config_zkt.h new file mode 100644 index 0000000..4c04844 --- /dev/null +++ b/contrib/zkt/config_zkt.h @@ -0,0 +1,121 @@ +/***************************************************************** +** +** @(#) config_zkt.h -- config options for ZKT +** +** Copyright (c) Aug 2005, Holger Zuleger HZnet. All rights reserved. +** +** This software is open source. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** +** 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. +** +** Neither the name of Holger Zuleger HZnet nor the names of its contributors may +** be used to endorse or promote products derived from this software without +** specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*****************************************************************/ +#ifndef CONFIG_ZKT_H +# define CONFIG_ZKT_H + +#ifndef HAS_TIMEGM +# define HAS_TIMEGM 1 +#endif + +#ifndef HAS_UTYPES +# define HAS_UTYPES 1 +#endif + +#ifndef LOG_FNAMETMPL +# define LOG_FNAMETMPL "/zkt-%04d-%02d-%02dT%02d%02d%02dZ.log" +#endif + +/* don't change anything below this */ +/* the values here are determined or settable via the ./configure script */ + +#ifndef HAVE_GETOPT_LONG +# define HAVE_GETOPT_LONG 1 +#endif + +#ifndef HAVE_STRFTIME +# define HAVE_STRFTIME 1 +#endif + +#ifndef TTL_IN_KEYFILE_ALLOWED +# define TTL_IN_KEYFILE_ALLOWED 1 +#endif + +#ifndef PRINT_TIMEZONE +# define PRINT_TIMEZONE 0 +#endif + +#ifndef PRINT_AGE_WITH_YEAR +# define PRINT_AGE_WITH_YEAR 0 +#endif + +#ifndef LOG_WITH_PROGNAME +# define LOG_WITH_PROGNAME 0 +#endif + +#ifndef LOG_WITH_TIMESTAMP +# define LOG_WITH_TIMESTAMP 1 +#endif + +#ifndef LOG_WITH_LEVEL +# define LOG_WITH_LEVEL 1 +#endif + +#ifndef CONFIG_PATH +# define CONFIG_PATH "/var/named/" +#endif + +/* tree usage is setable by configure script parameter */ +#ifndef USE_TREE +# define USE_TREE 1 +#endif + +/* BIND version and utility path will be set by ./configure script */ +#ifndef BIND_VERSION +# define BIND_VERSION 942 +#endif + +#ifndef BIND_UTIL_PATH +# define BIND_UTIL_PATH "/usr/local/sbin/" +#endif + +#ifndef ZKT_VERSION +# if defined(USE_TREE) && USE_TREE +# define ZKT_VERSION "vT0.97 (c) Feb 2005 - Aug 2008 Holger Zuleger hznet.de" +# else +# define ZKT_VERSION "v0.97 (c) Feb 2005 - Aug 2008 Holger Zuleger hznet.de" +# endif +#endif + + +#if !defined(HAS_UTYPES) || !HAS_UTYPES +typedef unsigned long ulong; +typedef unsigned int uint; +typedef unsigned short ushort; +typedef unsigned char uchar; +#endif + +#endif diff --git a/contrib/zkt/configure b/contrib/zkt/configure new file mode 100755 index 0000000..178398f --- /dev/null +++ b/contrib/zkt/configure @@ -0,0 +1,6838 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for ZKT 0.97. +# +# Report bugs to . +# +# Copyright (C) 2003 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 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='ZKT' +PACKAGE_TARNAME='zkt' +PACKAGE_VERSION='0.97' +PACKAGE_STRING='ZKT 0.97' +PACKAGE_BUGREPORT='Holger Zuleger hznet.de' + +ac_unique_file="dnssec-zkt.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SIGNZONE_PROG CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -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 | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -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 ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + 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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# 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 its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# 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 ZKT 0.97 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of ZKT 0.97:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-print-timezone print out timezone + --enable-print-age print age of year + --enable-log-progname log with progname + --disable-log-timestamp do not log with timestamp + --disable-log-level do not log with level + --disable-ttl-in-keyfiles + do not allow TTL values in keyfiles + --enable-configpath=PATH + set path of config file (defaults to /var/named) + --disable-tree use single linked list instead of binary tree data + structure for dnssec-zkt + +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 + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +ZKT configure 0.97 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 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 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by ZKT $as_me 0.97, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&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_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +### Files to test to check if src dir contains the package + + ac_config_headers="$ac_config_headers config.h" + + + +### Checks for 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 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 -std1. */ +int osf4_cc_array ['\x00' == 0 ? 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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext 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 + + +### find out the path to BIND utils and version +# Extract the first word of "dnssec-signzone", so it can be a program name with args. +set dummy dnssec-signzone; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SIGNZONE_PROG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SIGNZONE_PROG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SIGNZONE_PROG="$SIGNZONE_PROG" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SIGNZONE_PROG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +SIGNZONE_PROG=$ac_cv_path_SIGNZONE_PROG + +if test -n "$SIGNZONE_PROG"; then + echo "$as_me:$LINENO: result: $SIGNZONE_PROG" >&5 +echo "${ECHO_T}$SIGNZONE_PROG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +bind_util_path=`dirname $SIGNZONE_PROG` +if test -z "$SIGNZONE_PROG" ; then + { { echo "$as_me:$LINENO: error: *** 'BIND dnssec-signzone dnssec-keygen' missing, please install or fix your \$PATH ***" >&5 +echo "$as_me: error: *** 'BIND dnssec-signzone dnssec-keygen' missing, please install or fix your \$PATH ***" >&2;} + { (exit 1); exit 1; }; } + fi + +# define BIND_UTIL_PATH in config.h.in + +cat >>confdefs.h <<_ACEOF +#define BIND_UTIL_PATH "$bind_util_path/" +_ACEOF + +# define BIND_VERSION in config.h.in +bind_version=`$SIGNZONE_PROG 2>&1 | grep Version: | tr -dc 0-9` + +cat >>confdefs.h <<_ACEOF +#define BIND_VERSION $bind_version +_ACEOF + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for uint" >&5 +echo $ECHO_N "checking for uint... $ECHO_C" >&6 +if test "${ac_cv_type_uint+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uint *) 0) + return 0; +if (sizeof (uint)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint" >&5 +echo "${ECHO_T}$ac_cv_type_uint" >&6 +if test $ac_cv_type_uint = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uint unsigned int +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for ulong" >&5 +echo $ECHO_N "checking for ulong... $ECHO_C" >&6 +if test "${ac_cv_type_ulong+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((ulong *) 0) + return 0; +if (sizeof (ulong)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_ulong=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_ulong=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ulong" >&5 +echo "${ECHO_T}$ac_cv_type_ulong" >&6 +if test $ac_cv_type_ulong = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define ulong unsigned long +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for ushort" >&5 +echo $ECHO_N "checking for ushort... $ECHO_C" >&6 +if test "${ac_cv_type_ushort+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((ushort *) 0) + return 0; +if (sizeof (ushort)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_ushort=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_ushort=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ushort" >&5 +echo "${ECHO_T}$ac_cv_type_ushort" >&6 +if test $ac_cv_type_ushort = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define ushort unsigned short +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for uchar" >&5 +echo $ECHO_N "checking for uchar... $ECHO_C" >&6 +if test "${ac_cv_type_uchar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uchar *) 0) + return 0; +if (sizeof (uchar)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uchar=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uchar=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uchar" >&5 +echo "${ECHO_T}$ac_cv_type_uchar" >&6 +if test $ac_cv_type_uchar = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define uchar unsigned char +_ACEOF + +fi + + +### define configure arguments +# Check whether --enable-printtimezone or --disable-printtimezone was given. +if test "${enable_printtimezone+set}" = set; then + enableval="$enable_printtimezone" + printtimezone=$enableval +fi; +printtimezone=0 +test "$printtimezone" = yes && printtimezone=1 + +cat >>confdefs.h <<_ACEOF +#define PRINT_TIMEZONE $printtimezone +_ACEOF + + +# Check whether --enable-printyear or --disable-printyear was given. +if test "${enable_printyear+set}" = set; then + enableval="$enable_printyear" + printyear=$enableval +fi; +printyear=0 +test "$printyear" = yes && printyear=1 + +cat >>confdefs.h <<_ACEOF +#define PRINT_AGE_OF_YEAR $printyear +_ACEOF + + +# Check whether --enable-logprogname or --disable-logprogname was given. +if test "${enable_logprogname+set}" = set; then + enableval="$enable_logprogname" + logprogname=$enableval +fi; +logprogname=0 +test "$logprogname" = yes && logprogname=1 + +cat >>confdefs.h <<_ACEOF +#define LOG_WITH_PROGNAME $logprogname +_ACEOF + + +# Check whether --enable-logtimestamp or --disable-logtimestamp was given. +if test "${enable_logtimestamp+set}" = set; then + enableval="$enable_logtimestamp" + logtimestamp=$enableval +fi; +logtimestamp=1 +test "$logtimestamp" = no && logtimestamp=0 + +cat >>confdefs.h <<_ACEOF +#define LOG_WITH_TIMESTAMP $logtimestamp +_ACEOF + + +# Check whether --enable-loglevel or --disable-loglevel was given. +if test "${enable_loglevel+set}" = set; then + enableval="$enable_loglevel" + loglevel=$enableval +fi; +loglevel=1 +test "$loglevel" = no && loglevel=0 + +cat >>confdefs.h <<_ACEOF +#define LOG_WITH_LEVEL $loglevel +_ACEOF + + +# Check whether --enable-ttl_in_keyfile or --disable-ttl_in_keyfile was given. +if test "${enable_ttl_in_keyfile+set}" = set; then + enableval="$enable_ttl_in_keyfile" + ttl_in_keyfile=$enableval +fi; +ttl_in_keyfile=1 +test "$ttl_in_keyfile" = no && ttl_in_keyfile=0 + +cat >>confdefs.h <<_ACEOF +#define TTL_IN_KEYFILE_ALLOWED $ttl_in_keyfile +_ACEOF + + +configpath="/var/named" +# Check whether --enable-configpath or --disable-configpath was given. +if test "${enable_configpath+set}" = set; then + enableval="$enable_configpath" + configpath=$enableval +fi; +case "$configpath" in +yes) + configpath="/var/named" + ;; +no) + configpath="" + ;; +*) + ;; +esac + +cat >>confdefs.h <<_ACEOF +#define CONFIG_PATH "$configpath/" +_ACEOF + + +usetree=1 +t="T" +# Check whether --enable-tree or --disable-tree was given. +if test "${enable_tree+set}" = set; then + enableval="$enable_tree" + usetree=$enableval +fi; +if test "$usetree" = no +then + usetree=0 + t="" +fi + +cat >>confdefs.h <<_ACEOF +#define USE_TREE $usetree +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define ZKT_VERSION "v$t$PACKAGE_VERSION (c) Feb 2005 - Aug 2008 Holger Zuleger hznet.de" +_ACEOF + + +### Checks for libraries. + + +### Checks for header files. + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +else + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +fi + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + + + + + + + + +for ac_header in fcntl.h netdb.h stdlib.h getopt.h string.h strings.h sys/socket.h sys/time.h sys/types.h syslog.h unistd.h utime.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to Holger Zuleger hznet.de ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +### Checks for typedefs, structures, and compiler characteristics. +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* 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"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 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; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 +if test "${ac_cv_type_uid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_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 +echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6 +if test $ac_cv_type_uid_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define uid_t int +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF + +fi + + + +### Checks for library functions. +echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 +if test "${ac_cv_func_closedir_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +exit (closedir (opendir (".")) != 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for error_at_line" >&5 +echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6 +if test "${ac_cv_lib_error_at_line+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +error_at_line (0, 0, "", 0, ""); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_error_at_line=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_error_at_line=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 +echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6 +if test $ac_cv_lib_error_at_line = no; then + case $LIBOBJS in + "error.$ac_objext" | \ + *" error.$ac_objext" | \ + "error.$ac_objext "* | \ + *" error.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; +esac + +fi + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to Holger Zuleger hznet.de ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if STDC_HEADERS || HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +exit (malloc (0) ? 0 : 1); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + case $LIBOBJS in + "malloc.$ac_objext" | \ + *" malloc.$ac_objext" | \ + "malloc.$ac_objext "* | \ + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + + + + +for ac_header in stdlib.h sys/time.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------------- ## +## Report this to Holger Zuleger hznet.de ## +## -------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in alarm +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +echo "$as_me:$LINENO: checking for working mktime" >&5 +echo $ECHO_N "checking for working mktime... $ECHO_C" >&6 +if test "${ac_cv_func_working_mktime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_working_mktime=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#if !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 char *tz_strings[] = { + (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])) + +/* Fail if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static void +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 ("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; + if (mktime (&tm) == (time_t)-1) + exit (1); +} + +static void +mktime_test1 (now) + time_t now; +{ + struct tm *lt; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); +} + +static void +mktime_test (now) + time_t now; +{ + mktime_test1 (now); + mktime_test1 ((time_t) (time_t_max - now)); + mktime_test1 ((time_t) (time_t_min + now)); +} + +static void +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); + if (tm.tm_mon != 2 || tm.tm_mday != 31) + exit (1); +} + +static void +bigtime_test (j) + 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)))) + exit (1); + } +} + +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 (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) + continue; + time_t_max--; + if ((time_t) -1 < 0) + for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2) + continue; + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + mktime_test (t); + mktime_test ((time_t) 1); + mktime_test ((time_t) (60 * 60)); + mktime_test ((time_t) (60 * 60 * 24)); + + for (j = 1; 0 < j; j *= 2) + bigtime_test (j); + bigtime_test (j - 1); + } + irix_6_4_bug (); + spring_forward_gap (); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_working_mktime=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_working_mktime=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 +echo "${ECHO_T}$ac_cv_func_working_mktime" >&6 +if test $ac_cv_func_working_mktime = no; then + case $LIBOBJS in + "mktime.$ac_objext" | \ + *" mktime.$ac_objext" | \ + "mktime.$ac_objext "* | \ + *" mktime.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; +esac + +fi + +echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6 +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6 + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + case $LIBOBJS in + "lstat.$ac_objext" | \ + *" lstat.$ac_objext" | \ + "lstat.$ac_objext "* | \ + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; +esac + +fi + +echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 +echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6 +if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_stat_empty_string_bug=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + exit (stat ("", &sbuf) ? 1 : 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_stat_empty_string_bug=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_stat_empty_string_bug=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 +echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6 +if test $ac_cv_func_stat_empty_string_bug = yes; then + case $LIBOBJS in + "stat.$ac_objext" | \ + *" stat.$ac_objext" | \ + "stat.$ac_objext "* | \ + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + + +for ac_func in strftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 +echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_strftime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strftime (); +int +main () +{ +strftime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_strftime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_intl_strftime=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 +if test $ac_cv_lib_intl_strftime = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF + +LIBS="-lintl $LIBS" +fi + +fi +done + +echo "$as_me:$LINENO: checking whether utime accepts a null argument" >&5 +echo $ECHO_N "checking whether utime accepts a null argument... $ECHO_C" >&6 +if test "${ac_cv_func_utime_null+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f conftest.data; >conftest.data +# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. +if test "$cross_compiling" = yes; then + ac_cv_func_utime_null=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat s, t; + exit (!(stat ("conftest.data", &s) == 0 + && utime ("conftest.data", (long *)0) == 0 + && stat ("conftest.data", &t) == 0 + && t.st_mtime >= s.st_mtime + && t.st_mtime - s.st_mtime < 120)); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_utime_null=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_utime_null=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f core *.core +fi +echo "$as_me:$LINENO: result: $ac_cv_func_utime_null" >&5 +echo "${ECHO_T}$ac_cv_func_utime_null" >&6 +if test $ac_cv_func_utime_null = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UTIME_NULL 1 +_ACEOF + +fi +rm -f conftest.data + + +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +echo "$as_me:$LINENO: checking for _doprnt" >&5 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 +if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case declares _doprnt. + For example, HP-UX 11i declares gettimeofday. */ +#define _doprnt innocuous__doprnt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _doprnt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt (); +/* 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__doprnt) || defined (__stub____doprnt) +choke me +#else +char (*f) () = _doprnt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != _doprnt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func__doprnt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func__doprnt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6 +if test $ac_cv_func__doprnt = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOPRNT 1 +_ACEOF + +fi + +fi +done + + +# 2008-07-04 getopt_long added + + + + + + + + + + + + + +for ac_func in getopt_long gettimeofday memset setenv socket strcasecmp strchr strdup strerror strncasecmp strrchr tzset utime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# 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. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *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 \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + 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}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be 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+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# 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'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by ZKT $as_me 0.97, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +ZKT config.status 0.97 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@SIGNZONE_PROG@,$SIGNZONE_PROG,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # 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. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #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. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # 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. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/contrib/zkt/debug.h b/contrib/zkt/debug.h new file mode 100644 index 0000000..e0c47dc --- /dev/null +++ b/contrib/zkt/debug.h @@ -0,0 +1,66 @@ +/***************************************************************** +** +** @(#) debug.h -- macros for debug messages +** +** compile with cc -DDBG to activate +** +** Copyright (c) Jan 2005, Holger Zuleger HZnet. All rights reserved. +** +** This software is open source. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** +** 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. +** +** Neither the name of Holger Zuleger HZnet nor the names of its contributors may +** be used to endorse or promote products derived from this software without +** specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*****************************************************************/ +#ifndef DEBUG_H +# define DEBUG_H + +# ifdef DBG +# define dbg_line() fprintf (stderr, "DBG: %s(%d) reached\n", __FILE__, __LINE__) +# define dbg_msg(msg) fprintf (stderr, "DBG: %s(%d) %s\n", __FILE__, __LINE__, msg) +# define dbg_val0(text) fprintf (stderr, "DBG: %s(%d) %s", __FILE__, __LINE__, text) +# define dbg_val1(fmt, var) dbg_val (fmt, var) +# define dbg_val(fmt, var) fprintf (stderr, "DBG: %s(%d) " fmt, __FILE__, __LINE__, var) +# define dbg_val2(fmt, v1, v2) fprintf (stderr, "DBG: %s(%d) " fmt, __FILE__, __LINE__, v1, v2) +# define dbg_val3(fmt, v1, v2, v3) fprintf (stderr, "DBG: %s(%d) " fmt, __FILE__, __LINE__, v1, v2, v3) +# define dbg_val4(fmt, v1, v2, v3, v4) fprintf (stderr, "DBG: %s(%d) " fmt, __FILE__, __LINE__, v1, v2, v3, v4) +# define dbg_val5(fmt, v1, v2, v3, v4, v5) fprintf (stderr, "DBG: %s(%d) " fmt, __FILE__, __LINE__, v1, v2, v3, v4, v5) +# define dbg_val6(fmt, v1, v2, v3, v4, v5, v6) fprintf (stderr, "DBG: %s(%d) " fmt, __FILE__, __LINE__, v1, v2, v3, v4, v5, v6) +# else +# define dbg_line() +# define dbg_msg(msg) +# define dbg_val0(text) +# define dbg_val1(fmt, var) +# define dbg_val(fmt, str) +# define dbg_val2(fmt, v1, v2) +# define dbg_val3(fmt, v1, v2, v3) +# define dbg_val4(fmt, v1, v2, v3, v4) +# define dbg_val5(fmt, v1, v2, v3, v4, v5) +# define dbg_val6(fmt, v1, v2, v3, v4, v5, v6) +# endif + +#endif diff --git a/contrib/zkt/dki.c b/contrib/zkt/dki.c new file mode 100644 index 0000000..81498ae --- /dev/null +++ b/contrib/zkt/dki.c @@ -0,0 +1,1185 @@ +/***************************************************************** +** +** @(#) dki.c (c) Jan 2005 Holger Zuleger hznet.de +** +** A library for managing BIND dnssec key files. +** +** Copyright (c) Jan 2005, Holger Zuleger HZnet. All rights reserved. +** +** This software is open source. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** +** 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. +** +** Neither the name of Holger Zuleger HZnet nor the names of its contributors may +** be used to endorse or promote products derived from this software without +** specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +** +*****************************************************************/ + +# include +# include +# include /* tolower(), ... */ +# include /* link(), unlink(), ... */ +# include +# include +# include +# include +# include +# include +#ifdef HAVE_CONFIG_H +# include +#endif +# include "config_zkt.h" +# include "debug.h" +# include "domaincmp.h" +# include "misc.h" +# include "zconf.h" +#define extern +# include "dki.h" +#undef extern + +/***************************************************************** +** private (static) function declaration and definition +*****************************************************************/ +static char dki_estr[255+1]; + +static dki_t *dki_alloc () +{ + dki_estr[0] = '\0'; + dki_t *dkp = malloc (sizeof (dki_t)); + + if ( (dkp = malloc (sizeof (dki_t))) ) + { + memset (dkp, 0, sizeof (dki_t)); + return dkp; + } + + snprintf (dki_estr, sizeof (dki_estr), + "dki_alloc: Out of memory"); + return NULL; +} + +static int dki_readfile (FILE *fp, dki_t *dkp) +{ + int algo, flags, type; + int c; + char *p; + char buf[4095+1]; + char tag[25+1]; + char val[14+1]; /* e.g. "YYYYMMDDhhmmss" | "60d" */ + + assert (dkp != NULL); + assert (fp != NULL); + + while ( (c = getc (fp)) == ';' ) /* line start with comment ? */ + { + tag[0] = val[0] = '\0'; + if ( (c = getc (fp)) == '%' ) /* special comment? */ + { + while ( (c = getc (fp)) == ' ' || c == '\t' ) + ; + ungetc (c, fp); + /* then try to read in the creation, expire and lifetime */ + if ( fscanf (fp, "%25[a-zA-Z]=%14s", tag, val) == 2 ) + { + dbg_val2 ("dki_readfile: tag=%s val=%s \n", tag, val); + switch ( tolower (tag[0]) ) + { + case 'g': dkp->gentime = timestr2time (val); break; + case 'e': dkp->exptime = timestr2time (val); break; + case 'l': dkp->lifetime = atoi (val) * DAYSEC; break; + } + } + } + else + ungetc (c, fp); + while ( (c = getc (fp)) != EOF && c != '\n' ) /* eat up rest of the line */ + ; + } + ungetc (c, fp); /* push back last char */ + + if ( fscanf (fp, "%4095s", buf) != 1 ) /* read label */ + return -1; + + if ( strcmp (buf, dkp->name) != 0 ) + return -2; + +#if defined(TTL_IN_KEYFILE_ALLOWED) && TTL_IN_KEYFILE_ALLOWED + /* skip optional TTL value */ + while ( (c = getc (fp)) != EOF && isspace (c) ) /* skip spaces */ + ; + if ( isdigit (c) ) /* skip ttl */ + fscanf (fp, "%*d"); + else + ungetc (c, fp); /* oops, no ttl */ +#endif + + if ( (c = fscanf (fp, " IN DNSKEY %d %d %d", &flags, &type, &algo)) != 3 && + (c = fscanf (fp, "KEY %d %d %d", &flags, &type, &algo)) != 3 ) + return -3; + if ( type != 3 || algo != dkp->algo ) + return -4; /* no DNSKEY or algorithm mismatch */ + if ( ((flags >> 8) & 0xFF) != 01 ) + return -5; /* no ZONE key */ + dkp->flags = flags; + + if ( fgets (buf, sizeof buf, fp) == NULL || buf[0] == '\0' ) + return -6; + p = buf + strlen (buf); + *--p = '\0'; /* delete trailing \n */ + /* delete leading ws */ + for ( p = buf; *p && isspace (*p); p++ ) + ; + + dkp->pubkey = strdup (p); + + return 0; +} + +static int dki_writeinfo (const dki_t *dkp, const char *path) +{ + FILE *fp; + + assert (dkp != NULL); + assert (path != NULL && path[0] != '\0'); + + if ( (fp = fopen (path, "w")) == NULL ) + return 0; + dbg_val1 ("dki_writeinfo %s\n", path); + if ( dki_prt_dnskey_raw (dkp, fp) == 0 ) + return 0; + fclose (fp); + touch (path, dkp->time); /* restore time of key file */ + + return 1; +} + +static int dki_setstat (dki_t *dkp, int status, int preserve_time); + +/***************************************************************** +** public function definition +*****************************************************************/ + +/***************************************************************** +** dki_free () +*****************************************************************/ +void dki_free (dki_t *dkp) +{ + assert (dkp != NULL); + + if ( dkp->pubkey ) + free (dkp->pubkey); + free (dkp); +} + +/***************************************************************** +** dki_freelist () +*****************************************************************/ +void dki_freelist (dki_t **listp) +{ + dki_t *curr; + dki_t *next; + + assert (listp != NULL); + + curr = *listp; + while ( curr ) + { + next = curr->next; + dki_free (curr); + curr = next; + } + if ( *listp ) + *listp = NULL; +} + +#if defined(USE_TREE) && USE_TREE +/***************************************************************** +** dki_tfree () +*****************************************************************/ +void dki_tfree (dki_t **tree) +{ + assert (tree != NULL); + // TODO: tdestroy is a GNU extension + // tdestroy (*tree, dki_free); +} +#endif + +/***************************************************************** +** dki_new () +** create new keyfile +** allocate memory for new dki key and init with keyfile +*****************************************************************/ +dki_t *dki_new (const char *dir, const char *name, int ksk, int algo, int bitsize, const char *rfile, int lf_days) +{ + char cmdline[511+1]; + char fname[254+1]; + char randfile[254+1]; + FILE *fp; + int len; + char *flag = ""; + char *expflag = ""; + dki_t *new; + + if ( ksk ) + flag = "-f KSK"; + + randfile[0] = '\0'; + if ( rfile && *rfile ) + snprintf (randfile, sizeof (randfile), "-r %.250s ", rfile); + + if ( algo == DK_ALGO_RSA || algo == DK_ALGO_RSASHA1 ) + expflag = "-e "; + + if ( dir && *dir ) + snprintf (cmdline, sizeof (cmdline), "cd %s ; %s %s%s-n ZONE -a %s -b %d %s %s", + dir, KEYGENCMD, randfile, expflag, dki_algo2str(algo), bitsize, flag, name); + else + snprintf (cmdline, sizeof (cmdline), "%s %s%s-n ZONE -a %s -b %d %s %s", + KEYGENCMD, randfile, expflag, dki_algo2str(algo), bitsize, flag, name); + + dbg_msg (cmdline); + + if ( (fp = popen (cmdline, "r")) == NULL || fgets (fname, sizeof fname, fp) == NULL ) + return NULL; + pclose (fp); + + len = strlen (fname) - 1; + if ( len >= 0 && fname[len] == '\n' ) + fname[len] = '\0'; + + new = dki_read (dir, fname); + if ( new ) + dki_setlifetime (new, lf_days); /* sets gentime + proposed lifetime */ + + return new; +} + +/***************************************************************** +** dki_read () +** read key from file 'filename' (independed of the extension) +*****************************************************************/ +dki_t *dki_read (const char *dirname, const char *filename) +{ + dki_t *dkp; + FILE *fp; + struct stat st; + int len; + int err; + char fname[MAX_FNAMESIZE+1]; + char path[MAX_PATHSIZE+1]; + + dki_estr[0] = '\0'; + if ( (dkp = dki_alloc ()) == NULL ) + return (NULL); + + len = sizeof (fname) - 1; + fname[len] = '\0'; + strncpy (fname, filename, len); + + len = strlen (fname); /* delete extension */ + if ( len > 4 && strcmp (&fname[len - 4], DKI_KEY_FILEEXT) == 0 ) + fname[len - 4] = '\0'; + else if ( len > 10 && strcmp (&fname[len - 10], DKI_PUB_FILEEXT) == 0 ) + fname[len - 10] = '\0'; + else if ( len > 8 && strcmp (&fname[len - 8], DKI_ACT_FILEEXT) == 0 ) + fname[len - 8] = '\0'; + else if ( len > 12 && strcmp (&fname[len - 12], DKI_DEP_FILEEXT) == 0 ) + fname[len - 12] = '\0'; + dbg_line (); + + assert (strlen (dirname)+1 < sizeof (dkp->dname)); + strcpy (dkp->dname, dirname); + + assert (strlen (fname)+1 < sizeof (dkp->fname)); + strcpy (dkp->fname, fname); + dbg_line (); + if ( sscanf (fname, "K%254[^+]+%hd+%d", dkp->name, &dkp->algo, &dkp->tag) != 3 ) + { + snprintf (dki_estr, sizeof (dki_estr), + "dki_read: Filename don't match expected format (%s)", fname); + return (NULL); + } + + pathname (path, sizeof (path), dkp->dname, dkp->fname, DKI_KEY_FILEEXT); + dbg_val ("dki_read: path \"%s\"\n", path); + if ( (fp = fopen (path, "r")) == NULL ) + { + snprintf (dki_estr, sizeof (dki_estr), + "dki_read: Can\'t open file \"%s\" for reading", path); + return (NULL); + } + + dbg_line (); + if ( (err = dki_readfile (fp, dkp)) != 0 ) + { + dbg_line (); + snprintf (dki_estr, sizeof (dki_estr), + "dki_read: Can\'t read key from file %s (errno %d)", path, err); + fclose (fp); + return (NULL); + } + + dbg_line (); + if ( fstat (fileno(fp), &st) ) + { + snprintf (dki_estr, sizeof (dki_estr), + "dki_read: Can\'t stat file %s", fname); + return (NULL); + } + dkp->time = st.st_mtime; + + dbg_line (); + pathname (path, sizeof (path), dkp->dname, dkp->fname, DKI_ACT_FILEEXT); + if ( fileexist (path) ) + { + if ( dki_isrevoked (dkp) ) + dkp->status = DKI_REV; + else + dkp->status = DKI_ACT; + } + else + { + pathname (path, sizeof (path), dkp->dname, dkp->fname, DKI_PUB_FILEEXT); + if ( fileexist (path) ) + dkp->status = DKI_PUB; + else + { + pathname (path, sizeof (path), dkp->dname, dkp->fname, DKI_DEP_FILEEXT); + if ( fileexist (path) ) + dkp->status = DKI_DEP; + else + dkp->status = DKI_SEP; + } + } + + dbg_line (); + fclose (fp); + + dbg_line (); + return dkp; +} + +/***************************************************************** +** dki_readdir () +** read key files from directory 'dir' and, if recursive is +** true, from all directorys below that. +*****************************************************************/ +int dki_readdir (const char *dir, dki_t **listp, int recursive) +{ + dki_t *dkp; + DIR *dirp; + struct dirent *dentp; + char path[MAX_PATHSIZE+1]; + + dbg_val ("directory: opendir(%s)\n", dir); + if ( (dirp = opendir (dir)) == NULL ) + return 0; + + while ( (dentp = readdir (dirp)) != NULL ) + { + if ( is_dotfile (dentp->d_name) ) + continue; + + dbg_val ("directory: check %s\n", dentp->d_name); + pathname (path, sizeof (path), dir, dentp->d_name, NULL); + if ( is_directory (path) && recursive ) + { + dbg_val ("directory: recursive %s\n", path); + dki_readdir (path, listp, recursive); + } + else if ( is_keyfilename (dentp->d_name) ) + if ( (dkp = dki_read (dir, dentp->d_name)) ) + dki_add (listp, dkp); + } + closedir (dirp); + return 1; +} + +/***************************************************************** +** dki_setstatus_preservetime () +** set status of key and change extension to +** ".published", ".private" or ".depreciated" +*****************************************************************/ +int dki_setstatus_preservetime (dki_t *dkp, int status) +{ + return dki_setstat (dkp, status, 1); +} + +/***************************************************************** +** dki_setstatus () +** set status of key and change extension to +** ".published", ".private" or ".depreciated" +*****************************************************************/ +int dki_setstatus (dki_t *dkp, int status) +{ + return dki_setstat (dkp, status, 0); +} + +/***************************************************************** +** dki_setstat () +** low level function of dki_setstatus and dki_setstatus_preservetime +*****************************************************************/ +static int dki_setstat (dki_t *dkp, int status, int preserve_time) +{ + char frompath[MAX_PATHSIZE+1]; + char topath[MAX_PATHSIZE+1]; + time_t totime; + time_t currtime; + + if ( dkp == NULL ) + return 0; + + currtime = time (NULL); + status = tolower (status); + switch ( dkp->status ) /* look at old status */ + { + case 'r': + if ( status == 'r' ) + return 1; + break; + case 'a': + if ( status == 'a' ) + return 1; + pathname (frompath, sizeof (frompath), dkp->dname, dkp->fname, DKI_ACT_FILEEXT); + break; + case 'd': + if ( status == 'd' ) + return 1; + pathname (frompath, sizeof (frompath), dkp->dname, dkp->fname, DKI_DEP_FILEEXT); + break; + case 'p': /* or 's' */ + if ( status == 'p' || status == 's' ) + return 1; + pathname (frompath, sizeof (frompath), dkp->dname, dkp->fname, DKI_PUB_FILEEXT); + break; + default: + /* TODO: set error code */ + return 0; + } + + dbg_val ("dki_setstat: \"%s\"\n", frompath); + dbg_val ("dki_setstat: to status \"%c\"\n", status); + + /* a state change could result in different things: */ + /* 1) write a new keyfile when the REVOKE bit is set or unset */ + if ( status == 'r' || (status == 'a' && dki_isrevoked (dkp)) ) + { + pathname (topath, sizeof (topath), dkp->dname, dkp->fname, DKI_KEY_FILEEXT); + + if ( status == 'r' ) + dki_setflag (dkp, DK_FLAG_REVOKE); /* set REVOKE bit */ + else + dki_unsetflag (dkp, DK_FLAG_REVOKE); /* clear REVOKE bit */ + + + dki_writeinfo (dkp, topath); /* ..and write it to the key file */ + + if ( !preserve_time ) + touch (topath, time (NULL)); + + return 0; + } + + + /* 2) change the filename of the private key in all other cases */ + totime = 0L; + if ( preserve_time ) + totime = file_mtime (frompath); /* get original timestamp */ + topath[0] = '\0'; + switch ( status ) + { + case 'a': + pathname (topath, sizeof (topath), dkp->dname, dkp->fname, DKI_ACT_FILEEXT); + break; + case 'd': + pathname (topath, sizeof (topath), dkp->dname, dkp->fname, DKI_DEP_FILEEXT); + break; + case 's': /* standby means a "published KSK" */ + if ( !dki_isksk (dkp) ) + return 2; + status = 'p'; + /* fall through */ + case 'p': + pathname (topath, sizeof (topath), dkp->dname, dkp->fname, DKI_PUB_FILEEXT); + break; + } + + if ( topath[0] ) + { + dbg_val ("dki_setstat: to \"%s\"\n", topath); + if ( link (frompath, topath) == 0 ) + unlink (frompath); + dkp->status = status; + if ( !totime ) + totime = time (NULL); /* set .key file to current time */ + pathname (topath, sizeof (topath), dkp->dname, dkp->fname, DKI_KEY_FILEEXT); + touch (topath, totime); /* store/restore time of status change */ + } + + return 0; +} + +/***************************************************************** +** dki_remove () +** rename files associated with key, so that the keys are not +** recognized by the zkt tools e.g. +** Kdo.ma.in.+001+12345.key ==> kdo.ma.in.+001+12345.key +** (second one starts with a lower case 'k') +*****************************************************************/ +dki_t *dki_remove (dki_t *dkp) +{ + char path[MAX_PATHSIZE+1]; + char newpath[MAX_PATHSIZE+1]; + char newfile[MAX_FNAMESIZE+1]; + dki_t *next; + const char **pext; + static const char *ext[] = { + DKI_KEY_FILEEXT, DKI_PUB_FILEEXT, + DKI_ACT_FILEEXT, DKI_DEP_FILEEXT, + NULL + }; + + if ( dkp == NULL ) + return NULL; + + strncpy (newfile, dkp->fname, sizeof (newfile)); + *newfile = tolower (*newfile); + for ( pext = ext; *pext; pext++ ) + { + pathname (path, sizeof (path), dkp->dname, dkp->fname, *pext); + if ( fileexist (path) ) + { + pathname (newpath, sizeof (newpath), dkp->dname, newfile, *pext); + + dbg_val2 ("dki_remove: %s ==> %s \n", path, newpath); + rename (path, newpath); + } + } + next = dkp->next; + dki_free (dkp); + + return next; +} + +/***************************************************************** +** dki_destroy () +** delete files associated with key and free allocated memory +*****************************************************************/ +dki_t *dki_destroy (dki_t *dkp) +{ + char path[MAX_PATHSIZE+1]; + dki_t *next; + const char **pext; + static const char *ext[] = { + DKI_KEY_FILEEXT, DKI_PUB_FILEEXT, + DKI_ACT_FILEEXT, DKI_DEP_FILEEXT, + NULL + }; + + if ( dkp == NULL ) + return NULL; + + for ( pext = ext; *pext; pext++ ) + { + pathname (path, sizeof (path), dkp->dname, dkp->fname, *pext); + if ( fileexist (path) ) + { + dbg_val ("dki_remove: %s \n", path); + unlink (path); + } + } + next = dkp->next; + dki_free (dkp); + + return next; +} + +/***************************************************************** +** dki_algo2str () +** return a string describing the key algorithm +*****************************************************************/ +char *dki_algo2str (int algo) +{ + switch ( algo ) + { + case DK_ALGO_RSA: return ("RSAMD5"); + case DK_ALGO_DH: return ("DH"); + case DK_ALGO_DSA: return ("DSA"); + case DK_ALGO_EC: return ("EC"); + case DK_ALGO_RSASHA1: return ("RSASHA1"); + } + return ("unknown"); +} + +/***************************************************************** +** dki_geterrstr () +** return error string +*****************************************************************/ +const char *dki_geterrstr () +{ + return dki_estr; +} + +/***************************************************************** +** dki_prt_dnskey () +*****************************************************************/ +int dki_prt_dnskey (const dki_t *dkp, FILE *fp) +{ + return dki_prt_dnskeyttl (dkp, fp, 0); +} + +/***************************************************************** +** dki_prt_dnskeyttl () +*****************************************************************/ +int dki_prt_dnskeyttl (const dki_t *dkp, FILE *fp, int ttl) +{ + char *p; + + dki_estr[0] = '\0'; + if ( dkp == NULL ) + return 0; + + fprintf (fp, "%s ", dkp->name); + if ( ttl > 0 ) + fprintf (fp, "%d ", ttl); + fprintf (fp, "IN DNSKEY "); + fprintf (fp, "%d 3 %d (", dkp->flags, dkp->algo); + fprintf (fp, "\n\t\t\t"); + for ( p = dkp->pubkey; *p ; p++ ) + if ( *p == ' ' ) + fprintf (fp, "\n\t\t\t"); + else + putc (*p, fp); + fprintf (fp, "\n\t\t"); + if ( dki_isrevoked (dkp) ) + fprintf (fp, ") ; key id = %u (original key id = %u)", (dkp->tag + 128) % 65535, dkp->tag); + else + fprintf (fp, ") ; key id = %u", dkp->tag); + fprintf (fp, "\n"); + + return 1; +} + +/***************************************************************** +** dki_prt_dnskey_raw () +*****************************************************************/ +int dki_prt_dnskey_raw (const dki_t *dkp, FILE *fp) +{ + int days; + + dki_estr[0] = '\0'; + if ( dkp == NULL ) + return 0; + + if ( dkp->gentime ) + fprintf (fp, ";%%\tgenerationtime=%s\n", time2isostr (dkp->gentime, 's')); + if ( (days = dki_lifetimedays (dkp)) ) + fprintf (fp, ";%%\tlifetime=%dd\n", days); + if ( dkp->exptime ) + fprintf (fp, ";%%\texpirationtime=%s\n", time2isostr (dkp->exptime, 's')); + + fprintf (fp, "%s ", dkp->name); +#if 0 + if ( ttl > 0 ) + fprintf (fp, "%d ", ttl); +#endif + fprintf (fp, "IN DNSKEY "); + fprintf (fp, "%d 3 %d ", dkp->flags, dkp->algo); + fprintf (fp, "%s\n", dkp->pubkey); + + return 1; +} + +/***************************************************************** +** dki_prt_comment () +*****************************************************************/ +int dki_prt_comment (const dki_t *dkp, FILE *fp) +{ + int len = 0; + + dki_estr[0] = '\0'; + if ( dkp == NULL ) + return len; + len += fprintf (fp, "; %s ", dkp->name); + len += fprintf (fp, "tag=%u ", dkp->tag); + len += fprintf (fp, "algo=%s ", dki_algo2str(dkp->algo)); + len += fprintf (fp, "generated %s\n", time2str (dkp->time, 's')); + + return len; +} + +/***************************************************************** +** dki_prt_trustedkey () +*****************************************************************/ +int dki_prt_trustedkey (const dki_t *dkp, FILE *fp) +{ + char *p; + int spaces; + int len = 0; + + dki_estr[0] = '\0'; + if ( dkp == NULL ) + return len; + len += fprintf (fp, "\"%s\" ", dkp->name); + spaces = 22 - (strlen (dkp->name) + 3); + len += fprintf (fp, "%*s", spaces > 0 ? spaces : 0 , " "); + len += fprintf (fp, "%d 3 %d ", dkp->flags, dkp->algo); + if ( spaces < 0 ) + len += fprintf (fp, "\n\t\t\t%7s", " "); + len += fprintf (fp, "\""); + for ( p = dkp->pubkey; *p ; p++ ) + if ( *p == ' ' ) + len += fprintf (fp, "\n\t\t\t\t"); + else + putc (*p, fp), len += 1; + + if ( dki_isrevoked (dkp) ) + len += fprintf (fp, "\" ; # key id = %u (original key id = %u)\n\n", (dkp->tag + 128) % 65535, dkp->tag); + else + len += fprintf (fp, "\" ; # key id = %u\n\n", dkp->tag); + return len; +} + + +/***************************************************************** +** dki_cmp () return <0 | 0 | >0 +*****************************************************************/ +int dki_cmp (const dki_t *a, const dki_t *b) +{ + int res; + + dki_estr[0] = '\0'; + if ( a == NULL ) return -1; + if ( b == NULL ) return 1; + + /* sort by domain name, */ + if ( (res = domaincmp (a->name, b->name)) != 0 ) + return res; + + /* then by key type, */ + if ( (res = dki_isksk (b) - dki_isksk (a)) != 0 ) + return res; + + /* and last by creation time, */ + return (ulong)a->time - (ulong)b->time; +} + +#if defined(USE_TREE) && USE_TREE +/***************************************************************** +** dki_allcmp () return <0 | 0 | >0 +*****************************************************************/ +int dki_allcmp (const dki_t *a, const dki_t *b) +{ + int res; + + dki_estr[0] = '\0'; + if ( a == NULL ) return -1; + if ( b == NULL ) return 1; + +// fprintf (stderr, "dki_allcmp %s, %s)\n", a->name, b->name); + /* sort by domain name, */ + if ( (res = domaincmp (a->name, b->name)) != 0 ) + return res; + + /* then by key type, */ + if ( (res = dki_isksk (b) - dki_isksk (a)) != 0 ) + return res; + + /* creation time, */ + if ( (res = (ulong)a->time - (ulong)b->time) != 0 ) + return res; + + /* and last by tag */ + return a->tag - b->tag; +} + +/***************************************************************** +** dki_namecmp () return <0 | 0 | >0 +*****************************************************************/ +int dki_namecmp (const dki_t *a, const dki_t *b) +{ + dki_estr[0] = '\0'; + if ( a == NULL ) return -1; + if ( b == NULL ) return 1; + + return domaincmp (a->name, b->name); +} +/***************************************************************** +** dki_tagcmp () return <0 | 0 | >0 +*****************************************************************/ +int dki_tagcmp (const dki_t *a, const dki_t *b) +{ + dki_estr[0] = '\0'; + if ( a == NULL ) return -1; + if ( b == NULL ) return 1; + + return a->tag - b->tag; +} +#endif + +/***************************************************************** +** dki_timecmp () +*****************************************************************/ +int dki_timecmp (const dki_t *a, const dki_t *b) +{ + dki_estr[0] = '\0'; + if ( a == NULL ) return -1; + if ( b == NULL ) return 1; + + return ((ulong)a->time - (ulong)b->time); +} + +/***************************************************************** +** dki_time () return the timestamp of the key +*****************************************************************/ +time_t dki_time (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->time); +} + +/***************************************************************** +** dki_exptime () return the expiration timestamp of the key +*****************************************************************/ +time_t dki_exptime (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->exptime); +} + +/***************************************************************** +** dki_lifetime (dkp) return the lifetime of the key in sec! +*****************************************************************/ +time_t dki_lifetime (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->lifetime); +} + +/***************************************************************** +** dki_lifetimedays (dkp) return the lifetime of the key in days! +*****************************************************************/ +ushort dki_lifetimedays (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->lifetime / DAYSEC); +} + +/***************************************************************** +** dki_gentime (dkp) return the generation timestamp of the key +*****************************************************************/ +time_t dki_gentime (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->gentime > 0L ? dkp->gentime: dkp->time); +} + +/***************************************************************** +** dki_setlifetime (dkp, int days) +** set the lifetime in days (and also the gentime if not set) +** return the old lifetime of the key in days! +*****************************************************************/ +ushort dki_setlifetime (dki_t *dkp, int days) +{ + ulong lifetsec; + char path[MAX_PATHSIZE+1]; + + dki_estr[0] = '\0'; + assert (dkp != NULL); + + lifetsec = dkp->lifetime; /* old lifetime */ + dkp->lifetime = days * DAYSEC; /* set new lifetime */ + + dbg_val1 ("dki_setlifetime (%d)\n", days); + if ( lifetsec == 0 ) /* initial setup (old lifetime was zero)? */ + dkp->gentime = dkp->time; + + pathname (path, sizeof (path), dkp->dname, dkp->fname, DKI_KEY_FILEEXT); + dki_writeinfo (dkp, path); + + return (lifetsec / DAYSEC); +} + +/***************************************************************** +** dki_setexptime (dkp, time_t sec) +** set the expiration time of the key in seconds since the epoch +** return the old exptime +*****************************************************************/ +time_t dki_setexptime (dki_t *dkp, time_t sec) +{ + char path[MAX_PATHSIZE+1]; + time_t oldexptime; + + dki_estr[0] = '\0'; + assert (dkp != NULL); + + dbg_val1 ("dki_setexptime (%ld)\n", sec); + oldexptime = dkp->exptime; + dkp->exptime = sec; + + pathname (path, sizeof (path), dkp->dname, dkp->fname, DKI_KEY_FILEEXT); + dki_writeinfo (dkp, path); + +#if 0 /* not necessary ? */ + touch (path, time (NULL)); +#endif + return (oldexptime); +} + +/***************************************************************** +** dki_age () return age of key in seconds since 'curr' +*****************************************************************/ +int dki_age (const dki_t *dkp, time_t curr) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return ((ulong)curr - (ulong)dkp->time); +} + +/***************************************************************** +** dki_getflag () return the flags field of a key +*****************************************************************/ +dk_flag_t dki_getflag (const dki_t *dkp, time_t curr) +{ + dki_estr[0] = '\0'; + return dkp->flags; +} + +/***************************************************************** +** dki_setflag () set a flag of a key +*****************************************************************/ +dk_flag_t dki_setflag (dki_t *dkp, dk_flag_t flag) +{ + dki_estr[0] = '\0'; + return dkp->flags |= (ushort)flag; +} + +/***************************************************************** +** dki_unsetflag () unset a flag of a key +*****************************************************************/ +dk_flag_t dki_unsetflag (dki_t *dkp, dk_flag_t flag) +{ + dki_estr[0] = '\0'; + return dkp->flags &= ~((ushort)flag); +} + +/***************************************************************** +** dki_isksk () +*****************************************************************/ +int dki_isksk (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->flags & DK_FLAG_KSK) == DK_FLAG_KSK; +} + +/***************************************************************** +** dki_isrevoked () +*****************************************************************/ +int dki_isrevoked (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->flags & DK_FLAG_REVOKE) == DK_FLAG_REVOKE; +} + +/***************************************************************** +** dki_isdepreciated () +*****************************************************************/ +int dki_isdepreciated (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + return dki_status (dkp) == DKI_DEPRECIATED; +} + +/***************************************************************** +** dki_isactive () +*****************************************************************/ +int dki_isactive (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + return dki_status (dkp) == DKI_ACTIVE; +} + +/***************************************************************** +** dki_ispublished () +*****************************************************************/ +int dki_ispublished (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + return dki_status (dkp) == DKI_PUBLISHED; +} + + +/***************************************************************** +** dki_status () return key status +*****************************************************************/ +dk_status_t dki_status (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + return (dkp->status); +} + +/***************************************************************** +** dki_statusstr () return key status as string +*****************************************************************/ +const char *dki_statusstr (const dki_t *dkp) +{ + dki_estr[0] = '\0'; + assert (dkp != NULL); + switch ( dkp->status ) + { + case DKI_ACT: return "active"; + case DKI_PUB: if ( dki_isksk (dkp) ) + return "standby"; + else + return "published"; + case DKI_DEP: return "depreciated"; + case DKI_REV: return "revoked"; + case DKI_SEP: return "sep"; + } + return "unknown"; +} + +/***************************************************************** +** dki_add () add a key to the given list +*****************************************************************/ +dki_t *dki_add (dki_t **list, dki_t *new) +{ + dki_t *curr; + dki_t *last; + + dki_estr[0] = '\0'; + if ( list == NULL ) + return NULL; + if ( new == NULL ) + return *list; + + last = curr = *list; + while ( curr && dki_cmp (curr, new) < 0 ) + { + last = curr; + curr = curr->next; + } + + if ( curr == *list ) /* add node at start of list */ + *list = new; + else /* add node at end or between two nodes */ + last->next = new; + new->next = curr; + + return *list; +} + +/***************************************************************** +** dki_search () search a key with the given tag, or the first +** occurence of a key with the given name +*****************************************************************/ +const dki_t *dki_search (const dki_t *list, int tag, const char *name) +{ + const dki_t *curr; + + dki_estr[0] = '\0'; + curr = list; + if ( tag ) + while ( curr && (tag != curr->tag || + (name && *name && strcmp (name, curr->name) != 0)) ) + curr = curr->next; + else if ( name && *name ) + while ( curr && strcmp (name, curr->name) != 0 ) + curr = curr->next; + else + curr = NULL; + + return curr; +} + +#if defined(USE_TREE) && USE_TREE +/***************************************************************** +** dki_tadd () add a key to the given tree +*****************************************************************/ +dki_t *dki_tadd (dki_t **tree, dki_t *new) +{ + dki_t **p; + + dki_estr[0] = '\0'; + p = tsearch (new, tree, dki_namecmp); + if ( *p == new ) + dbg_val ("dki_tadd: New entry %s added\n", new->name); + else + { + dbg_val ("dki_tadd: New key added to %s\n", new->name); + dki_add (p, new); + } + + return *p; +} + +/***************************************************************** +** dki_tsearch () search a key with the given tag, or the first +** occurence of a key with the given name +*****************************************************************/ +const dki_t *dki_tsearch (const dki_t *tree, int tag, const char *name) +{ + dki_t search; + dki_t **p; + + dki_estr[0] = '\0'; + search.tag = tag; + snprintf (search.name, sizeof (search.name), "%s", name); + p = tfind (&search, &tree, dki_namecmp); + if ( p == NULL ) + return NULL; + + return dki_search (*p, tag, name); +} +#endif + +/***************************************************************** +** dki_find () find the n'th ksk or zsk key with given status +*****************************************************************/ +const dki_t *dki_find (const dki_t *list, int ksk, int status, int no) +{ + const dki_t *dkp; + const dki_t *last; + + dki_estr[0] = '\0'; + last = NULL; + for ( dkp = list; no > 0 && dkp; dkp = dkp->next ) + if ( dki_isksk (dkp) == ksk && dki_status (dkp) == status ) + { + no--; + last = dkp; + } + + return last; +} diff --git a/contrib/zkt/dki.h b/contrib/zkt/dki.h new file mode 100644 index 0000000..548ce68 --- /dev/null +++ b/contrib/zkt/dki.h @@ -0,0 +1,185 @@ +/***************************************************************** +** +** @(#) dki.h -- Header file for DNSsec Key info/manipulation +** +** Copyright (c) July 2004 - Jan 2005, Holger Zuleger HZnet. All rights reserved. +** +** This software is open source. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** +** 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. +** +** Neither the name of Holger Zuleger HZnet nor the names of its contributors may +** be used to endorse or promote products derived from this software without +** specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*****************************************************************/ +#ifndef DKI_H +# define DKI_H + +# ifndef TYPES_H +# include +# include +# include +# endif + +# define MAX_LABELSIZE (255) +# define MAX_FNAMESIZE (1+255+2+3+1+5+1+11) + /* Kdomain.+ALG+KEYID.type */ + /* domain == FQDN (max 255) */ + /* ALG == 3; KEYID == 5 chars */ + /* type == key||published|private|depreciated == 11 chars */ +//# define MAX_DNAMESIZE (254) +# define MAX_DNAMESIZE (1023) + /* /path/name / filename */ +# define MAX_PATHSIZE (MAX_DNAMESIZE + 1 + MAX_FNAMESIZE) + +/* algorithm types */ +# define DK_ALGO_RSA 1 /* RFC2537 */ +# define DK_ALGO_DH 2 /* RFC2539 */ +# define DK_ALGO_DSA 3 /* RFC2536 (mandatory) */ +# define DK_ALGO_EC 4 /* */ +# define DK_ALGO_RSASHA1 5 /* RFC3110 */ + +/* protocol types */ +# define DK_PROTO_DNS 3 + +/* flag bits */ +typedef enum { /* 11 1111 */ + /* 0123 4567 8901 2345 */ + DK_FLAG_KSK= 01, /* 0000 0000 0000 0001 Bit 15 RFC4034/RFC3757 */ + DK_FLAG_REVOKE= 0200, /* 0000 0000 1000 0000 Bit 8 RFC5011 */ + DK_FLAG_ZONE= 0400, /* 0000 0001 0000 0000 Bit 7 RFC4034 */ +} dk_flag_t; + +/* status types */ +typedef enum { + DKI_SEP= 'e', + DKI_SECUREENTRYPOINT= 'e', + DKI_PUB= 'p', + DKI_PUBLISHED= 'p', + DKI_ACT= 'a', + DKI_ACTIVE= 'a', + DKI_DEP= 'd', + DKI_DEPRECIATED= 'd', + DKI_REV= 'r', + DKI_REVOKED= 'r', +} dk_status_t; + +# define DKI_KEY_FILEEXT ".key" +# define DKI_PUB_FILEEXT ".published" +# define DKI_ACT_FILEEXT ".private" +# define DKI_DEP_FILEEXT ".depreciated" + +# define DKI_KSK 1 +# define DKI_ZSK 0 + +typedef struct dki { + char dname[MAX_DNAMESIZE+1]; /* directory */ + char fname[MAX_FNAMESIZE+1]; /* file name without extension */ + char name[MAX_LABELSIZE+1]; /* domain name or label */ + ushort algo; /* key algorithm */ + ushort proto; /* must be 3 (DNSSEC) */ + dk_flag_t flags; /* ZONE, optional SEP or REVOKE flag */ + time_t time; /* key file time */ + time_t gentime; /* key generation time (will be set on key generation and never changed) */ + time_t exptime; /* time the key was expired (0L if not) */ + ulong lifetime; /* proposed key life time at time of generation */ + uint tag; /* key id */ + dk_status_t status; /* key exist (".key") and name of private */ + /* key file is ".published", ".private" */ + /* or ".depreciated" */ + char *pubkey; /* base64 public key */ + struct dki *next; /* ptr to next entry in list */ +} dki_t; + +#if defined(USE_TREE) && USE_TREE +/* + * Instead of including , which contains horrible false function + * declarations, we declared it for our usage (Yes, these functions return + * the adress of a pointer variable) + */ +typedef enum +{ + /* we change the naming to the new, and more predictive one, used by Knuth */ + PREORDER, /* preorder, */ + INORDER, /* postorder, */ + POSTORDER, /* endorder, */ + LEAF /* leaf */ +} +VISIT; + +dki_t **tsearch (const dki_t *dkp, dki_t **tree, int(*compar)(const dki_t *, const dki_t *)); +dki_t **tfind (const dki_t *dkp, const dki_t **tree, int(*compar)(const dki_t *, const dki_t *)); +dki_t **tdelete (const dki_t *dkp, dki_t **tree, int(*compar)(const dki_t *, const dki_t *)); +void twalk (const dki_t *root, void (*action)(const dki_t **nodep, VISIT which, int depth)); + +extern void dki_tfree (dki_t **tree); +extern dki_t *dki_tadd (dki_t **tree, dki_t *new); +extern int dki_tagcmp (const dki_t *a, const dki_t *b); +extern int dki_namecmp (const dki_t *a, const dki_t *b); +extern int dki_allcmp (const dki_t *a, const dki_t *b); +#endif + +extern dki_t *dki_read (const char *dir, const char *fname); +extern int dki_readdir (const char *dir, dki_t **listp, int recursive); +extern int dki_prt_trustedkey (const dki_t *dkp, FILE *fp); +extern int dki_prt_dnskey (const dki_t *dkp, FILE *fp); +extern int dki_prt_dnskeyttl (const dki_t *dkp, FILE *fp, int ttl); +extern int dki_prt_dnskey_raw (const dki_t *dkp, FILE *fp); +extern int dki_prt_comment (const dki_t *dkp, FILE *fp); +extern int dki_cmp (const dki_t *a, const dki_t *b); +extern int dki_timecmp (const dki_t *a, const dki_t *b); +extern int dki_age (const dki_t *dkp, time_t curr); +extern dk_flag_t dki_getflag (const dki_t *dkp, time_t curr); +extern dk_flag_t dki_setflag (dki_t *dkp, dk_flag_t flag); +extern dk_flag_t dki_unsetflag (dki_t *dkp, dk_flag_t flag); +extern dk_status_t dki_status (const dki_t *dkp); +extern const char *dki_statusstr (const dki_t *dkp); +extern int dki_isksk (const dki_t *dkp); +extern int dki_isdepreciated (const dki_t *dkp); +extern int dki_isrevoked (const dki_t *dkp); +extern int dki_isactive (const dki_t *dkp); +extern int dki_ispublished (const dki_t *dkp); +extern time_t dki_time (const dki_t *dkp); +extern time_t dki_exptime (const dki_t *dkp); +extern time_t dki_gentime (const dki_t *dkp); +extern time_t dki_lifetime (const dki_t *dkp); +extern ushort dki_lifetimedays (const dki_t *dkp); +extern ushort dki_setlifetime (dki_t *dkp, int days); +extern time_t dki_setexptime (dki_t *dkp, time_t sec); +extern dki_t *dki_new (const char *dir, const char *name, int ksk, int algo, int bitsize, const char *rfile, int lf_days); +extern dki_t *dki_remove (dki_t *dkp); +extern dki_t *dki_destroy (dki_t *dkp); +extern int dki_setstatus (dki_t *dkp, int status); +extern int dki_setstatus_preservetime (dki_t *dkp, int status); +extern dki_t *dki_add (dki_t **dkp, dki_t *new); +extern const dki_t *dki_tsearch (const dki_t *tree, int tag, const char *name); +extern const dki_t *dki_search (const dki_t *list, int tag, const char *name); +extern const dki_t *dki_find (const dki_t *list, int ksk, int status, int first); +extern void dki_free (dki_t *dkp); +extern void dki_freelist (dki_t **listp); +extern char *dki_algo2str (int algo); +extern const char *dki_geterrstr (void); + +#endif diff --git a/contrib/zkt/dnssec-signer.8 b/contrib/zkt/dnssec-signer.8 new file mode 100644 index 0000000..07c3c6c --- /dev/null +++ b/contrib/zkt/dnssec-signer.8 @@ -0,0 +1,436 @@ +.TH dnssec-signer 8 "June 27, 2008" "ZKT 0.96" "" +\" turn off hyphenation +.\" if n .nh +.nh +.SH NAME +dnssec-signer \(em Secure DNS zone signing tool + +.SH SYNOPSYS +.na +.B dnssec-signer +.RB [ \-L|--logfile +.IR "file" ] +.RB [ \-V|--view +.IR "view" ] +.RB [ \-c +.IR "file" ] +.RB [ \-fhnr ] +.RB [ \-v +.RB [ \-v ]] +.B \-N +.I "named.conf" +.RI [ zone +.RI "" ... ] +.br +.B dnssec-signer +.RB [ \-L|--logfile +.IR "file" ] +.RB [ \-V|--view +.IR "view" ] +.RB [ \-c +.IR "file" ] +.RB [ \-fhnr ] +.RB [ \-v +.RB [ \-v ]] +.RB [ \-D +.IR "directory" ] +.RI [ zone +.RI "" ... ] +.br +.B dnssec-signer +.RB [ \-L|--logfile +.IR "file" ] +.RB [ \-V|--view +.IR "view" ] +.RB [ \-c +.IR "file" ] +.RB [ \-fhnr ] +.RB [ \-v +.RB [ \-v ]] +.B \-o +.IR "origin" +.RI [ zonefile ] + +.SH DESCRIPTION +The +.I dnssec-signer +command is a wrapper around +.I dnssec-signzone(8) +and +.I dnssec-keygen(8) +to sign a zone and manage the necessary zone keys. +It's able to increment the serial number before signing the zone +and can trigger +.I named(8) +to reload the signed zone file. +The command controls several secure zones and, if started in regular +intervals via +.IR cron(8) , +can do all that stuff automatically. +.PP +In the most useful usage scenario the command will be called with option +.B \-N +to read the secure zones out of the given +.I named.conf +file. +If you have a configuration file with views, you have to use option +-V viewname or --view viewname to specify the name of the view. +Alternatively you could link the executable file to a second name like +.I dnssec-signer-viewname +and use that command to specify the name of the view. +All master zone statements will be scanned for filenames +ending with ".signed". +These zones will be checked if the necessary zone- and key signing keys +are existent and fresh enough to be used in the signing process. +If some out-dated keys where found, new keying material will be generated via +the +.I dnssec-keygen(8) +command and the old ones will be marked as depreciated. +So the command do anything needed for a zone key rollover as defined by [2]. +.PP +If the resigning interval is reached or any new key must be announced, +the serial number of the zone will be incremented and the +.I dnssec-signzone(8) +command will be evoked to sign the zone. +After that, if the option +.B \-r +is given, the +.I rndc(8) +command will be called to reload the zone on the +nameserver. +.PP +In the second form of the command it's possible to specify a directory +tree with the option +.B \-D +.IR dir . +Every secure zone found in a subdirectory below +.I dir +will be signed. +However, it's also possible to reduce the signing to those +zones given as arguments. +In directory mode the pre-requisite is, that the directory name is +exactly (including the trailing dot) the same as the zone name. +.PP +In the last form of the command, the functionality is more or less the same +as the +.I dnssec-signzone (8) +command. +The parameter specify the zone file name and the option +.B \-o +takes the name of the zone. +.PP +If neither +.B \-N +nor +.B \-D +nor +.B \-o +is given, then the default directory specified in the +.I dnssec.conf +file by the parameter +.I zonedir +will be used as the top level directory. + +.SH OPTIONS +.TP +.BI \-L " file|dir" ", \-\-logfile=" file|dir +Specify the name of a log file or a directory where +logfiles are created with a name like +.fam C +.\"# define LOG_FNAMETMPL "/zkt-%04d-%02d-%02dT%02d%02d%02dZ.log" +.RI zkt- YYYY-MM-DD T hhmmss Z.log . +.fam T +.\" \&. +If the argument is not an absolute path name and a zone directory +is specified in the config file, this will prepend the given name. +This option is also settable in the dnssec.conf file via the parameter +.BI LogFile . +.br +The default is no file logging, but error logging to syslog with facility +.BI USER +at level +.BI ERROR +is enabled by default. +These parameters are settable via the config file parameter +.BI "SyslogFacility:" , +.BI "SyslogLevel:" , +.BI "LogFile:" +and +.BI "Loglevel" . +.br +There is an additional parameter +.BI VerboseLog: +which specifies the verbosity (0|1|2) of messages that will be logged +with level +.BI DEBUG +to file and syslog. + +.TP +.BI \-V " view" ", \-\-view=" view +Try to read the default configuration out of a file named +.I dnssec-.conf . +Instead of specifying the \-V or --view option every time, +it's also possible to create a hard or softlink to the +executable file with an additional name like +.I dnssec-zkt- . +.TP +.BI \-c " file" ", \-\-config=" file +Read configuration values out of the specified file. +Otherwise the default config file is read or build-in defaults +will be used. +.TP +.BI \-O " optstr" ", \-\-config-option=" optstr +Set any config file option via the commandline. +Several config file options could be specified at the argument string +but have to be delimited by semicolon (or newline). +.TP +.BR \-f ", " \-\-force +Force a resigning of the zone, regardless if the resigning interval +is reached, or any new keys must be announced. +.TP +.BR \-n ", " \-\-noexec +Don't execute the +.I dnssec-signzone(8) +command. +Currently this option is of very limited usage. +.TP +.BR \-r ", " \-\-reload +Reload the zone via +.I rndc(8) +after successful signing. +In a production environment it's recommended to use this option +to be sure that a freshly signed zone will be immediately propagated. +However, that's only feasable if the named runs on the signing +machine, which is not recommended. +Otherwise the signed zonefile must be copied to the production +server before reloading the zone. +If this is the case, the parameter +.I propagation +in the +.I dnssec.conf +file must be set to a reasonable value. +.TP +.BR \-v ", " \-\-verbose +Verbose mode (recommended). +A second +.B \-v +will be a little more verbose. +.TP +.BR \-h ", " \-\-help +Print out the online help. + +.SH SAMPLE USAGE +.TP +.fam C +.B "dnssec-signer \-N /var/named/named.conf \-r \-v \-v +.fam T +Sign all secure zones found in the named.conf file and, if necessary, +trigger a reload of the zone. +Print some explanatory remarks on stdout. +.TP +.fam C +.B "dnssec-signer \-D zonedir/example.net. \-f \-v \-v +.fam T +Force the signing of the zone found in the directory +.I zonedir/example.net . +Do not reload the zone. +.TP +.fam C +.B "dnssec-signer \-D zonedir \-f \-v \-v example.net. +.fam T +Same as above. +.TP +.fam C +.B "dnssec-signer \-f \-v \-v example.net. +.fam T +Same as above if the +.I dnssec.conf +file contains the path of the parent directory of the +.I example.net +zone. +.TP +.fam C +.B "dnssec-signer \-f \-v \-v \-o example.net. zone.db +.fam T +Same as above if we are in the directory containing the +.I example.net +files. +.TP +.fam C +.B "dnssec-signer \-\-config-option='ResignInterval 1d; Sigvalidity 28h; \e +.B ZSK_lifetime 2d;' \-v \-v \-o example.net. zone.db +.fam T +.br +Sign the example.net zone but overwrite some config file values with the parameters +given on the commandline. + +.SH Zone setup and initial preparation +.TP +Create a separate directory for every secure zone. +.br +This is useful because there are many additional files needed to +secure a zone. +Besides the zone file +.RI ( zone.db ), +there is a signed zone file +.RI ( zone.db.signed), +a minimum of four files containing the keying material, +a file called +.I dnskey.db +with the current used keys, +and the +.I dsset- +and +.IR keyset- files +created by the +.I dnssec-signzone(8) +command. +So in summary there is a minimum of nine files used per secure zone. +For every additional key there are two extra files and +every delegated subzone creates also two or three files. +.TP +Name the directory just like the zone. +.br +That's only needed if you want to use the dnssec-signer command in +directory mode +.RB ( \-D ). +Then the name of the zone will be parsed out of the directory name. +.TP +Change the name of the zone file to \fIzone.db\fP +Otherwise you have to set the name via the +.I dnssec.conf +parameter +.IR zonefile , +or you have to use the option +.B \-o +to name the zone and specify the zone file as argument. +.TP +Add the name of the signed zonefile to the \fInamed.conf\fP file +The filename is the name of the zone file with the +extension +.IR .signed . +Create an empty file with the name +.IB zonefile .signed +in the zone directory. +.TP +Include the keyfile in the zone. +The name of the keyfile is settable by the +.I dnssec.conf +parameter +.I keyfile . +The default is +.I dnskey.db . +.br +.if t \{\ +.nf +.fam C + ... + IN NS ns1.example.net. + IN NS ns2.example.net. +$INCLUDE dnskey.db + ... +.fi +.fam T +.\} +.TP +Control the format of the SOA-Record +For automatic incrementation of the serial number, the SOA-Record +must be formated, so that the serial number is on a single line and +left justified in a field of at least 10 spaces! +.if t \{\ +.fam C +.fi 0 +@ IN SOA ns1.example.net. hostmaster.example.net. ( + 60 ; Serial + 43200 ; Refresh + 1800 ; Retry + 2W ; Expire + 7200 ); Minimum +.fi +.fam T +.\} +If you use a BIND Verison of 9.4 or greater and +use the unixtime format for the serial number (See parameter +Serialformat in +.IR dnssec.conf ) +than this is not necessary. +.TP +Try to sign the zone +If the current working directory is the directory of the zone +.IR example.net , +use the command +.fam C +.nf +.sp 0.5 + $ dnssec-signer \-D .. \-v \-v example.net + $ dnssec-signer \-o example.net. +.sp 0.5 +.fi +.fam T +to create the initial keying material and a signed zone file. +Then try to load the file on the name server. + +.SH ENVIRONMENT VARIABLES +.TP +ZKT_CONFFILE +Specifies the name of the default global configuration files. + +.SH FILES +.TP +.I /var/named/dnssec.conf +Built-in default global configuration file. +The name of the default global config file is settable via +the environment variable ZKT_CONFFILE. +Use +.I dnssec-zkt(8) +with option +.B \-Z +to create an initial config file. +.TP +.I /var/named/dnssec-.conf +View specific global configuration file. +.TP +.I ./dnssec.conf +Local configuration file. +.TP +.I dnskey.db +The file contains the currently used key and zone signing keys. +It will be created by +.IR dnsssec-signer(8) . +The name of the file is settable via the dnssec configuration +file (parameter +.IR keyfile ). +.TP +.I zone.db +This is the zone file. +The name of the file is settable via the dnssec configuration +file (parameter +.IR zonefile ). + +.SH BUGS +.PP +The zone name given as an argument must be ending with a dot. +.PP +The named.conf parser is a little bit rudimental and not +very well tested. + +.SH AUTHOR +Holger Zuleger + +.SH COPYRIGHT +Copyright (c) 2005 \- 2008 by Holger Zuleger. +Licensed under the GPL 2. There is NO warranty; not even for MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. +.\"-------------------------------------------------- +.SH SEE ALSO +dnssec-keygen(8), dnssec-signzone(8), rndc(8), named.conf(5), dnssec-zkt(8) +.br +RFC4033, RFC4034, RFC4035 +.br +[1] DNSSEC HOWTO Tutorial by Olaf Kolkman, RIPE NCC +.br +(http://www.nlnetlabs.nl/dnssec_howto/) +.br +[2] RFC4641 "DNSSEC Operational Practices" by Miek Gieben and Olaf Kolkman +.br +(http://www.ietf.org/rfc/rfc4641.txt) diff --git a/contrib/zkt/dnssec-signer.c b/contrib/zkt/dnssec-signer.c new file mode 100644 index 0000000..5b2b8f6 --- /dev/null +++ b/contrib/zkt/dnssec-signer.c @@ -0,0 +1,1002 @@ +/***************************************************************** +** +** @(#) dnssec-signer.c (c) Jan 2005 Holger Zuleger hznet.de +** +** A wrapper around the BIND dnssec-signzone command which is able +** to resign a zone if neccessary and doing a zone or key signing key rollover. +** +** Copyright (c) 2005 - 2008, Holger Zuleger HZnet. All rights reserved. +** This software is open source. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** +** 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. +** +** Neither the name of Holger Zuleger HZnet nor the names of its contributors may +** be used to endorse or promote products derived from this software without +** specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*****************************************************************/ + +# include +# include +# include +# include +# include +# include +# include +# include + +#ifdef HAVE_CONFIG_H +# include +#endif +# include "config_zkt.h" +#if defined(HAVE_GETOPT_LONG) && HAVE_GETOPT_LONG +# include +#endif +# include "zconf.h" +# include "debug.h" +# include "misc.h" +# include "ncparse.h" +# include "zone.h" +# include "dki.h" +# include "rollover.h" +# include "log.h" + +#if defined(BIND_VERSION) && BIND_VERSION >= 940 +# define short_options "c:L:V:D:N:o:O:dfHhnrv" +#else +# define short_options "c:L:V:D:N:o:O:fHhnrv" +#endif +#if defined(HAVE_GETOPT_LONG) && HAVE_GETOPT_LONG +static struct option long_options[] = { + {"reload", no_argument, NULL, 'r'}, + {"force", no_argument, NULL, 'f'}, + {"noexec", no_argument, NULL, 'n'}, + {"verbose", no_argument, NULL, 'v'}, + {"directory", no_argument, NULL, 'd'}, + {"config", required_argument, NULL, 'c'}, + {"option", required_argument, NULL, 'O'}, + {"config-option", required_argument, NULL, 'O'}, + {"logfile", required_argument, NULL, 'L' }, + {"view", required_argument, NULL, 'V' }, + {"directory", required_argument, NULL, 'D'}, + {"named-conf", required_argument, NULL, 'N'}, + {"origin", required_argument, NULL, 'o'}, +#if defined(BIND_VERSION) && BIND_VERSION >= 940 + {"dynamic", no_argument, NULL, 'd' }, +#endif + {"help", no_argument, NULL, 'h'}, + {0, 0, 0, 0} +}; +#endif + + +/** function declaration **/ +static void usage (char *mesg, zconf_t *conf); +static int add2zonelist (const char *dir, const char *view, const char *zone, const char *file); +static int parsedir (const char *dir, zone_t **zp, const zconf_t *conf); +static int dosigning (zone_t *zonelist, zone_t *zp); +static int check_keydb_timestamp (dki_t *keylist, time_t reftime); +static int new_keysetfiles (const char *dir, time_t zone_signing_time); +static int writekeyfile (const char *fname, const dki_t *list, int key_ttl); +static int sign_zone (const char *dir, const char *domain, const char *file, const zconf_t *conf); +static int dyn_update_freeze (const char *domain, const zconf_t *z, int freeze); +static int reload_zone (const char *domain, const zconf_t *z); +static int dist_and_reload (const zone_t *zp); +static void register_key (dki_t *listp, const zconf_t *z); +static void copy_keyset (const char *dir, const char *domain, const zconf_t *conf); + +/** global command line options **/ +extern int optopt; +extern int opterr; +extern int optind; +extern char *optarg; +const char *progname; +const char *viewname = NULL; +const char *logfile = NULL; +const char *origin = NULL; +const char *namedconf = NULL; +const char *dirname = NULL; +static int verbose = 0; +static int force = 0; +static int reloadflag = 0; +static int noexec = 0; +static int dynamic_zone = 0; /* dynamic zone ? */ +static zone_t *zonelist = NULL; /* must be static global because add2zonelist use it */ +static zconf_t *config; + +int main (int argc, char *const argv[]) +{ + int c; + int errcnt; + int opt_index; + char errstr[255+1]; + char *p; + const char *defconfname; + zone_t *zp; + + progname = *argv; + if ( (p = strrchr (progname, '/')) ) + progname = ++p; + viewname = getnameappendix (progname, "dnssec-signer"); + + defconfname = getdefconfname (viewname); + config = loadconfig ("", (zconf_t *)NULL); /* load built in config */ + if ( fileexist (defconfname) ) /* load default config file */ + config = loadconfig (defconfname, config); + if ( config == NULL ) + fatal ("Couldn't load config: Out of memory\n"); + + zonelist = NULL; + opterr = 0; +#if defined(HAVE_GETOPT_LONG) && HAVE_GETOPT_LONG + while ( (c = getopt_long (argc, argv, short_options, long_options, &opt_index)) != -1 ) +#else + while ( (c = getopt (argc, argv, short_options)) != -1 ) +#endif + { + switch ( c ) + { + case 'V': /* view name */ + viewname = optarg; + defconfname = getdefconfname (viewname); + if ( fileexist (defconfname) ) /* load default config file */ + config = loadconfig (defconfname, config); + if ( config == NULL ) + fatal ("Out of memory\n"); + break; + case 'c': /* load config from file */ + config = loadconfig (optarg, config); + if ( config == NULL ) + fatal ("Out of memory\n"); + break; + case 'O': /* load config option from commandline */ + config = loadconfig_fromstr (optarg, config); + if ( config == NULL ) + fatal ("Out of memory\n"); + break; + case 'o': + origin = optarg; + break; + case 'N': + namedconf = optarg; + break; + case 'D': + dirname = optarg; + break; + case 'L': /* error log file|directory */ + logfile = optarg; + break; + case 'f': + force++; + break; + case 'H': + case 'h': + usage (NULL, config); + break; +#if defined(BIND_VERSION) && BIND_VERSION >= 940 + case 'd': + dynamic_zone = 1; + /* dynamic zone requires a name server reload... */ + reloadflag = 0; /* ...but "rndc thaw" reloads the zone anyway */ + break; +#endif + case 'n': + noexec = 1; + break; + case 'r': + reloadflag = 1; + break; + case 'v': + verbose++; + break; + case '?': + if ( isprint (optopt) ) + snprintf (errstr, sizeof(errstr), + "Unknown option \"-%c\".\n", optopt); + else + snprintf (errstr, sizeof (errstr), + "Unknown option char \\x%x.\n", optopt); + usage (errstr, config); + break; + default: + abort(); + } + } + dbg_line(); + + /* store some of the commandline parameter in the config structure */ + setconfigpar (config, "--view", viewname); + setconfigpar (config, "-v", &verbose); + if ( logfile == NULL ) + logfile = config->logfile; + + if ( lg_open (progname, config->syslogfacility, config->sysloglevel, config->zonedir, logfile, config->loglevel) < -1 ) + fatal ("Couldn't open logfile %s in dir %s\n", logfile, config->zonedir); + +#if defined(DBG) && DBG + for ( zp = zonelist; zp; zp = zp->next ) + zone_print ("in main: ", zp); +#endif + lg_args (LG_NOTICE, argc, argv); + + if ( origin ) /* option -o ? */ + { + if ( (argc - optind) <= 0 ) /* no arguments left ? */ + zone_readdir (".", origin, NULL, &zonelist, config, dynamic_zone); + else + zone_readdir (".", origin, argv[optind], &zonelist, config, dynamic_zone); + + /* anyway, "delete" all (remaining) arguments */ + optind = argc; + + /* complain if nothing could read in */ + if ( zonelist == NULL ) + { + lg_mesg (LG_FATAL, "\"%s\": couldn't read", origin); + fatal ("Couldn't read zone \"%s\"\n", origin); + } + } + if ( namedconf ) /* option -N ? */ + { + char dir[255+1]; + + memset (dir, '\0', sizeof (dir)); + if ( config->zonedir ) + strncpy (dir, config->zonedir, sizeof(dir)); + if ( !parse_namedconf (namedconf, dir, sizeof (dir), add2zonelist) ) + fatal ("Can't read file %s as namedconf file\n", namedconf); + if ( zonelist == NULL ) + fatal ("No signed zone found in file %s\n", namedconf); + } + if ( dirname ) /* option -D ? */ + { + if ( !parsedir (dirname, &zonelist, config) ) + fatal ("Can't read directory tree %s\n", dirname); + if ( zonelist == NULL ) + fatal ("No signed zone found in directory tree %s\n", dirname); + } + + /* none of the above: read current directory tree */ + if ( zonelist == NULL ) + parsedir (config->zonedir, &zonelist, config); + + for ( zp = zonelist; zp; zp = zp->next ) + if ( in_strarr (zp->zone, &argv[optind], argc - optind) ) + { + dosigning (zonelist, zp); + verbmesg (1, zp->conf, "\n"); + } + + zone_freelist (&zonelist); + + errcnt = lg_geterrcnt (); + lg_mesg (LG_NOTICE, "end of run: %d error%s occured", errcnt, errcnt == 1 ? "" : "s"); + lg_close (); + + return errcnt < 64 ? errcnt : 64; +} + +# define sopt_usage(mesg, value) fprintf (stderr, mesg, value) +#if defined(HAVE_GETOPT_LONG) && HAVE_GETOPT_LONG +# define lopt_usage(mesg, value) fprintf (stderr, mesg, value) +# define loptstr(lstr, sstr) lstr +#else +# define lopt_usage(mesg, value) +# define loptstr(lstr, sstr) sstr +#endif +static void usage (char *mesg, zconf_t *conf) +{ + fprintf (stderr, "%s version %s\n", progname, ZKT_VERSION); + fprintf (stderr, "\n"); + + fprintf (stderr, "usage: %s [-c file] [-O optstr] ", progname); + fprintf (stderr, "[-D directorytree] "); + fprintf (stderr, "[-fhnr] [-v [-v]] [zone ...]\n"); + + fprintf (stderr, "usage: %s [-c file] [-O optstr] ", progname); + fprintf (stderr, "-N named.conf "); + fprintf (stderr, "[-fhnr] [-v [-v]] [zone ...]\n"); + + fprintf (stderr, "usage: %s [-c file] [-O optstr] ", progname); + fprintf (stderr, "-o origin "); + fprintf (stderr, "[-fhnr] [-v [-v]] [zonefile.signed]\n"); + + fprintf (stderr, "\t-c file%s", loptstr (", --config=file\n", "")); + fprintf (stderr, "\t\t read config from instead of %s\n", CONFIG_FILE); + fprintf (stderr, "\t-O optstr%s", loptstr (", --config-option=\"optstr\"\n", "")); + fprintf (stderr, "\t\t set config options on the commandline\n"); + fprintf (stderr, "\t-L file|dir%s", loptstr (", --logfile=file|dir\n", "")); + fprintf (stderr, "\t\t specify file or directory for the log output\n"); + fprintf (stderr, "\t-D dir%s", loptstr (", --directory=dir\n", "")); + fprintf (stderr, "\t\t parse the given directory tree for a list of secure zones \n"); + fprintf (stderr, "\t-N file%s", loptstr (", --named-conf=file\n", "")); + fprintf (stderr, "\t\t get the list of secure zones out of the named like config file \n"); + fprintf (stderr, "\t-o zone%s", loptstr (", --origin=zone", "")); + fprintf (stderr, "\tspecify the name of the zone \n"); + fprintf (stderr, "\t\t The file to sign should be given as an argument (default is \"%s.signed\")\n", conf->zonefile); + fprintf (stderr, "\t-h%s\t print this help\n", loptstr (", --help", "\t")); + fprintf (stderr, "\t-f%s\t force re-signing\n", loptstr (", --force", "\t")); + fprintf (stderr, "\t-n%s\t no execution of external signing command\n", loptstr (", --noexec", "\t")); + // fprintf (stderr, "\t-r%s\t reload zone via (or via the external distribution command)\n", loptstr (", --reload", "\t")); + fprintf (stderr, "\t-r%s\t reload zone via %s\n", loptstr (", --reload", "\t"), conf->dist_cmd ? conf->dist_cmd: "rndc"); + fprintf (stderr, "\t-v%s\t be verbose (use twice to be very verbose)\n", loptstr (", --verbose", "\t")); + + fprintf (stderr, "\t[zone]\t sign only those zones given as argument\n"); + + fprintf (stderr, "\n"); + fprintf (stderr, "\tif neither -D nor -N nor -o is given, the directory tree specified\n"); + fprintf (stderr, "\tin the dnssec config file (\"%s\") will be parsed\n", conf->zonedir); + + if ( mesg && *mesg ) + fprintf (stderr, "%s\n", mesg); + exit (127); +} + +/** fill zonelist with infos coming out of named.conf **/ +static int add2zonelist (const char *dir, const char *view, const char *zone, const char *file) +{ +#ifdef DBG + fprintf (stderr, "printzone "); + fprintf (stderr, "view \"%s\" " , view); + fprintf (stderr, "zone \"%s\" " , zone); + fprintf (stderr, "file "); + if ( dir && *dir ) + fprintf (stderr, "%s/", dir); + fprintf (stderr, "%s", file); + fprintf (stderr, "\n"); +#endif + dbg_line (); + if ( view[0] != '\0' ) /* view found in named.conf */ + { + if ( viewname == NULL || viewname[0] == '\0' ) /* viewname wasn't set on startup ? */ + { + dbg_line (); + error ("zone \"%s\" in view \"%s\" found in name server config, but no matching view was set on startup\n", zone, view); + lg_mesg (LG_ERROR, "\"%s\" in view \"%s\" found in name server config, but no matching view was set on startup", zone, view); + return 0; + } + dbg_line (); + if ( strcmp (viewname, view) != 0 ) /* zone is _not_ in current view */ + return 0; + } + return zone_readdir (dir, zone, file, &zonelist, config, dynamic_zone); +} + +static int parsedir (const char *dir, zone_t **zp, const zconf_t *conf) +{ + DIR *dirp; + struct dirent *dentp; + char path[MAX_PATHSIZE+1]; + + dbg_val ("parsedir: (%s)\n", dir); + if ( !is_directory (dir) ) + return 0; + + dbg_line (); + zone_readdir (dir, NULL, NULL, zp, conf, dynamic_zone); + + dbg_val ("parsedir: opendir(%s)\n", dir); + if ( (dirp = opendir (dir)) == NULL ) + return 0; + + while ( (dentp = readdir (dirp)) != NULL ) + { + if ( is_dotfile (dentp->d_name) ) + continue; + + pathname (path, sizeof (path), dir, dentp->d_name, NULL); + if ( !is_directory (path) ) + continue; + + dbg_val ("parsedir: recursive %s\n", path); + parsedir (path, zp, conf); + } + closedir (dirp); + return 1; +} + +static int dosigning (zone_t *zonelist, zone_t *zp) +{ + char path[MAX_PATHSIZE+1]; + int err; + int newkey; + int newkeysetfile; + int use_unixtime; + time_t currtime; + time_t zfile_time; + time_t zfilesig_time; + char mesg[255+1]; + + verbmesg (1, zp->conf, "parsing zone \"%s\" in dir \"%s\"\n", zp->zone, zp->dir); + + pathname (path, sizeof (path), zp->dir, zp->sfile, NULL); + dbg_val("parsezonedir fileexist (%s)\n", path); + if ( !fileexist (path) ) + { + error ("Not a secure zone directory (%s)!\n", zp->dir); + lg_mesg (LG_ERROR, "\"%s\": not a secure zone directory (%s)!", zp->zone, zp->dir); + return 1; + } + zfilesig_time = file_mtime (path); + + pathname (path, sizeof (path), zp->dir, zp->file, NULL); + dbg_val("parsezonedir fileexist (%s)\n", path); + if ( !fileexist (path) ) + { + error ("No zone file found (%s)!\n", path); + lg_mesg (LG_ERROR, "\"%s\": no zone file found (%s)!", zp->zone, path); + return 2; + } + + zfile_time = file_mtime (path); + currtime = time (NULL); + + /* check rfc5011 key signing keys, create new one if neccessary */ + dbg_msg("parsezonedir check rfc 5011 ksk "); + newkey = ksk5011status (&zp->keys, zp->dir, zp->zone, zp->conf); + if ( (newkey & 02) != 02 ) /* not a rfc 5011 zone ? */ + { + verbmesg (2, zp->conf, "\t\t->not a rfc5011 zone, looking for a regular ksk rollover\n"); + /* check key signing keys, create new one if neccessary */ + dbg_msg("parsezonedir check ksk "); + newkey |= kskstatus (zonelist, zp); + } + else + newkey &= ~02; /* reset bit 2 */ + + /* check age of zone keys, probably retire (depreciate) or remove old keys */ + dbg_msg("parsezonedir check zsk "); + newkey += zskstatus (&zp->keys, zp->dir, zp->zone, zp->conf); + + /* check age of "dnskey.db" file against age of keyfiles */ + pathname (path, sizeof (path), zp->dir, zp->conf->keyfile, NULL); + dbg_val("parsezonedir check_keydb_timestamp (%s)\n", path); + if ( !newkey ) + newkey = check_keydb_timestamp (zp->keys, file_mtime (path)); + + /* if we work in subdir mode, check if there is a new keyset- file */ + newkeysetfile = 0; + if ( !newkey && zp->conf->keysetdir && strcmp (zp->conf->keysetdir, "..") == 0 ) + newkeysetfile = new_keysetfiles (zp->dir, zfilesig_time); + + /** + ** Check if it is time to do a re-sign. This is the case if + ** a) the command line flag -f is set, or + ** b) new keys are generated, or + ** c) we found a new KSK of a delegated domain, or + ** d) the "dnskey.db" file is newer than "zone.db" + ** e) the "zone.db" is newer than "zone.db.signed" or + ** f) "zone.db.signed" is older than the re-sign interval + **/ + mesg[0] = '\0'; + if ( force ) + snprintf (mesg, sizeof(mesg), "Option -f"); + else if ( newkey ) + snprintf (mesg, sizeof(mesg), "New zone key"); + else if ( newkeysetfile ) + snprintf (mesg, sizeof(mesg), "Modified KSK in delegated domain"); + else if ( file_mtime (path) > zfilesig_time ) + snprintf (mesg, sizeof(mesg), "Modified keys"); + else if ( zfile_time > zfilesig_time ) + snprintf (mesg, sizeof(mesg), "Zone file edited"); + else if ( (currtime - zfilesig_time) > zp->conf->resign - (OFFSET) ) + snprintf (mesg, sizeof(mesg), "re-signing interval (%s) reached", + str_delspace (age2str (zp->conf->resign))); + else if ( dynamic_zone ) + snprintf (mesg, sizeof(mesg), "dynamic zone"); + + if ( *mesg ) + verbmesg (1, zp->conf, "\tRe-signing necessary: %s\n", mesg); + else + verbmesg (1, zp->conf, "\tRe-signing not necessary!\n"); + + if ( *mesg ) + lg_mesg (LG_NOTICE, "\"%s\": re-signing triggered: %s", zp->zone, mesg); + + dbg_line (); + if ( !(force || newkey || newkeysetfile || zfile_time > zfilesig_time || + file_mtime (path) > zfilesig_time || + (currtime - zfilesig_time) > zp->conf->resign - (OFFSET) || dynamic_zone) ) + { + verbmesg (2, zp->conf, "\tCheck if there is a parent file to copy\n"); + if ( zp->conf->keysetdir && strcmp (zp->conf->keysetdir, "..") == 0 ) + copy_keyset (zp->dir, zp->zone, zp->conf); /* copy the parent- file if it exist */ + return 0; /* nothing to do */ + } + + /* let's start signing the zone */ + dbg_line (); + + /* create new "dnskey.db" file */ + pathname (path, sizeof (path), zp->dir, zp->conf->keyfile, NULL); + verbmesg (1, zp->conf, "\tWriting key file \"%s\"\n", path); + if ( !writekeyfile (path, zp->keys, zp->conf->key_ttl) ) + { + error ("Can't create keyfile %s \n", path); + lg_mesg (LG_ERROR, "\"%s\": can't create keyfile %s", zp->zone , path); + } + + err = 1; + use_unixtime = ( zp->conf->serialform == Unixtime ); + dbg_val1 ("Use unixtime = %d\n", use_unixtime); +#if defined(BIND_VERSION) && BIND_VERSION >= 940 + if ( !dynamic_zone && !use_unixtime ) /* increment serial no in static zone files */ +#else + if ( !dynamic_zone ) /* increment serial no in static zone files */ +#endif + { + pathname (path, sizeof (path), zp->dir, zp->file, NULL); + err = 0; + if ( noexec == 0 ) + { + if ( (err = inc_serial (path, use_unixtime)) < 0 ) + { + error ("could not increment serialno of domain %s in file %s: %s!\n", + zp->zone, path, inc_errstr (err)); + lg_mesg (LG_ERROR, + "zone \"%s\": couldn't increment serialno in file %s: %s", + zp->zone, path, inc_errstr (err)); + } + else + verbmesg (1, zp->conf, "\tIncrementing serial number in file \"%s\"\n", path); + } + else + verbmesg (1, zp->conf, "\tIncrementing serial number in file \"%s\"\n", path); + } + + /* at last, sign the zone file */ + if ( err > 0 ) + { + time_t timer; + + verbmesg (1, zp->conf, "\tSigning zone \"%s\"\n", zp->zone); + logflush (); + + /* dynamic zones uses incremental signing, so we have to */ + /* prepare the old (signed) file as new input file */ + if ( dynamic_zone ) + { + char zfile[MAX_PATHSIZE+1]; + + dyn_update_freeze (zp->zone, zp->conf, 1); /* freeze dynamic zone ! */ + + pathname (zfile, sizeof (zfile), zp->dir, zp->file, NULL); + pathname (path, sizeof (path), zp->dir, zp->sfile, NULL); + if ( filesize (path) == 0L ) /* initial signing request */ + { + verbmesg (1, zp->conf, "\tDynamic Zone signing: Initial signing request: Add DNSKEYs to zonefile\n"); + copyfile (zfile, path, zp->conf->keyfile); + } + verbmesg (1, zp->conf, "\tDynamic Zone signing: copy old signed zone file %s to new input file %s\n", + path, zfile); + if ( newkey ) /* if we have new keys, they should be added to the zone file */ + copyzonefile (path, zfile, zp->conf->keyfile); + else /* else we can do a simple file copy */ + copyfile (path, zfile, NULL); + } + + timer = start_timer (); + if ( (err = sign_zone (zp->dir, zp->zone, zp->file, zp->conf)) < 0 ) + { + error ("Signing of zone %s failed (%d)!\n", zp->zone, err); + lg_mesg (LG_ERROR, "\"%s\": signing failed!", zp->zone); + } + timer = stop_timer (timer); + + if ( dynamic_zone ) + dyn_update_freeze (zp->zone, zp->conf, 0); /* thaw dynamic zone file */ + + { + const char *tstr = str_delspace (age2str (timer)); + + if ( !tstr || *tstr == '\0' ) + tstr = "0s"; + verbmesg (1, zp->conf, "\tSigning completed after %s.\n", tstr); + } + } + + copy_keyset (zp->dir, zp->zone, zp->conf); + + if ( err >= 0 && reloadflag ) + { + if ( zp->conf->dist_cmd ) + dist_and_reload (zp); + else + reload_zone (zp->zone, zp->conf); + + register_key (zp->keys, zp->conf); + } + + return err; +} + +static void register_key (dki_t *list, const zconf_t *z) +{ + dki_t *dkp; + time_t currtime; + time_t age; + + assert ( list != NULL ); + assert ( z != NULL ); + + currtime = time (NULL); + for ( dkp = list; dkp && dki_isksk (dkp); dkp = dkp->next ) + { + age = dki_age (dkp, currtime); +#if 0 + /* announce "new" and active key signing keys */ + if ( REG_URL && *REG_URL && dki_status (dkp) == DKI_ACT && age <= z->resign * 4 ) + { + if ( verbose ) + logmesg ("\tRegister new KSK with tag %d for domain %s\n", + dkp->tag, dkp->name); + } +#endif + } +} + +/* + * This function is not working with symbolic links to keyset- files, + * because file_mtime() returns the mtime of the underlying file, and *not* + * that of the symlink file. + * This is bad, because the keyset-file will be newly generated by dnssec-signzone + * on every re-signing call. + * Instead, in the case of a hierarchical directory structure, we copy the file + * (and so we change the timestamp) only if it was modified after the last + * generation (checked with cmpfile(), see func sign_zone()). + */ +# define KEYSET_FILE_PFX "keyset-" +static int new_keysetfiles (const char *dir, time_t zone_signing_time) +{ + DIR *dirp; + struct dirent *dentp; + char path[MAX_PATHSIZE+1]; + int newkeysetfile; + + if ( (dirp = opendir (dir)) == NULL ) + return 0; + + newkeysetfile = 0; + dbg_val2 ("new_keysetfile (%s, %s)\n", dir, time2str (zone_signing_time, 's')); + while ( !newkeysetfile && (dentp = readdir (dirp)) != NULL ) + { + if ( strncmp (dentp->d_name, KEYSET_FILE_PFX, strlen (KEYSET_FILE_PFX)) != 0 ) + continue; + + pathname (path, sizeof (path), dir, dentp->d_name, NULL); + dbg_val2 ("newkeysetfile timestamp of %s = %s\n", path, time2str (file_mtime(path), 's')); + if ( file_mtime (path) > zone_signing_time ) + newkeysetfile = 1; + } + closedir (dirp); + + return newkeysetfile; +} + +static int check_keydb_timestamp (dki_t *keylist, time_t reftime) +{ + dki_t *key; + + assert ( keylist != NULL ); + if ( reftime == 0 ) + return 1; + + for ( key = keylist; key; key = key->next ) + if ( dki_time (key) > reftime ) + return 1; + + return 0; +} + +static int writekeyfile (const char *fname, const dki_t *list, int key_ttl) +{ + FILE *fp; + const dki_t *dkp; + time_t curr = time (NULL); + int ksk; + + if ( (fp = fopen (fname, "w")) == NULL ) + return 0; + fprintf (fp, ";\n"); + fprintf (fp, ";\t!!! Don\'t edit this file by hand.\n"); + fprintf (fp, ";\t!!! It will be generated by %s.\n", progname); + fprintf (fp, ";\n"); + fprintf (fp, ";\t Last generation time %s\n", time2str (curr, 's')); + fprintf (fp, ";\n"); + + fprintf (fp, "\n"); + fprintf (fp, "; *** List of Key Signing Keys ***\n"); + ksk = 1; + for ( dkp = list; dkp; dkp = dkp->next ) + { + if ( ksk && !dki_isksk (dkp) ) + { + fprintf (fp, "; *** List of Zone Signing Keys ***\n"); + ksk = 0; + } + dki_prt_comment (dkp, fp); + dki_prt_dnskeyttl (dkp, fp, key_ttl); + putc ('\n', fp); + } + + fclose (fp); + return 1; +} + +static int sign_zone (const char *dir, const char *domain, const char *file, const zconf_t *conf) +{ + char cmd[1023+1]; + char str[1023+1]; + char rparam[254+1]; + char keysetdir[254+1]; + const char *gends; + const char *pseudo; + const char *param; + int len; + FILE *fp; + + assert (conf != NULL); + assert (domain != NULL); + + len = 0; + str[0] = '\0'; + if ( conf->lookaside && conf->lookaside[0] ) + len = snprintf (str, sizeof (str), "-l %.250s", conf->lookaside); + + dbg_line(); +#if defined(BIND_VERSION) && BIND_VERSION >= 940 + if ( !dynamic_zone && conf->serialform == Unixtime ) + snprintf (str+len, sizeof (str) - len, " -N unixtime"); +#endif + + gends = ""; + if ( conf->sig_gends ) + gends = "-g "; + + pseudo = ""; + if ( conf->sig_pseudo ) + pseudo = "-p "; + + param = ""; + if ( conf->sig_param && conf->sig_param[0] ) + param = conf->sig_param; + + dbg_line(); + rparam[0] = '\0'; + if ( conf->sig_random && conf->sig_random[0] ) + snprintf (rparam, sizeof (rparam), "-r %.250s ", conf->sig_random); + + dbg_line(); + keysetdir[0] = '\0'; + if ( conf->keysetdir && conf->keysetdir[0] && strcmp (conf->keysetdir, "..") != 0 ) + snprintf (keysetdir, sizeof (keysetdir), "-d %.250s ", conf->keysetdir); + + if ( dir == NULL || *dir == '\0' ) + dir = "."; + + dbg_line(); +#if defined(BIND_VERSION) && BIND_VERSION >= 940 + if ( dynamic_zone ) + snprintf (cmd, sizeof (cmd), "cd %s; %s %s %s%s%s%s-o %s -e +%d %s -N increment -f %s.dsigned %s K*.private", + dir, SIGNCMD, param, gends, pseudo, rparam, keysetdir, domain, conf->sigvalidity, str, file, file); + else +#endif + snprintf (cmd, sizeof (cmd), "cd %s; %s %s %s%s%s%s-o %s -e +%d %s %s K*.private", + dir, SIGNCMD, param, gends, pseudo, rparam, keysetdir, domain, conf->sigvalidity, str, file); + verbmesg (2, conf, "\t Run cmd \"%s\"\n", cmd); + *str = '\0'; + if ( noexec == 0 ) + { + if ( (fp = popen (cmd, "r")) == NULL || fgets (str, sizeof str, fp) == NULL ) + return -1; + pclose (fp); + } + + dbg_line(); + verbmesg (2, conf, "\t Cmd dnssec-signzone return: \"%s\"\n", str_chop (str, '\n')); + + return 0; +} + +static void copy_keyset (const char *dir, const char *domain, const zconf_t *conf) +{ + char fromfile[1024]; + char tofile[1024]; + int ret; + + /* propagate "keyset"-file to parent dir */ + if ( conf->keysetdir && strcmp (conf->keysetdir, "..") == 0 ) + { + /* check if special parent-file exist (ksk rollover) */ + snprintf (fromfile, sizeof (fromfile), "%s/parent-%s", dir, domain); + if ( !fileexist (fromfile) ) /* use "normal" keyset-file */ + snprintf (fromfile, sizeof (fromfile), "%s/keyset-%s", dir, domain); + + /* verbmesg (2, conf, "\t check \"%s\" against parent dir\n", fromfile); */ + snprintf (tofile, sizeof (tofile), "%s/../keyset-%s", dir, domain); + if ( cmpfile (fromfile, tofile) != 0 ) + { + verbmesg (2, conf, "\t copy \"%s\" to parent dir\n", fromfile); + if ( (ret = copyfile (fromfile, tofile, NULL)) != 0 ) + { + error ("Couldn't copy \"%s\" to parent dir (%d:%s)\n", + fromfile, ret, strerror(errno)); + lg_mesg (LG_ERROR, "\%s\": can't copy \"%s\" to parent dir (%d:%s)", + domain, fromfile, ret, strerror(errno)); + } + } + } +} + +static int dyn_update_freeze (const char *domain, const zconf_t *z, int freeze) +{ + char cmdline[254+1]; + char str[254+1]; + char *action; + FILE *fp; + + assert (z != NULL); + if ( freeze ) + action = "freeze"; + else + action = "thaw"; + + if ( z->view ) + snprintf (str, sizeof (str), "\"%s\" in view \"%s\"", domain, z->view); + else + snprintf (str, sizeof (str), "\"%s\"", domain); + + lg_mesg (LG_NOTICE, "%s: %s dynamic zone", str, action); + verbmesg (1, z, "\t%s dynamic zone %s\n", action, str); + + if ( z->view ) + snprintf (cmdline, sizeof (cmdline), "%s %s %s IN %s", RELOADCMD, action, domain, z->view); + else + snprintf (cmdline, sizeof (cmdline), "%s %s %s", RELOADCMD, action, domain); + + verbmesg (2, z, "\t Run cmd \"%s\"\n", cmdline); + *str = '\0'; + if ( noexec == 0 ) + { + if ( (fp = popen (cmdline, "r")) == NULL || fgets (str, sizeof str, fp) == NULL ) + return -1; + pclose (fp); + } + + verbmesg (2, z, "\t rndc %s return: \"%s\"\n", action, str_chop (str, '\n')); + + return 0; +} + +/***************************************************************** +** distribute and reload a zone via "distribute_command" +*****************************************************************/ +static int dist_and_reload (const zone_t *zp) +{ + char path[MAX_PATHSIZE+1]; + char cmdline[254+1]; + char zone[254+1]; + char str[254+1]; + FILE *fp; + + assert (zp != NULL); + assert (zp->conf->dist_cmd != NULL); + + if ( !is_exec_ok (zp->conf->dist_cmd) ) + { + char *mesg; + + if ( getuid () == 0 ) + mesg = "\tDistribution command %s not run as root\n"; + else + mesg = "\tDistribution command %s not run due to strange file mode settings\n"; + + verbmesg (1, zp->conf, mesg, zp->conf->dist_cmd); + lg_mesg (LG_ERROR, "exec of distribution command %s disabled due to security reasons", zp->conf->dist_cmd); + + return -1; + } + + if ( zp->conf->view ) + snprintf (zone, sizeof (zone), "\"%s\" in view \"%s\"", zp->zone, zp->conf->view); + else + snprintf (zone, sizeof (zone), "\"%s\"", zp->zone); + + + pathname (path, sizeof (path), zp->dir, zp->sfile, NULL); + + lg_mesg (LG_NOTICE, "%s: distribution triggered", zone); + verbmesg (1, zp->conf, "\tDistribute zone %s\n", zone); + if ( zp->conf->view ) + snprintf (cmdline, sizeof (cmdline), "%s distribute %s %s %s", zp->conf->dist_cmd, zp->zone, path, zp->conf->view); + else + snprintf (cmdline, sizeof (cmdline), "%s distribute %s %s", zp->conf->dist_cmd, zp->zone, path); + + *str = '\0'; + if ( noexec == 0 ) + { + verbmesg (2, zp->conf, "\t Run cmd \"%s\"\n", cmdline); + if ( (fp = popen (cmdline, "r")) == NULL || fgets (str, sizeof str, fp) == NULL ) + return -2; + pclose (fp); + verbmesg (2, zp->conf, "\t %s distribute return: \"%s\"\n", zp->conf->dist_cmd, str_chop (str, '\n')); + } + + + lg_mesg (LG_NOTICE, "%s: reload triggered", zone); + verbmesg (1, zp->conf, "\tReload zone %s\n", zone); + if ( zp->conf->view ) + snprintf (cmdline, sizeof (cmdline), "%s reload %s %s %s", zp->conf->dist_cmd, zp->zone, path, zp->conf->view); + else + snprintf (cmdline, sizeof (cmdline), "%s reload %s %s", zp->conf->dist_cmd, zp->zone, path); + + *str = '\0'; + if ( noexec == 0 ) + { + verbmesg (2, zp->conf, "\t Run cmd \"%s\"\n", cmdline); + if ( (fp = popen (cmdline, "r")) == NULL || fgets (str, sizeof str, fp) == NULL ) + return -2; + pclose (fp); + verbmesg (2, zp->conf, "\t %s reload return: \"%s\"\n", zp->conf->dist_cmd, str_chop (str, '\n')); + } + + return 0; +} + +/***************************************************************** +** reload a zone via "rndc" +*****************************************************************/ +static int reload_zone (const char *domain, const zconf_t *z) +{ + char cmdline[254+1]; + char str[254+1]; + FILE *fp; + + assert (z != NULL); + // fprintf (stderr, "reload_zone %d :%s: :%s:\n", z->verbosity, domain, z->view); + if ( z->view ) + snprintf (str, sizeof (str), "\"%s\" in view \"%s\"", domain, z->view); + else + snprintf (str, sizeof (str), "\"%s\"", domain); + + lg_mesg (LG_NOTICE, "%s: reload triggered", str); + verbmesg (1, z, "\tReload zone %s\n", str); + + if ( z->view ) + snprintf (cmdline, sizeof (cmdline), "%s reload %s IN %s", RELOADCMD, domain, z->view); + else + snprintf (cmdline, sizeof (cmdline), "%s reload %s", RELOADCMD, domain); + + *str = '\0'; + if ( noexec == 0 ) + { + verbmesg (2, z, "\t Run cmd \"%s\"\n", cmdline); + if ( (fp = popen (cmdline, "r")) == NULL || fgets (str, sizeof str, fp) == NULL ) + return -1; + pclose (fp); + verbmesg (2, z, "\t rndc reload return: \"%s\"\n", str_chop (str, '\n')); + } + + return 0; +} diff --git a/contrib/zkt/dnssec-zkt.8 b/contrib/zkt/dnssec-zkt.8 new file mode 100644 index 0000000..b53f8bb --- /dev/null +++ b/contrib/zkt/dnssec-zkt.8 @@ -0,0 +1,481 @@ +.TH dnssec-zkt 8 "July 27, 2008" "ZKT 0.97" "" +\" turn off hyphenation +.\" if n .nh +.nh +.SH NAME +dnssec-zkt \(em Secure DNS zone key tool + +.SH SYNOPSYS +.na +.B dnssec-zkt +.RB [ \-V|--view +.IR "view" ] +.RB [ \-c +.IR "file" ] +.RB [ \-l +.IR "list" ] +.RB [ \-adefhkLrptz ] +.RI [{ keyfile | dir } +.RI "" ... ] + +.B dnssec-zkt +.BR \-C