summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/cf
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/heimdal/cf/ChangeLog1295
-rw-r--r--third_party/heimdal/cf/Makefile.am.common294
-rw-r--r--third_party/heimdal/cf/aix.m462
-rw-r--r--third_party/heimdal/cf/auth-modules.m445
-rw-r--r--third_party/heimdal/cf/ax_check_sign.m454
-rw-r--r--third_party/heimdal/cf/broken-getaddrinfo.m426
-rw-r--r--third_party/heimdal/cf/broken-realloc.m425
-rw-r--r--third_party/heimdal/cf/broken-snprintf.m463
-rw-r--r--third_party/heimdal/cf/broken.m412
-rw-r--r--third_party/heimdal/cf/broken2.m425
-rw-r--r--third_party/heimdal/cf/c-attribute.m428
-rw-r--r--third_party/heimdal/cf/c-function.m433
-rw-r--r--third_party/heimdal/cf/check-compile-et.m4114
-rw-r--r--third_party/heimdal/cf/check-compile-flag.m453
-rw-r--r--third_party/heimdal/cf/check-getpwnam_r-posix.m474
-rw-r--r--third_party/heimdal/cf/check-man.m457
-rw-r--r--third_party/heimdal/cf/check-netinet-ip-and-tcp.m433
-rw-r--r--third_party/heimdal/cf/check-type-extra.m423
-rw-r--r--third_party/heimdal/cf/check-var.m428
-rw-r--r--third_party/heimdal/cf/crypto.m4166
-rw-r--r--third_party/heimdal/cf/db.m4268
-rw-r--r--third_party/heimdal/cf/destdirs.m418
-rw-r--r--third_party/heimdal/cf/dispatch.m423
-rw-r--r--third_party/heimdal/cf/dlopen.m419
-rw-r--r--third_party/heimdal/cf/find-func-no-libs.m49
-rw-r--r--third_party/heimdal/cf/find-func-no-libs2.m462
-rw-r--r--third_party/heimdal/cf/find-func.m49
-rw-r--r--third_party/heimdal/cf/find-if-not-broken.m412
-rw-r--r--third_party/heimdal/cf/framework-corefoundation.m428
-rw-r--r--third_party/heimdal/cf/framework-security.m431
-rw-r--r--third_party/heimdal/cf/have-pragma-weak.m437
-rw-r--r--third_party/heimdal/cf/have-struct-field.m421
-rw-r--r--third_party/heimdal/cf/have-type.m430
-rw-r--r--third_party/heimdal/cf/have-types.m412
-rw-r--r--third_party/heimdal/cf/install-catman.sh74
-rw-r--r--third_party/heimdal/cf/irix.m415
-rw-r--r--third_party/heimdal/cf/krb-bigendian.m462
-rw-r--r--third_party/heimdal/cf/krb-func-getlogin.m432
-rw-r--r--third_party/heimdal/cf/krb-ipv6.m4154
-rw-r--r--third_party/heimdal/cf/krb-prog-ln-s.m428
-rw-r--r--third_party/heimdal/cf/krb-prog-perl.m421
-rw-r--r--third_party/heimdal/cf/krb-prog-ranlib.m48
-rw-r--r--third_party/heimdal/cf/krb-prog-yacc.m418
-rw-r--r--third_party/heimdal/cf/krb-readline.m428
-rw-r--r--third_party/heimdal/cf/krb-struct-spwd.m421
-rw-r--r--third_party/heimdal/cf/krb-struct-winsize.m425
-rw-r--r--third_party/heimdal/cf/krb-sys-aix.m415
-rw-r--r--third_party/heimdal/cf/krb-sys-nextstep.m418
-rw-r--r--third_party/heimdal/cf/largefile.m416
-rw-r--r--third_party/heimdal/cf/make-proto.pl528
-rwxr-xr-xthird_party/heimdal/cf/maybe-valgrind.sh68
-rw-r--r--third_party/heimdal/cf/mips-abi.m487
-rw-r--r--third_party/heimdal/cf/misc.m415
-rw-r--r--third_party/heimdal/cf/need-proto.m422
-rw-r--r--third_party/heimdal/cf/osfc2.m414
-rw-r--r--third_party/heimdal/cf/otp.m427
-rw-r--r--third_party/heimdal/cf/pkg.m4157
-rw-r--r--third_party/heimdal/cf/proto-compat.m421
-rw-r--r--third_party/heimdal/cf/pthreads.m4117
-rw-r--r--third_party/heimdal/cf/resolv.m4118
-rw-r--r--third_party/heimdal/cf/retsigtype.m418
-rw-r--r--third_party/heimdal/cf/roken-frag.m4766
-rw-r--r--third_party/heimdal/cf/roken-h-process.pl184
-rw-r--r--third_party/heimdal/cf/roken.m464
-rw-r--r--third_party/heimdal/cf/socket-wrapper.m416
-rw-r--r--third_party/heimdal/cf/sunos.m429
-rw-r--r--third_party/heimdal/cf/symbol-version.py85
-rw-r--r--third_party/heimdal/cf/telnet.m475
-rw-r--r--third_party/heimdal/cf/test-package.m4135
-rw-r--r--third_party/heimdal/cf/valgrind-suppressions168
-rw-r--r--third_party/heimdal/cf/vararray.m416
-rw-r--r--third_party/heimdal/cf/version-script.m439
-rw-r--r--third_party/heimdal/cf/w32-check-exported-symbols.pl129
-rw-r--r--third_party/heimdal/cf/w32-def-from-dll.pl212
-rw-r--r--third_party/heimdal/cf/w32-detect-vc-version.pl49
-rw-r--r--third_party/heimdal/cf/w32-hh-toc-from-info.pl124
-rw-r--r--third_party/heimdal/cf/w32-list-externs-from-objs.pl114
-rw-r--r--third_party/heimdal/cf/wflags.m433
-rw-r--r--third_party/heimdal/cf/win32.m416
-rw-r--r--third_party/heimdal/cf/with-all.m442
80 files changed, 7112 insertions, 0 deletions
diff --git a/third_party/heimdal/cf/ChangeLog b/third_party/heimdal/cf/ChangeLog
new file mode 100644
index 0000000..8bd0b3e
--- /dev/null
+++ b/third_party/heimdal/cf/ChangeLog
@@ -0,0 +1,1295 @@
+2008-07-26 Love Hörnquist Åstrand <lha@h5l.org>
+
+ * krb-ipv6.m4: Patch from Björn Schlögl to enable disable-ness of
+ ipv6.
+
+2008-05-20 Love Hörnquist Åstrand <lha@kth.se>
+
+ * sunos.m4: Detect solaris2.11 and later and assume its sunos=58.
+ Bug report from Klas Heggemann.
+
+2008-05-05 Love Hörnquist Åstrand <lha@kth.se>
+
+ * version-script.m4: Add -rpath to avoid building a convince
+ library, also sprinkle some other options to make the link line
+ more like automake's.
+
+2008-04-29 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * version-script.m4: use libtool to probe for version script to
+ make it work on amd64/ia64 where -fpic in needed to build shared
+ objects.
+
+2008-04-24 Björn Sandell <biorn@chalmers.se>
+
+ * pthreads.m4: macros for OpenBSD
+
+2008-04-17 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * make-proto.pl: Define both export variables.
+
+ * win32.m4: Export _FUNCTION and _VARIABLE for _win32 magic
+
+ * krb-ipv6.m4: Rename cache variable to AC_CACHE_CHECK to make the
+ cached.
+
+ * win32.m4: replace _export with __declspec(dllexport)
+
+ * make-proto.pl: Add __declspec(dllimport) to the exported
+ functions.
+
+2008-04-07 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * wflags.m4: Add -Wstrict-overflow=5 as an example.
+
+2008-03-25 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * install-catman.sh: Match man_MANS = files with directories in
+ them.
+
+2008-02-23 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * make-proto.pl: Handle c-comments.
+
+ * Makefile.am.common: Make DEFAULT_INCLUDES work better, avoid
+ picking up the wrong headerfiles. $(top_builddir)/include vs
+ ${builddir}.
+
+2008-01-21 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: remove the check-symbols check
+
+ * check-symbols.sh: removed, use version script instead
+
+2007-10-01 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: openssl might require -ldl too, so lets check that.
+
+2007-07-31 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common (check-local::): exit on failure to perform
+ test.
+
+2007-07-28 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common (check-local): also check that --help works.
+
+2007-07-17 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: depend on EVP_CIPHER_iv_length
+
+2007-06-27 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: Need absolute reference to the top source
+ directory and top build directory.
+
+2007-06-20 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * wflags.m4: Add --enable-developer and make it cause -Werror to
+ be included.
+
+2007-06-18 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: Merge from samba config.
+
+ * Makefile.am.common (makedir-in-tree): depend on INFO_DEPS.
+
+ * valgrind-suppressions: Unknown suppression in runtime link
+ editor
+
+2007-06-08 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: Add heimdal-lorikeet target distdir-in-tree
+
+2007-06-04 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * framework-security.m4: test for -framework Security
+
+2007-05-10 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: we have a fnmatch.h only if there is a working
+ implementation and a header file. If we do use roken, lets use our
+ own headerfile that does symbol renaming.
+
+2007-04-19 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * version-script.m4: check if ld supports --version-script
+
+2007-04-11 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: drop broken-getnameinfo.m4
+
+ * roken-frag.m4: drop test for broken getnameinfo, that old aix is
+ no longer relevant.
+
+2007-02-16 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * install-catman.sh: Stop overwriting cmd.
+
+2007-01-15 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * install-catman.sh: Use test instead of [.
+
+ * install-catman.sh: Use = instead of ==, make solaris more happy.
+
+2007-01-08 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: More headerfiles for iruserok prototype check.
+
+ * check-symbols.sh: Add fc_softc for AIX as ignore syms.
+
+2007-01-04 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Check if iruserok needs a prototype.
+
+2006-12-06 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-compile-et.m4: set automake symbol COM_ERR when we build
+ local com_err
+
+2006-11-16 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * valgrind-suppressions: We shouldn't be running /bin/ls under
+ valgrind, but for now, at least make it easier to see any other
+ warnings. From Andrew Bartlett.
+
+2006-10-22 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: Add target for valgrind debugging
+
+ * valgrind-suppressions: valgrind suppressions
+
+2006-10-21 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-lex.m4: Borrow test for autoconf cvs to help hpux hosts
+
+2006-10-20 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: provide uninstall hook for cat/manpages.
+
+ * install-catman.sh: provide uninstall command
+
+2006-10-19 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Add check for timegm.
+
+ * roken-frag.m4: Include sys/types.h for sys/socket.h and netdb.h.
+
+2006-10-07 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common (install-build-headers): make this function
+ convoluted and deal with dist_, nodist, nobase and all its
+ friends.
+
+ * have-struct-field.m4: memset the structure to make sure that we
+ don't get compiler warnings.
+
+ * crypto.m4: OpenSSL_add_all_algorithms is not a openssl specific
+ requirement, hcrypto need to have to too.
+
+ * crypto.m4: Require openssl have OpenSSL_add_all_algorithms
+
+2006-10-04 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * autobuild.m4: Add autobuild, GPLed, but free to use in projects
+ not avaible under GPL or LGPL (just like autoconf).
+
+2006-09-16 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Add samba_SOCKET_WRAPPER fragment
+
+2006-09-12 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * socket-wrapper.m4: Add socket-wrapper test
+
+2006-05-06 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: Move up evp.h to please OpenSSL, from Douglas
+ E. Engert.
+
+2006-04-22 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Add check for fnmatch.h, its needed to be done
+ for the automake conditional below.
+
+2006-04-15 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: Require SHA256
+
+2006-01-18 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4 Check for <openssl/engine.h> if we are to consider
+ using OpenSSL, also check for <hcrypto/...> headers since
+ make_crypto.c assumes that the name of the files.
+
+2006-01-13 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: libdes is renamed to hcrypto
+
+ * crypto.m4: Remove support for old hash names.
+
+2005-10-26 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * install-catman.sh: Add variable INSTALL_CATPAGES that controls
+ if cat pages are installed, defaults to true. From Johnny Lam
+ <jlam@pkgsrc.org>.
+
+2005-09-28 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Check for <stdint.h> and uintptr_t
+
+2005-09-02 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Resolver check moved to rk_RESOLV, from Andrew
+ Bartlet <abartlet@samba.org>
+
+ * resolv.m4: Resolver checks, broken out so samba can use it From
+ Andrew Bartlet <abartlet@samba.org>
+
+2005-08-22 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: Check for res_ndestroy.
+
+2005-08-03 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: Add <sys/types.h>, OpenSSL 0.9.8 needs it for size_t.
+ From: Quanah Gibson-Mount <quanah@stanford.edu>
+
+2005-07-12 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-compile-et.m4: check that initialize_conf_error_table_r
+ have the right argument
+
+2005-07-07 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: allow symbols to start with ., aix uses this
+
+2005-06-16 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * krb-bigendian.m4: use ansi c prototypes
+
+ * krb-func-getcwd-broken.m4: use ansi c prototypes
+
+ * broken-snprintf.m4: use ansi c prototypes
+
+ * have-pragma-weak.m4: use ansi c declarations
+
+ * check-getpwnam_r-posix.m4: use ansi c declarations
+
+ * broken-realloc.m4: use ansi c declarations
+
+ * check-compile-et.m4: use ansi c declarations
+
+ * dlopen.m4: add headers and argument to dlopen
+
+ * c-function.m4: use ansi c declarations
+
+ * check-var.m4: use ansi c declarations
+
+ * pthreads.m4: disable threads on aix because of utmp/utmpx
+ problems
+
+ * broken-getaddrinfo.m4: check for brokenness in getaddrinfo on
+ AIX that can't handle "0" as port number.
+
+2005-06-11 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * db.m4: Add an option to disable ndbm, from Stefan Metzmacher
+ <metze@samba.org>
+
+2005-06-03 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * pthreads.m4: rework how pthreads support to turned on/off,
+ always run though the switch to figure out what the
+ linker/compiler flag are
+
+2005-06-01 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * pthreads.m4: s/else if/elif/
+
+ * check-symbols.sh: AIX have a diffrent nm, use -B to get bsd like
+ output
+
+ * pthreads.m4: aix case: assume gcc handles -pthread, in the
+ non-gcc case, use the compiler as hint (xlc vs xlc_r) if this
+ environment handles threads or not
+
+2005-05-22 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: ignore weak symbols too
+
+2005-05-19 David Love <fx@gnu.org>
+
+ * check-getpwnam_r-posix.m4: define _POSIX_PTHREAD_SEMANTICS to
+ make solaris provide the right getpwname_r
+
+2005-05-17 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: am_conditional have_cgetent
+
+2005-05-10 David Love <fx@gnu.org>
+
+ * roken-frag.m4: Get daemon declared on Solaris (it's in unistd.h
+ but masked by a feature test), just to avoid a warning, since it
+ has int args.
+
+2005-05-11 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-var.m4: AC_CHECK_DECL and AC_CHECK_DECLS have a subtile
+ diffrence, the later defines HAVE_ cpp symbols, the first doesn't.
+
+2005-05-05 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: ignore N symbols too
+
+2005-04-30 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * broken-snprintf.m4: include checking if snprintf(NULL, 0, "")
+ works
+
+ * check-compile-et.m4: require compile_et to generate a
+ initialize_FOO_error_table_r (they are used in libkrb5), and
+ always check for initialize_error_table_r
+
+2005-04-29 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: add LIB_com_err
+
+2005-04-29 David Love <fx@gnu.org>
+
+ * roken-frag.m4: Check for correct vis.h.
+
+2005-04-28 David Love <fx@gnu.org>
+
+ * pthreads.m4: Set PTHREADS_LIBS on Irix.
+
+2005-04-27 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * broken-realloc.m4: use rk_realloc if realloc is broken, this
+ makes "host-tools" not beeing able to use realloc
+
+ * pthreads.m4: Add support for Solaris, Irix, and modern
+ Linux. From David Love <fx@gnu.org>
+
+2005-04-25 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: limit the units functions to
+ asn1_[A-Za-z0-9]*_units$
+
+2005-04-20 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: this lib include com_err, add -com_err to
+ CHECK_SYMBOLS
+
+ * check-symbols.sh: print the type so I don't need to ask for it
+
+2005-04-18 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: ignore filename symbols
+
+2005-04-04 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: assume symbols prefixed with _ is a sideeffekt
+ of the local linker and also just fine
+
+2005-03-16 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: include <sys/socket.h> for <netinet6/in6_var.h>
+
+2005-03-01 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * sunos.m4: Match solaris 10. From: Joakim Fallsjo
+ <fallsjo@sanchin.se>
+
+2004-12-29 Love <lha@stacken.kth.se>
+
+ * check-symbols.sh: add -asn1compile symbols
+
+2004-12-29 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-symbols.sh: add exported symbols test
+
+ * Makefile.am.common: add CHECK_SYMBOLS tests, so that we don't
+ export to much stuff
+
+2004-09-03 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * make-proto.pl: add cpluscplus extern "C" support
+
+2004-07-09 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * pthreads.m4: add -pthread to LIBS since libtool doesn't preserve
+ it for us when adding is as a dependency on libs
+
+2004-04-24 Johan Danielsson <joda@pdc.kth.se>
+
+ * largefile.m4: like AC_SYS_LARGEFILE, but also add to CPPFLAGS
+
+2004-04-14 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-compile-et.m4: even more evil stuff for cross-compiling
+
+ * check-x.m4: use AC_RUN_IFELSE so we can handle cross compiling
+
+ * check-compile-et.m4: use AC_RUN_IFELSE so we can handle cross
+ compiling
+
+2004-04-13 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * make-proto.pl: if -E, add windows standard calling conv to
+ headerfile if needed
+
+ * win32.m4: add rk_WIN32_EXPORT
+
+2004-02-12 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * configure.in: rename AC_WFLAGS to rk_WFLAGS
+
+ * *.m4: overquote to pacify automake1.8
+
+2004-02-11 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * roken-frag.m4: resolv.h is even more special
+
+ * roken-frag.m4: AC_CHECK_HEADERS(net/if.h netinet6/in6_var.h
+ sys/sysctl.h sys/proc.h, resolv.h) are all special and need extra
+ help
+
+ * test-package.m4: If there is a --with-PACKAGE=path but no
+ --with-PACKAGE-config, go seach for path/PACKEGE-config and use it
+ if it exists. Inspired by Harald Barth <haba@pdc.kth.se>
+
+2003-09-03 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: check for DES_, AES_, and if openssl UI_
+
+2003-08-27 Johan Danielsson <joda@pdc.kth.se>
+
+ * vararray.m4: test for variable-length arrays
+
+ * roken-frag.m4: test for poll and poll.h
+
+2003-08-16 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: don't try doing local checks if CHECK_LOCAL
+ is set to no-check-local
+
+2003-08-01 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-compile-et.m4: check if compile_et support ``error_table N
+ M'' also, don't be overly aggressivly reset CFLAGS
+
+2003-07-22 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * pthreads.m4: pthread test
+
+2003-05-08 Johan Danielsson <joda@pdc.kth.se>
+
+ * Makefile.am.common: change install-data-local to
+ install-data-hook
+
+2003-05-05 Assar Westerlund <assar@kth.se>
+
+ * crypto.m4: define OPENSSL_DES_LIBDES_COMPATIBILITY
+
+2003-04-03 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: check if libcrypto needs -lnsl or -lsocket
+
+2003-04-02 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * crypto.m4: in the case where se don't link with kerberos 4, use
+ ${with_openssl_include} if its are set (not
+ ${with_openssl}/include) same for with_openssl_lib
+
+2003-03-18 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * Makefile.am.common: always define LIB_kafs
+
+2003-03-12 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-compile-et.m4: check if the output of compile_et needs
+ initialize_error_table_r
+
+2003-02-17 Love Hörnquist Åstrand <lha@it.su.se>
+
+ * check-var.m4: add a check if the variable is avaible when we
+ include the headerfiles
+
+2002-12-18 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: res_nsearch takes 6 parameters; spotted by Howard
+ Chu
+
+2002-10-25 Johan Danielsson <joda@pdc.kth.se>
+
+ * crypto.m4: do a better job at matching headers to libraries
+
+2002-10-16 Johan Danielsson <joda@pdc.kth.se>
+
+ * sunos.m4: more quoting
+
+2002-09-19 Johan Danielsson <joda@pdc.kth.se>
+
+ * make-proto.pl: check the processed string for closing ), not the
+ source
+
+2002-09-10 Johan Danielsson <joda@pdc.kth.se>
+
+ * crypto.m4: use m4 macros for test cases, also test for older
+ hash names
+
+ * test-package.m4: include dep libraries in LIB_*
+
+ * crypto.m4: move krb4 test before test for openssl, and bail out
+ if krb4 is requested, but the crypto library is not the same as
+ krb4
+
+ * db.m4: filter contents of LDFLAGS
+
+2002-09-09 Johan Danielsson <joda@pdc.kth.se>
+
+ * auth-modules.m4: rename to rk_AUTH_MODULES
+
+ * auth-modules.m4: only include modules explicitly asked for
+
+2002-09-04 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: test for res_nsearch
+
+2002-09-03 Assar Westerlund <assar@kth.se>
+
+ * roken-frag.m4: check for sys/mman.h and mmap (used by
+ parse_reply-test)
+
+2002-08-28 Assar Westerlund <assar@kth.se>
+
+ * krb-readline.m4: also add LIB_tgetent in the case of editline
+
+ * crypto.m4: define HAVE_OPENSSL even if we got to hear about it
+ by krb4
+
+2002-08-28 Johan Danielsson <joda@pdc.kth.se>
+
+ * krb-readline.m4: add LIB_tgetent to LIB_readline if we have to
+
+ * sunos.m4: various sunos tests
+
+ * crypto.m4: try to extract the crypto compiler flags from
+ {INCLUDE,LIB}_krb4
+ (XXX this is really horrible)
+
+ * krb-readline.m4: don't add -rpath to LIB_readline (libtool
+ should to this for us), also don't append LIB_tgetent to
+ LIB_readline (TEST_PACKAGE should do this)
+
+ * test-package.m4: add the possibility to use a *-config program
+ to get flags; rename to rk_TEST_PACKAGE while here
+
+ * krb-bigendian.m4: move ENDIANESS_IN_SYS_PARAM_H tests here
+
+ * aix.m4: rename to rk_AIX
+
+ * telnet.m4: move telnet tests here
+
+ * aix.m4: restructure this somewhat
+
+ * dlopen.m4: test for dlopen suitable for AC_REQUIRE
+
+ * irix.m4: move some stuff here and rename to irix.m4
+
+ * krb-sys-nextstep.m4: move SGTTY stuff to read_pwd.c
+
+2002-08-28 Jacques Vidrine <nectar@kth.se>
+
+ * auth-modules.m4: do not build pam_krb4 on freebsd
+
+2002-08-26 Assar Westerlund <assar@kth.se>
+
+ * roken-frag.m4: test for the vis, strvis functions requiring
+ prototypes
+
+2002-08-23 Johan Danielsson <joda@pdc.kth.se>
+
+ * need-proto.m4: missing comma
+
+2002-08-22 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: some rototilling
+
+ * need-proto.m4: use AS_TR_CPP
+
+2002-08-20 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: HAVE_TYPE instead of CHECK_TYPE ssize_t
+
+ * krb-version.m4: use PACKAGE_TARNAME and PACKAGE_STRING
+
+ * broken-getaddrinfo.m4: can't test for EAI_SERVICE here since AIX
+ is even more fsck:ed
+
+ * roken-frag.m4: test for altzone
+
+2002-08-19 Johan Danielsson <joda@pdc.kth.se>
+
+ * Makefile.am.common: only define ROKEN_RENAME if do_roken_rename
+
+2002-08-13 Johan Danielsson <joda@pdc.kth.se>
+
+ * Makefile.am.common: add ROKEN_RENAME variable
+
+2002-08-12 Johan Danielsson <joda@pdc.kth.se>
+
+ * make-proto.pl: include <stdarg.h> to get va_list
+
+ * destdirs.m4: also define localstatedir and sysconfdir
+
+2002-08-01 Johan Danielsson <joda@pdc.kth.se>
+
+ * crypto.m4: newer openssl seems to take the address of the
+ schedule parameter to des_cbc_encrypt, so we need to feed it a
+ variable, not just NULL (from Magnus Holmberg)
+
+2002-05-24 Johan Danielsson <joda@pdc.kth.se>
+
+ * misc.m4: change \100 back to @; some m4's (probably some regex)
+ doesn't like this as a replacement regexp; the reason it was once
+ changed to \100 was probably because of some autoconf bug at the
+ time
+
+2002-05-20 Johan Danielsson <joda@pdc.kth.se>
+
+ * broken2.m4 []-less is apparently the way to go
+
+2002-05-19 Johan Danielsson <joda@pdc.kth.se>
+
+ * otp.m4: check db_type instead of precence of dbm_firstkey
+
+ * roken-frag.m4: don't AC_LIBOBJ more than one function at a time
+
+ * find-if-not-broken.m4: s/AC_LIBOBJ/rk_LIBOBJ/
+
+ * broken2.m4: s/AC_LIBOBJ/rk_LIBOBJ/
+
+ * broken.m4: s/AC_LIBOBJ/rk_LIBOBJ/
+
+ * misc.m4: automake can't handle macros passed to AC_LIBOBJ, so
+ add an alias to it called rk_LIBOBJ; this requires that the
+ relevant source are manually included in roken/Makefile.am
+
+ * aix.m4: ac_enable --diable-dynamic-afs
+
+ * roken-frag.m4: use AC_LIBOBJ
+
+ * krb-func-getcwd-broken.m4: use AC_LIBOBJ
+
+ * find-if-not-broken.m4: use AC_LIBOBJ
+
+ * broken2.m4: use AC_LIBOBJ
+
+ * broken.m4: use AC_LIBOBJ
+
+ * aix.m4: recognise aix5
+
+2002-05-17 Johan Danielsson <joda@pdc.kth.se>
+
+ * crypto.m4: am-conditionalise HAVE_OPENSSL
+
+ * db.m4: make it possible to run this twice
+
+ * Makefile.am.common: also install nodist_include_HEADERS
+
+2002-05-16 Johan Danielsson <joda@pdc.kth.se>
+
+ * make-proto.pl: make it possible to redefine the "private" regexp
+
+2002-05-02 Johan Danielsson <joda@pdc.kth.se>
+
+ * db.m4: am_cond HAVE_*
+
+2002-04-30 Johan Danielsson <joda@pdc.kth.se>
+
+ * krb-ipv6.m4: use AC_HELP_STRING; fix logic bug in AC_MSG_RESULT
+ call
+
+ * test-package.m4: use AC_HELP_STRING
+
+ * roken.m4: use AC_HELP_STRING
+
+ * osfc2.m4: use AC_HELP_STRING
+
+ * mips-abi.m4: use AC_HELP_STRING
+
+ * krb-bigendian.m4: use AC_HELP_STRING
+
+ * db.m4: rework this somewhat; check for db3/4 in subdirs, change
+ --with to --enable; it should really be possible to point it to
+ some directory --with-berkeley-db=/foo
+
+ * otp.m4: OTP test
+
+2002-04-25 Johan Danielsson <joda@pdc.kth.se>
+
+ * destdirs.m4: define BINDIR et al
+
+2002-04-18 Johan Danielsson <joda@pdc.kth.se>
+
+ * misc.m4: remove some stuff that is defined elsewhere
+
+ * make-proto.pl: optionally remove __P and parameter names
+
+2001-11-30 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: move ipv6 tests after -lsocket (to handle Solaris
+ 8)
+
+2001-09-29 Assar Westerlund <assar@sics.se>
+
+ * install-catman.sh: handle man pages without SYNOPSIS but looking
+ for both SYNOPSIS and DESCRIPTION
+
+2001-09-18 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: include freeaddrinfo if using getaddrinfo
+
+2001-09-13 Assar Westerlund <assar@sics.se>
+
+ * db.m4: test for the ndbm database really being a .db one
+ and use it when moving/removing database files
+
+2001-09-03 Assar Westerlund <assar@sics.se>
+
+ * db.m4: prefer ndbm.h to dbm.h
+ * roken-frag.m4: check for atexit and on_exit
+
+2001-09-02 Assar Westerlund <assar@sics.se>
+
+ * check-compile-et.m4: only add /usr/include/et to CPPFLAGS if
+ it's actually used
+
+2001-09-01 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (AUTOMAKE_OPTIONS): set 1.4b here so that
+ users are warned if using earlier automake versions
+
+ * find-func-no-libs2.m4: ignore "no" as a library - another
+ special case to make it easy to send the result from this macro
+ into another invocation
+
+2001-08-30 Assar Westerlund <assar@sics.se>
+
+ * db.m4: check for ndbm functions in db3 library too
+
+2001-08-29 Jacques Vidrine <n@nectar.com>
+
+ * check-compile-et.m4: Check for already-installed com_err.
+ * Makefile.am.common: Use the compile_et discovered at
+ configuration time.
+
+2001-08-29 Assar Westerlund <assar@sics.se>
+
+ * crypto.m4: use AC_WITH_ALL to allow separate specification of
+ include and lib
+ * with-all.m4: new macro for doing --with-foo, --with-foo-include,
+ and --with-foo-lib in a sensible way
+
+ * find-func-no-libs2.m4: handle both -llib and lib in the second
+ argument also yes -> "" as a library, to ease callers that send in
+ results from this macro (this might be a little bit unclean)
+
+2001-08-28 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: test for issetugid
+
+2001-08-24 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common: change one += to = to AM_CFLAGS to avoid an
+ error with recent automake
+
+2001-08-22 Assar Westerlund <assar@sics.se>
+
+ * crypto.m4: SHA1_CTX should be SHA_CTX
+
+2001-08-21 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: remove all winsock.h
+ for now, it does more harm than good under cygwin and if it should be
+ used, the correct conditional needs to be found
+ from <tol@stacken.kth.se>
+
+2001-08-21 Johan Danielsson <joda@pdc.kth.se>
+
+ * check-var.m4: AC_TR_CPP -> AS_TR_CPP to make autoconf 2.52 happy
+
+2001-08-17 Johan Danielsson <joda@pdc.kth.se>
+
+ * krb-ipv6.m4: add test for non-existant in6addr_loopback in AIX
+
+2001-08-15 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: test for getaddrinfo's that doesn't like numeric
+ services
+
+ * broken-getaddrinfo.m4: test for getaddrinfo's that doesn't like
+ numeric services
+
+2001-08-08 Assar Westerlund <assar@sics.se>
+
+ * db.m4: do a separate test for gdbm/ndbm.h and -lgdbm
+
+2001-08-05 Assar Westerlund <assar@sics.se>
+
+ * db.m4: ac_cv_funclib_\func can be yes
+ * db.m4: use AC_FIND_FUNC_NO_LIBS to test in libc
+ anset cache variables after first attempt at finding dbm_firstkey (how
+ should this be done?)
+ * db.m4: do not test for ndbm library when ndbm-db was found in libc
+ * db.m4: test for ndbm-compatability with db
+ * db.m4: add forgotten AC_SUBST
+ * db.m4: first steps towards a new db test
+
+ * roken-frag.m4: remove header files checked by rk_db
+
+2001-08-05 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: remove header files checked by rk_db
+
+2001-06-24 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: make sure of building getaddrinfo et al if
+ missing
+
+2001-06-20 Johan Danielsson <joda@pdc.kth.se>
+
+ * install-catman.sh: try to install links to manpages
+
+2001-06-19 Assar Westerlund <assar@sics.se>
+
+ * broken-glob.m4: try to handle FreeBSD's GLOB_MAXPATH
+
+2001-06-18 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: test for getaddrinfo needs netdb.h on Tru64
+
+2001-06-17 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4 (AC_CHECK_HEADERS): test for random
+ * roken-frag.m4 (AC_CHECK_HEADERS): test for initstate and
+ setstate
+
+ * roken-frag.m4 (AC_BROKEN): test for
+ emalloc,ecalloc,erealloc,estrdup
+
+2001-05-11 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: bswap{16,32}
+
+2001-03-26 Assar Westerlund <assar@sics.se>
+
+ * broken-glob.m4: also test for GLOB_LIMIT
+ * krb-ipv6.m4: restore CFLAGS if v6 is not detected
+
+2001-02-20 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: check for getprogname, setprogname
+
+2001-02-07 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (LIB_kdfs): set. use it. from Ake Sandgren
+ <ake@cs.umu.se>
+
+2000-12-26 Assar Westerlund <assar@sics.se>
+
+ * krb-ipv6.m4: remove some dnl that weren't the correct with
+ modern autoconf
+
+2000-12-15 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4 (inet_ntoa, inet_ntop, inet_pton): add necessary
+ includes when testing
+ * broken2.m4: new variant of broken, with includes and arguments
+
+ * test-package.m4: s/ifval/m4_ifval/ to keep in sync with
+ autoconf. from Ake Sandgren <ake@cs.umu.se>
+ * check-var.m4: s/ifval/m4_ifval/ to keep in sync with autoconf.
+ from Ake Sandgren <ake@cs.umu.se>
+
+2000-12-13 Assar Westerlund <assar@sics.se>
+
+ * krb-irix.m4: need to set irix to no first. From Ake Sandgren
+ <ake@cs.umu.se>
+
+2000-12-12 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: move sa_len test to before test for broken
+ getnameinfo
+
+2000-12-12 Assar Westerlund <assar@sics.se>
+
+ * roken-frag.m4: only test for broken getnameinfo if it exists
+
+2000-12-10 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: ifaddrs.h
+
+2000-12-06 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: test for unvis, and vis.h
+
+ * roken-frag.m4: test for strvis*
+
+2000-12-05 Johan Danielsson <joda@pdc.kth.se>
+
+ * Makefile.am.common: just warn if we fail to setuid a program
+
+ * broken-getnameinfo.m4: add more quotes
+
+ * roken-frag.m4: test for getifaddrs
+
+ * roken-frag.m4: test for broken AIX getnameinfo
+
+ * broken-getnameinfo.m4: test for broken getnameinfo
+
+2000-12-01 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common: add kludge for LIBS
+
+2000-11-30 Johan Danielsson <joda@pdc.kth.se>
+
+ * check-man.m4: update this after recent changes
+
+ * Makefile.am.common: use install-catman.sh
+
+ * install-catman.sh: script to install preformatted manual pages
+
+ * Makefile.am.common: change cat handling
+
+2000-11-29 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: don't use AC_CONFIG_FILES here, since it doesn't
+ work with automake
+
+2000-11-15 Assar Westerlund <assar@sics.se>
+
+ * krb-readline.m4: link against the libtool-versions of
+ libeditline and libel_compat
+
+ * Makefile.am.common (INCLUDES): add $(INCLUDES_roken)
+ * roken-frag.m4 (CPPFLAGS_roken): rename to INCLUDES_roken
+
+2000-11-05 Johan Danielsson <joda@pdc.kth.se>
+
+ * aix.m4: set aix
+
+2000-08-19 Assar Westerlund <assar@sics.se>
+
+ * krb-bigendian.m4: merge from arla: make it work better
+
+2000-08-07 Johan Danielsson <joda@pdc.kth.se>
+
+ * roken-frag.m4: check getsockname for proto compat
+
+2000-08-04 Johan Danielsson <joda@pdc.kth.se>
+
+ * Makefile.am.common: add library for pidfile
+
+ * roken-frag.m4: tests for util.h and pidfile
+
+2000-07-19 Johan Danielsson <joda@pdc.kth.se>
+
+ * check-var.m4: rename to rk_CHECK_VAR, transposing the arguments,
+ and making the second optional, AU_DEFINE AC_CHECK_VAR to
+ rk_CHECK_VAR
+
+ * roken-frag.m4: other roken tests
+
+ * db.m4: db tests
+
+2000-07-18 Johan Danielsson <joda@pdc.kth.se>
+
+ * mips-abi.m4: AC_ERROR -> AC_MSG_ERROR
+
+ * check-netinet-ip-and-tcp.m4: use cache_check, and make this work
+ with new autoconf
+
+ * aix.m4: don't subst AFS_EXTRA_LD
+
+2000-07-15 Johan Danielsson <joda@pdc.kth.se>
+
+ * check-var.m4: workaround feature of newer autoconf
+
+ * find-func-no-libs2.m4: use cleaner autoheader trick
+
+ * have-type.m4: use cleaner autoheader trick
+
+ * have-types.m4: use cleaner autoheader trick
+
+ * test-package.m4: add 6th parameter for now
+
+ * broken.m4: use cleaner autoheader trick
+
+ * retsigtype.m4: test for signal handler return type
+
+ * broken-realloc.m4: test for broken realloc
+
+2000-07-08 Assar Westerlund <assar@sics.se>
+
+ * roken.m4: set CPPFLAGS_roken and call AC_CONFIG_SUBDIRS
+
+2000-07-02 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (CP): set and use
+
+2000-04-05 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (INCLUDE_openldap, LIB_openldap): add
+
+2000-03-28 Assar Westerlund <assar@sics.se>
+
+ * krb-prog-yacc.m4: AC_MSG_WARNING should be AC_MSG_WARN
+
+ * shared-libs.m4: try to update to freebsd5 (and elf)
+
+2000-03-16 Assar Westerlund <assar@sics.se>
+
+ * krb-prog-yacc.m4: warn we do not find any yacc
+
+2000-01-08 Assar Westerlund <assar@sics.se>
+
+ * krb-bigendian.m4: new file, replacement for ac_c_bigendian
+
+2000-01-01 Assar Westerlund <assar@sics.se>
+
+ * krb-ipv6.m4: re-organize: test for type of stack first so that
+ we can find the libraries that we might have to link the test
+ program against. not linking the test program means we don't know
+ if the right stuff is in the libraries. also cosmetic changes to
+ make sure we print the checking for... nicely
+
+1999-12-21 Assar Westerlund <assar@sics.se>
+
+ * krb-ipv6.m4: try linking, not only compiling
+ * krb-ipv6.m4: add --without-ipv6 make sure we have `in6addr_any'
+ which we use in the code. This test avoids false positives on
+ OpenBSD
+
+1999-11-29 Johan Danielsson <joda@pdc.kth.se>
+
+ * grok-type.m4: inttypes.h
+
+1999-11-05 Assar Westerlund <assar@sics.se>
+
+ * check-x.m4: include X_PRE_LIBS and X_EXTRA_LIBS when testing
+
+1999-11-01 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (install-build-headers): use `cp' instead of
+ INSTALL_DATA for copying header files inside the build tree. The
+ user might have redefined INSTALL_DATA to specify owners and other
+ information.
+
+1999-10-30 Assar Westerlund <assar@sics.se>
+
+ * find-func-no-libs2.m4: add yet another argument to allow specify
+ linker flags that will be added _before_ the library when trying
+ to link
+
+ * find-func-no-libs.m4: add yet another argument to allow specify
+ linker flags that will be added _before_ the library when trying
+ to link
+
+1999-10-12 Assar Westerlund <assar@sics.se>
+
+ * find-func-no-libs2.m4 (AC_FIND_FUNC_NO_LIBS2): new argument
+ `extra libs'
+
+ * find-func-no-libs.m4 (AC_FIND_FUNC_NO_LIBS): new argument `extra
+ libs'
+
+1999-09-01 Johan Danielsson <joda@pdc.kth.se>
+
+ * capabilities.m4: sgi capabilities
+
+1999-07-29 Assar Westerlund <assar@sics.se>
+
+ * have-struct-field.m4: quote macros when undefining
+
+1999-07-28 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (install-build-headers): add dependencies
+
+1999-07-24 Assar Westerlund <assar@sics.se>
+
+ * have-type.m4: try to get autoheader to co-operate
+
+ * have-type.m4: stolen from Arla
+
+ * krb-struct-sockaddr-sa-len.m4: not used any longer. removed.
+
+1999-06-13 Assar Westerlund <assar@sics.se>
+
+ * krb-struct-spwd.m4: consequent name of cache variables
+
+ * krb-func-getlogin.m4: new file for testing for posix (broken)
+ getlogin
+
+ * shared-libs.m4 (freebsd[34]): don't use ld -Bshareable
+
+1999-06-02 Johan Danielsson <joda@pdc.kth.se>
+
+ * check-x.m4: extended test for X
+
+1999-05-14 Assar Westerlund <assar@sics.se>
+
+ * check-netinet-ip-and-tcp.m4: proper autoheader tricks
+
+ * check-netinet-ip-and-tcp.m4: new file for checking for
+ netinet/{ip,tcp}.h. These are special as they on Irix 6.5.3
+ require <standards.h> to be included in advance.
+
+ * check-xau.m4: we also need to check for XauFilename since it's
+ used by appl/kx. And on Irix 6.5 that function requires linking
+ with -lX11.
+
+1999-05-08 Assar Westerlund <assar@sics.se>
+
+ * krb-find-db.m4: try with more header files than ndbm.h
+
+1999-04-19 Assar Westerlund <assar@sics.se>
+
+ * test-package.m4: try to handle the case of --without-package
+ correctly
+
+1999-04-17 Assar Westerlund <assar@sics.se>
+
+ * make-aclocal: removed. Not used anymore, being replaced by
+ aclocal from automake.
+
+Thu Apr 15 14:17:26 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * make-proto.pl: handle __attribute__
+
+Fri Apr 9 20:37:18 1999 Assar Westerlund <assar@sics.se>
+
+ * shared-libs.m4: quote $@
+ (freebsd3): add install_symlink_command2
+
+Wed Apr 7 20:40:22 1999 Assar Westerlund <assar@sics.se>
+
+ * shared-libs.m4 (hpux): no library dependencies
+
+Mon Apr 5 16:13:08 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * test-package.m4: compile and link, rather than looking for
+ files; also export more information, so it's possible to add rpath
+ information
+
+Tue Mar 30 13:49:54 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * Makefile.am.common: CFLAGS -> AM_CFLAGS
+
+Mon Mar 29 16:51:12 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * check-xau.m4: check for XauWriteAuth before checking for
+ XauReadAuth to catch -lX11:s not containing XauWriteAuth, and IRIX
+ 6.5 that doesn't work with -lXau
+
+Sat Mar 27 18:03:58 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * osfc2.m4: --enable-osfc2
+
+Fri Mar 19 15:34:52 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * shared-libs.m4: move shared lib stuff here
+
+Wed Mar 24 23:24:51 1999 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (install-build-headers): simplify loop
+
+Tue Mar 23 17:31:23 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * check-getpwnam_r-posix.m4: check for getpwnam_r, and if it's
+ posix or not
+
+Tue Mar 23 00:00:13 1999 Assar Westerlund <assar@sics.se>
+
+ * Makefile.am.common (install_build_headers): try to make it work
+ better when list of headers is empty. handle make rewriting the
+ filenames.
+
+ * Makefile.am.common: hesoid -> hesiod
+
+Sun Mar 21 14:48:03 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * grok-type.m4: <bind/bitypes.h>
+
+ * Makefile.am.common: fix for automake bug/feature; add more LIB_*
+
+ * test-package.m4: fix typo
+
+ * check-man.m4: fix some typos
+
+ * auth-modules.m4: tests for authentication modules
+
+Thu Mar 18 11:02:55 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * Makefile.am.common: make install-build-headers a multi
+ dependency target
+
+ * Makefile.am.common: remove include_dir hack
+
+ * Makefile.am.common: define LIB_kafs and LIB_gssapi
+
+ * krb-find-db.m4: subst DBLIB also
+
+ * check-xau.m4: test for Xau{Read,Write}Auth
+
+Wed Mar 10 19:29:20 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * wflags.m4: AC_WFLAGS
+
+Mon Mar 1 11:23:41 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * have-struct-field.m4: remove extra AC_MSG_RESULT
+
+ * proto-compat.m4: typo
+
+ * krb-func-getcwd-broken.m4: update to autoconf 2.13
+
+ * krb-find-db.m4: update to autoconf 2.13
+
+ * check-declaration.m4: typo
+
+ * have-pragma-weak.m4: update to autoconf 2.13
+
+ * have-struct-field.m4: better handling of types with spaces
+
+Mon Feb 22 20:05:06 1999 Johan Danielsson <joda@hella.pdc.kth.se>
+
+ * broken-glob.m4: check for broken glob
+
+Sun Jan 31 06:50:33 1999 Assar Westerlund <assar@sics.se>
+
+ * krb-ipv6.m4: more magic for different v6 implementations. From
+ Jun-ichiro itojun Hagino <itojun@kame.net>
+
+Sun Nov 22 12:16:06 1998 Assar Westerlund <assar@sics.se>
+
+ * krb-struct-spwd.m4: new file
+
+Thu Jun 4 04:07:41 1998 Assar Westerlund <assar@sics.se>
+
+ * find-func-no-libs2.m4: new file
+
+Fri May 1 23:31:28 1998 Assar Westerlund <assar@sics.se>
+
+ * c-attribute.m4, c-function.m4: new files (from arla)
+
+Wed Mar 18 23:11:29 1998 Assar Westerlund <assar@sics.se>
+
+ * krb-ipv6.m4: rename HAVE_STRUCT_SOCKADDR_IN6 to HAVE_IPV6
+
+Thu Feb 26 02:37:49 1998 Assar Westerlund <assar@sics.se>
+
+ * make-proto.pl: should work with perl4
+
diff --git a/third_party/heimdal/cf/Makefile.am.common b/third_party/heimdal/cf/Makefile.am.common
new file mode 100644
index 0000000..90921fe
--- /dev/null
+++ b/third_party/heimdal/cf/Makefile.am.common
@@ -0,0 +1,294 @@
+# $Id$
+
+SUFFIXES = .et .h .pc.in .pc
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include
+
+AM_CPPFLAGS = $(INCLUDES_roken)
+
+if do_roken_rename
+ROKEN_RENAME = -DROKEN_RENAME
+endif
+
+AM_CFLAGS = $(WFLAGS)
+
+CLANG_FORMAT_STYLE = '{BasedOnStyle: Mozilla, AlwaysBreakAfterReturnType: TopLevelDefinitions, IndentWidth: 4, SortIncludes: false}'
+
+CP = cp
+
+## set build_HEADERZ to headers that should just be installed in build tree
+
+buildinclude = $(top_builddir)/include
+
+## these aren't detected by automake
+LIB_XauReadAuth = @LIB_XauReadAuth@
+LIB_crypt = @LIB_crypt@
+LIB_dbm_firstkey = @LIB_dbm_firstkey@
+LIB_dbopen = @LIB_dbopen@
+LIB_dlopen = @LIB_dlopen@
+LIB_dn_expand = @LIB_dn_expand@
+LIB_el_init = @LIB_el_init@
+LIB_getattr = @LIB_getattr@
+LIB_gethostbyname = @LIB_gethostbyname@
+LIB_getpwent_r = @LIB_getpwent_r@
+LIB_getpwnam_r = @LIB_getpwnam_r@
+LIB_getsockopt = @LIB_getsockopt@
+LIB_odm_initialize = @LIB_odm_initialize@
+LIB_openpty = @LIB_openpty@
+LIB_pidfile = @LIB_pidfile@
+LIB_res_search = @LIB_res_search@
+LIB_setpcred = @LIB_setpcred@
+LIB_setsockopt = @LIB_setsockopt@
+LIB_socket = @LIB_socket@
+LIB_syslog = @LIB_syslog@
+LIB_tgetent = @LIB_tgetent@
+LIB_com_err = @LIB_com_err@
+LIB_door_create = @LIB_door_create@
+
+LIB_openssl_crypto = @LIB_openssl_crypto@
+INCLUDE_openssl_crypto = @INCLUDE_openssl_crypto@
+
+INCLUDE_krb4 = @INCLUDE_krb4@
+LIB_krb4 = @LIB_krb4@
+
+INCLUDE_openldap = @INCLUDE_openldap@
+LIB_openldap = @LIB_openldap@
+
+INCLUDE_readline = @INCLUDE_readline@
+LIB_readline = @LIB_readline@
+
+LEXLIB = @LEXLIB@
+
+libexec_heimdaldir = $(libexecdir)/heimdal
+
+install-suid-programs:
+ @foo='$(bin_SUIDS)'; \
+ for file in $$foo; do \
+ x=$(DESTDIR)$(bindir)/$$file; \
+ if chown 0:0 $$x && chmod u+s $$x; then :; else \
+ echo "*"; \
+ echo "* Failed to install $$x setuid root"; \
+ echo "*"; \
+ fi; \
+ done
+
+install-exec-local: install-suid-programs
+
+codesign-all:
+ @if [ X"$$CODE_SIGN_IDENTITY" != X ] ; then \
+ foo='$(bin_PROGRAMS) $(sbin_PROGRAMS) $(libexec_PROGRAMS)' ; \
+ for file in $$foo ; do \
+ echo "CODESIGN $$file" ; \
+ codesign -f -s "$$CODE_SIGN_IDENTITY" $$file || exit 1 ; \
+ done ; \
+ fi
+
+
+
+all-local: codesign-all
+
+install-build-headers:: $(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS) $(noinst_HEADERS)
+ @foo='$(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(noinst_HEADERS)'; \
+ for f in $$foo; do \
+ f=`basename $$f`; \
+ if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
+ else file="$$f"; fi; \
+ if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \
+ : ; else \
+ echo " $(CP) $$file $(buildinclude)/$$f"; \
+ $(CP) $$file $(buildinclude)/$$f || true; \
+ fi ; \
+ done ; \
+ foo='$(nobase_include_HEADERS)'; \
+ for f in $$foo; do \
+ if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
+ else file="$$f"; fi; \
+ $(mkdir_p) $(buildinclude)/`dirname $$f` ; \
+ if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \
+ : ; else \
+ echo " $(CP) $$file $(buildinclude)/$$f"; \
+ $(CP) $$file $(buildinclude)/$$f; \
+ fi ; \
+ done
+
+all-local: install-build-headers
+
+check-local::
+ @if test '$(CHECK_LOCAL)' = "no-check-local"; then \
+ foo=''; elif test '$(CHECK_LOCAL)'; then \
+ foo='$(CHECK_LOCAL)'; else \
+ foo='$(PROGRAMS)'; fi; \
+ if test "$$foo"; then \
+ failed=0; all=0; \
+ for i in $$foo; do \
+ all=`expr $$all + 1`; \
+ if (./$$i --version && ./$$i --help) > /dev/null 2>&1; then \
+ echo "PASS: $$i"; \
+ else \
+ echo "FAIL: $$i"; \
+ failed=`expr $$failed + 1`; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="$$failed of $$all tests failed"; \
+ fi; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0 || exit 1; \
+ fi
+
+SUFFIXES += .x .z
+
+SUFFIXES += .1 .3 .5 .7 .8 .cat1 .cat3 .cat5 .cat7 .cat8
+
+NROFF_MAN = groff -mandoc -Tascii
+#NROFF_MAN = nroff -man
+.1.cat1:
+ $(NROFF_MAN) $< > $@
+.3.cat3:
+ $(NROFF_MAN) $< > $@
+.5.cat5:
+ $(NROFF_MAN) $< > $@
+.7.cat7:
+ $(NROFF_MAN) $< > $@
+.8.cat8:
+ $(NROFF_MAN) $< > $@
+
+## MAINTAINERCLEANFILES +=
+
+dist-cat1-mans:
+ @foo='$(man1_MANS)'; \
+ bar='$(man_MANS)'; \
+ for i in $$bar; do \
+ case $$i in \
+ *.1) foo="$$foo $$i";; \
+ esac; done ;\
+ for i in $$foo; do \
+ x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
+ echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
+ $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
+ done
+
+dist-cat3-mans:
+ @foo='$(man3_MANS)'; \
+ bar='$(man_MANS)'; \
+ for i in $$bar; do \
+ case $$i in \
+ *.3) foo="$$foo $$i";; \
+ esac; done ;\
+ for i in $$foo; do \
+ x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
+ echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
+ $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
+ done
+
+dist-cat5-mans:
+ @foo='$(man5_MANS)'; \
+ bar='$(man_MANS)'; \
+ for i in $$bar; do \
+ case $$i in \
+ *.5) foo="$$foo $$i";; \
+ esac; done ;\
+ for i in $$foo; do \
+ x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
+ echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
+ $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
+ done
+
+dist-cat7-mans:
+ @foo='$(man7_MANS)'; \
+ bar='$(man_MANS)'; \
+ for i in $$bar; do \
+ case $$i in \
+ *.7) foo="$$foo $$i";; \
+ esac; done ;\
+ for i in $$foo; do \
+ x=`echo $$i | sed 's/\.[^.]*$$/.cat7/'`; \
+ echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
+ $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
+ done
+
+dist-cat8-mans:
+ @foo='$(man8_MANS)'; \
+ bar='$(man_MANS)'; \
+ for i in $$bar; do \
+ case $$i in \
+ *.8) foo="$$foo $$i";; \
+ esac; done ;\
+ for i in $$foo; do \
+ x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
+ echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
+ $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
+ done
+
+dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat7-mans dist-cat8-mans
+
+install-cat-mans:
+ $(SHELL) $(top_srcdir)/cf/install-catman.sh install "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS)
+
+uninstall-cat-mans:
+ $(SHELL) $(top_srcdir)/cf/install-catman.sh uninstall "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS)
+
+install-data-hook: install-cat-mans
+uninstall-hook: uninstall-cat-mans
+
+
+.et.h:
+ $(COMPILE_ET) $<
+.et.c:
+ $(COMPILE_ET) $<
+
+if NO_AFS
+LIB_kafs =
+else
+LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
+endif
+
+if KRB5
+LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
+ $(top_builddir)/lib/asn1/libasn1.la
+LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
+endif
+
+LIB_heimbase = $(top_builddir)/lib/base/libheimbase.la
+
+if DCE
+LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
+endif
+
+#
+# Useful target for debugging
+#
+
+check-valgrind:
+ tobjdir=`cd $(top_builddir) && pwd` ; \
+ tsrcdir=`cd $(top_srcdir) && pwd` ; \
+ env TESTS_ENVIRONMENT="$${tsrcdir}/cf/maybe-valgrind.sh -s $${tsrcdir} -o $${tobjdir}" make check
+
+#
+# Target to please samba build farm, builds distfiles in-tree.
+# Will break when automake changes...
+#
+
+distdir-in-tree: $(DISTFILES) $(INFO_DEPS)
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" != .; then \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) distdir-in-tree) ; \
+ fi ; \
+ done
+
+
+#silent-rules
+
+heim_verbose = $(heim_verbose_$(V))
+heim_verbose_ = $(heim_verbose_$(AM_DEFAULT_VERBOSITY))
+heim_verbose_0 = @echo " GEN "$@;
+
+if ENABLE_GCOV
+AM_CFLAGS += --coverage --no-inline
+AM_LDFLAGS = -lgcov
+endif
diff --git a/third_party/heimdal/cf/aix.m4 b/third_party/heimdal/cf/aix.m4
new file mode 100644
index 0000000..2c450fb
--- /dev/null
+++ b/third_party/heimdal/cf/aix.m4
@@ -0,0 +1,62 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([rk_AIX],[
+
+aix=no
+case "$host" in
+*-*-aix3*)
+ aix=3
+ ;;
+*-*-aix[[4-9]]*)
+ aix=4
+ ;;
+esac
+
+AM_CONDITIONAL(AIX, test "$aix" != no)dnl
+AM_CONDITIONAL(AIX4, test "$aix" = 4)dnl
+
+AC_ARG_ENABLE(dynamic-afs,
+ AS_HELP_STRING([--disable-dynamic-afs],
+ [do not use loaded AFS library with AIX]))
+
+if test "$aix" != no; then
+
+ AC_DEFINE(NEED_QSORT, 1, [if your qsort is not a stable sort])
+
+ if test "$enable_dynamic_afs" != no; then
+ AC_REQUIRE([rk_DLOPEN])
+ if test "$ac_cv_func_dlopen" = no; then
+ AC_FIND_FUNC_NO_LIBS(loadquery, ld)
+ fi
+ if test "$ac_cv_func_dlopen" != no; then
+ AIX_EXTRA_KAFS='$(LIB_dlopen)'
+ elif test "$ac_cv_func_loadquery" != no; then
+ AIX_EXTRA_KAFS='$(LIB_loadquery)'
+ else
+ AC_MSG_NOTICE([not using dynloaded AFS library])
+ AIX_EXTRA_KAFS=
+ enable_dynamic_afs=no
+ fi
+ else
+ AIX_EXTRA_KAFS=
+ fi
+fi
+
+AM_CONDITIONAL(AIX_DYNAMIC_AFS, test "$enable_dynamic_afs" != no)dnl
+AC_SUBST(AIX_EXTRA_KAFS)dnl
+
+if test "$aix" != no; then
+ AC_DEFINE([_ALL_SOURCE],1,[Required for functional/sane headers on AIX])
+fi
+
+AH_BOTTOM([#if _AIX
+/* XXX this is gross, but kills about a gazillion warnings */
+struct ether_addr;
+struct sockaddr;
+struct sockaddr_dl;
+struct sockaddr_in;
+#endif])
+
+])
diff --git a/third_party/heimdal/cf/auth-modules.m4 b/third_party/heimdal/cf/auth-modules.m4
new file mode 100644
index 0000000..e27de4b
--- /dev/null
+++ b/third_party/heimdal/cf/auth-modules.m4
@@ -0,0 +1,45 @@
+dnl $Id$
+dnl
+dnl Figure what authentication modules should be built
+dnl
+dnl rk_AUTH_MODULES(module-list)
+
+AC_DEFUN([rk_AUTH_MODULES],[
+AC_MSG_CHECKING([which authentication modules should be built])
+
+z='m4_ifval([$1], $1, [sia pam afskauthlib])'
+LIB_AUTH_SUBDIRS=
+for i in $z; do
+case $i in
+sia)
+if test "$ac_cv_header_siad_h" = yes; then
+ LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
+fi
+;;
+pam)
+case "${host}" in
+*-*-freebsd*) ac_cv_want_pam_krb4=no ;;
+*) ac_cv_want_pam_krb4=yes ;;
+esac
+
+if test "$ac_cv_want_pam_krb4" = yes -a \
+ "$ac_cv_header_security_pam_modules_h" = yes -a \
+ "$enable_shared" = yes; then
+ LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
+fi
+;;
+afskauthlib)
+case "${host}" in
+*-*-irix[[56]]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
+esac
+;;
+esac
+done
+if test "$LIB_AUTH_SUBDIRS"; then
+ AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
+else
+ AC_MSG_RESULT(none)
+fi
+
+AC_SUBST(LIB_AUTH_SUBDIRS)dnl
+])
diff --git a/third_party/heimdal/cf/ax_check_sign.m4 b/third_party/heimdal/cf/ax_check_sign.m4
new file mode 100644
index 0000000..bc2c3f0
--- /dev/null
+++ b/third_party/heimdal/cf/ax_check_sign.m4
@@ -0,0 +1,54 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_check_sign.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_SIGN (TYPE, [ACTION-IF-SIGNED], [ACTION-IF-UNSIGNED], [INCLUDES])
+#
+# DESCRIPTION
+#
+# Checks whether TYPE is signed or not. If no INCLUDES are specified, the
+# default includes are used. If ACTION-IF-SIGNED is given, it is
+# additional shell code to execute when the type is signed. If
+# ACTION-IF-UNSIGNED is given, it is executed when the type is unsigned.
+#
+# This macro assumes that the type exists. Therefore the existence of the
+# type should be checked before calling this macro. For example:
+#
+# AC_CHECK_HEADERS([wchar.h])
+# AC_CHECK_TYPE([wchar_t],,[ AC_MSG_ERROR([Type wchar_t not found.]) ])
+# AX_CHECK_SIGN([wchar_t],
+# [ AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ],
+# [ AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned]) ], [
+# #ifdef HAVE_WCHAR_H
+# #include <wchar.h>
+# #endif
+# ])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 7
+
+AU_ALIAS([VL_CHECK_SIGN], [AX_CHECK_SIGN])
+AC_DEFUN([AX_CHECK_SIGN], [
+ typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"`
+ AC_CACHE_CHECK([whether $1 is signed], ax_cv_decl_${typename}_signed, [
+ AC_TRY_COMPILE([$4],
+ [ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ],
+ [ eval "ax_cv_decl_${typename}_signed=\"yes\"" ],
+ [ eval "ax_cv_decl_${typename}_signed=\"no\"" ])])
+ symbolname=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g" | tr "a-z" "A-Z"`
+ if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
+ $2
+ elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
+ $3
+ fi
+])dnl
diff --git a/third_party/heimdal/cf/broken-getaddrinfo.m4 b/third_party/heimdal/cf/broken-getaddrinfo.m4
new file mode 100644
index 0000000..5daf416
--- /dev/null
+++ b/third_party/heimdal/cf/broken-getaddrinfo.m4
@@ -0,0 +1,26 @@
+dnl $Id$
+dnl
+dnl test if getaddrinfo can handle numeric services
+
+AC_DEFUN([rk_BROKEN_GETADDRINFO],[
+AC_CACHE_CHECK([if getaddrinfo handles numeric services], ac_cv_func_getaddrinfo_numserv,
+AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+
+int
+main(int argc, char **argv)
+{
+ struct addrinfo hints, *ai;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_family = PF_UNSPEC;
+ if(getaddrinfo(NULL, "17", &hints, &ai) != 0)
+ return 1;
+ if(getaddrinfo(NULL, "0", &hints, &ai) != 0)
+ return 1;
+ return 0;
+}
+]])],[ac_cv_func_getaddrinfo_numserv=yes],[ac_cv_func_getaddrinfo_numserv=no],[ac_cv_func_getaddrinfo_numserv=yes]))])
diff --git a/third_party/heimdal/cf/broken-realloc.m4 b/third_party/heimdal/cf/broken-realloc.m4
new file mode 100644
index 0000000..b6d962a
--- /dev/null
+++ b/third_party/heimdal/cf/broken-realloc.m4
@@ -0,0 +1,25 @@
+dnl
+dnl $Id$
+dnl
+dnl Test for realloc that doesn't handle NULL as first parameter
+dnl
+AC_DEFUN([rk_BROKEN_REALLOC], [
+AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
+ac_cv_func_realloc_broken=no
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stddef.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+ return realloc(NULL, 17) == NULL;
+}
+]])],[:], [ac_cv_func_realloc_broken=yes],[:])
+])
+if test "$ac_cv_func_realloc_broken" = yes ; then
+ AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
+fi
+AH_BOTTOM([#ifdef BROKEN_REALLOC
+#define realloc(X, Y) rk_realloc((X), (Y))
+#endif])
+])
diff --git a/third_party/heimdal/cf/broken-snprintf.m4 b/third_party/heimdal/cf/broken-snprintf.m4
new file mode 100644
index 0000000..0261116
--- /dev/null
+++ b/third_party/heimdal/cf/broken-snprintf.m4
@@ -0,0 +1,63 @@
+dnl $Id$
+dnl
+AC_DEFUN([AC_BROKEN_SNPRINTF], [
+AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
+ac_cv_func_snprintf_working=yes
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+int main(int argc, char **argv)
+{
+ char foo[[3]];
+ snprintf(foo, 2, "12");
+ return strcmp(foo, "1") || snprintf(NULL, 0, "%d", 12) != 2;
+}]])],[:],[ac_cv_func_snprintf_working=no],[:]))
+
+if test "$ac_cv_func_snprintf_working" = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
+fi
+if test "$ac_cv_func_snprintf_working" = yes; then
+AC_NEED_PROTO([#include <stdio.h>],snprintf)
+fi
+])
+
+AC_DEFUN([AC_BROKEN_VSNPRINTF],[
+AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
+ac_cv_func_vsnprintf_working=yes
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+
+int foo(int num, ...)
+{
+ char bar[[3]];
+ va_list arg;
+ va_start(arg, num);
+ vsnprintf(bar, 2, "%s", arg);
+ va_end(arg);
+ return strcmp(bar, "1");
+}
+
+int bar(int num, int len, ...)
+{
+ int r;
+ va_list arg;
+ va_start(arg, len);
+ r = vsnprintf(NULL, 0, "%s", arg);
+ va_end(arg);
+ return r != len;
+}
+
+int main(int argc, char **argv)
+{
+ return foo(0, "12") || bar(0, 2, "12");
+}]])],[:],[ac_cv_func_vsnprintf_working=no],[:]))
+
+if test "$ac_cv_func_vsnprintf_working" = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
+fi
+if test "$ac_cv_func_vsnprintf_working" = yes; then
+AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
+fi
+])
diff --git a/third_party/heimdal/cf/broken.m4 b/third_party/heimdal/cf/broken.m4
new file mode 100644
index 0000000..1c8db72
--- /dev/null
+++ b/third_party/heimdal/cf/broken.m4
@@ -0,0 +1,12 @@
+dnl $Id$
+dnl
+dnl
+dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
+dnl libraries
+
+AC_DEFUN([AC_BROKEN],
+[AC_FOREACH([rk_func], [$1],
+ [AC_CHECK_FUNC(rk_func,
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]rk_func), 1,
+ [Define if you have the function `]rk_func['.])],
+ [rk_LIBOBJ(rk_func)])])])
diff --git a/third_party/heimdal/cf/broken2.m4 b/third_party/heimdal/cf/broken2.m4
new file mode 100644
index 0000000..71e2afa
--- /dev/null
+++ b/third_party/heimdal/cf/broken2.m4
@@ -0,0 +1,25 @@
+dnl $Id$
+dnl
+dnl AC_BROKEN but with more arguments
+
+dnl AC_BROKEN2(func, includes, arguments)
+AC_DEFUN([AC_BROKEN2],
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(ac_cv_func_[]$1,
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$1) || defined (__stub___$1)
+choke me
+#else
+$1($3);
+#endif
+]])], [eval "ac_cv_func_[]$1=yes"], [eval "ac_cv_func_[]$1=no"])])
+if eval "test \"\${ac_cv_func_[]$1}\" = yes"; then
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, define)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+ rk_LIBOBJ($1)
+fi])
diff --git a/third_party/heimdal/cf/c-attribute.m4 b/third_party/heimdal/cf/c-attribute.m4
new file mode 100644
index 0000000..8ff6bd3
--- /dev/null
+++ b/third_party/heimdal/cf/c-attribute.m4
@@ -0,0 +1,28 @@
+dnl
+dnl $Id$
+dnl
+
+dnl
+dnl Test for __attribute__
+dnl
+
+AC_DEFUN([AC_C___ATTRIBUTE__], [
+AC_MSG_CHECKING(for __attribute__)
+AC_CACHE_VAL(ac_cv___attribute__, [
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
+static void foo(void) __attribute__ ((noreturn));
+
+static void
+foo(void)
+{
+ exit(1);
+}
+]])],
+[ac_cv___attribute__=yes],
+[ac_cv___attribute__=no])])
+if test "$ac_cv___attribute__" = "yes"; then
+ AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+fi
+AC_MSG_RESULT($ac_cv___attribute__)
+])
+
diff --git a/third_party/heimdal/cf/c-function.m4 b/third_party/heimdal/cf/c-function.m4
new file mode 100644
index 0000000..74ffd95
--- /dev/null
+++ b/third_party/heimdal/cf/c-function.m4
@@ -0,0 +1,33 @@
+dnl
+dnl $Id$
+dnl
+
+dnl
+dnl Test for __FUNCTION__
+dnl
+
+AC_DEFUN([AC_C___FUNCTION__], [
+AC_MSG_CHECKING(for __FUNCTION__)
+AC_CACHE_VAL(ac_cv___function__, [
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <string.h>
+
+static char *foo(void)
+{
+ return __FUNCTION__;
+}
+
+int main(int argc, char **argc)
+{
+ return strcmp(foo(), "foo") != 0;
+}
+]])],
+[ac_cv___function__=yes],
+[ac_cv___function__=no],
+[ac_cv___function__=no])])
+if test "$ac_cv___function__" = "yes"; then
+ AC_DEFINE(HAVE___FUNCTION__, 1, [define if your compiler has __FUNCTION__])
+fi
+AC_MSG_RESULT($ac_cv___function__)
+])
+
diff --git a/third_party/heimdal/cf/check-compile-et.m4 b/third_party/heimdal/cf/check-compile-et.m4
new file mode 100644
index 0000000..e580cbb
--- /dev/null
+++ b/third_party/heimdal/cf/check-compile-et.m4
@@ -0,0 +1,114 @@
+dnl $Id$
+dnl
+dnl CHECK_COMPILE_ET
+AC_DEFUN([CHECK_COMPILE_ET], [
+
+AC_CHECK_PROG(COMPILE_ET, compile_et, [compile_et], [no])
+
+krb_cv_compile_et="no"
+krb_cv_com_err_need_r=""
+krb_cv_compile_et_cross=no
+if test "${COMPILE_ET}" != "no"; then
+
+dnl We have compile_et. Now let's see if it supports `prefix' and `index'.
+AC_MSG_CHECKING(whether compile_et has the features we need)
+cat > conftest_et.et <<'EOF'
+error_table test conf
+prefix CONFTEST
+index 1
+error_code CODE1, "CODE1"
+index 128
+error_code CODE2, "CODE2"
+end
+EOF
+if ${COMPILE_ET} conftest_et.et >/dev/null 2>&1; then
+ dnl XXX Some systems have <et/com_err.h>.
+ save_CPPFLAGS="${CPPFLAGS}"
+ if test -d "/usr/include/et"; then
+ CPPFLAGS="-I/usr/include/et ${CPPFLAGS}"
+ fi
+ dnl Check that the `prefix' and `index' directives were honored.
+ AC_LANG(C)
+ AC_RUN_IFELSE([AC_LANG_SOURCE([
+#include <com_err.h>
+#include <string.h>
+#include "conftest_et.h"
+int main(int argc, char **argv){
+#ifndef ERROR_TABLE_BASE_conf
+#error compile_et does not handle error_table N M
+#endif
+return (CONFTEST_CODE2 - CONFTEST_CODE1) != 127;}
+ ])], [krb_cv_compile_et="yes"],[CPPFLAGS="${save_CPPFLAGS}"],
+ [krb_cv_compile_et="yes" krb_cv_compile_et_cross=yes] )
+fi
+AC_MSG_RESULT(${krb_cv_compile_et})
+if test "${krb_cv_compile_et}" = "yes" -a "${krb_cv_compile_et_cross}" = no; then
+ AC_MSG_CHECKING([for if com_err generates a initialize_conf_error_table_r])
+ AC_EGREP_CPP([initialize_conf_error_table_r.*struct et_list],
+ [#include "conftest_et.h"],
+ [krb_cv_com_err_need_r="ok"])
+ if test X"$krb_cv_com_err_need_r" = X ; then
+ AC_MSG_RESULT(no)
+ krb_cv_compile_et=no
+ else
+ AC_MSG_RESULT(yes)
+ fi
+fi
+rm -fr conftest*
+fi
+
+if test "${krb_cv_compile_et_cross}" = yes ; then
+ krb_cv_com_err="cross"
+elif test "${krb_cv_compile_et}" = "yes"; then
+ dnl Since compile_et seems to work, let's check libcom_err
+ krb_cv_save_LIBS="${LIBS}"
+ LIBS="${LIBS} -lcom_err"
+ AC_MSG_CHECKING(for com_err)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <com_err.h>]],[[
+ const char *p;
+ p = error_message(0);
+ initialize_error_table_r(0,0,0,0);
+ com_right_r(0, 0, 0, 0);
+ ]])],[krb_cv_com_err="yes"],[krb_cv_com_err="no"; CPPFLAGS="${save_CPPFLAGS}"])
+ AC_MSG_RESULT(${krb_cv_com_err})
+ LIBS="${krb_cv_save_LIBS}"
+else
+ dnl Since compile_et doesn't work, forget about libcom_err
+ krb_cv_com_err="no"
+fi
+
+dnl Only use the system's com_err if we found compile_et, libcom_err, and
+dnl com_err.h.
+if test "${krb_cv_com_err}" = "yes"; then
+ DIR_com_err=""
+ LIB_com_err="-lcom_err"
+ LIB_com_err_a=""
+ LIB_com_err_so=""
+ AC_MSG_NOTICE(Using the already-installed com_err)
+ COMPILE_ET="${ac_cv_prog_COMPILE_ET}"
+ localcomerr=no
+elif test "${krb_cv_com_err}" = "cross"; then
+ DIR_com_err="com_err"
+ LIB_com_err="\$(top_builddir)/lib/com_err/libcom_err.la"
+ LIB_com_err_a="\$(top_builddir)/lib/com_err/.libs/libcom_err.a"
+ LIB_com_err_so="\$(top_builddir)/lib/com_err/.libs/libcom_err.so"
+ AC_MSG_NOTICE(Using our own com_err with toolchain compile_et)
+ COMPILE_ET="${ac_cv_prog_COMPILE_ET}"
+ localcomerr=yes
+else
+ COMPILE_ET="\$(top_builddir)/lib/com_err/compile_et"
+ DIR_com_err="com_err"
+ LIB_com_err="\$(top_builddir)/lib/com_err/libcom_err.la"
+ LIB_com_err_a="\$(top_builddir)/lib/com_err/.libs/libcom_err.a"
+ LIB_com_err_so="\$(top_builddir)/lib/com_err/.libs/libcom_err.so"
+ AC_MSG_NOTICE(Using our own com_err)
+ localcomerr=yes
+fi
+AM_CONDITIONAL(COM_ERR, test "$localcomerr" = yes)dnl
+AC_SUBST(COMPILE_ET)
+AC_SUBST(DIR_com_err)
+AC_SUBST(LIB_com_err)
+AC_SUBST(LIB_com_err_a)
+AC_SUBST(LIB_com_err_so)
+
+])
diff --git a/third_party/heimdal/cf/check-compile-flag.m4 b/third_party/heimdal/cf/check-compile-flag.m4
new file mode 100644
index 0000000..bd753b3
--- /dev/null
+++ b/third_party/heimdal/cf/check-compile-flag.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the current language's compiler
+# or gives an error. (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 6
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/third_party/heimdal/cf/check-getpwnam_r-posix.m4 b/third_party/heimdal/cf/check-getpwnam_r-posix.m4
new file mode 100644
index 0000000..0e9167f
--- /dev/null
+++ b/third_party/heimdal/cf/check-getpwnam_r-posix.m4
@@ -0,0 +1,74 @@
+dnl $Id$
+dnl
+dnl check for getpwnam_r, and if it's posix or not; also check for getpwuid_r
+
+AC_DEFUN([AC_CHECK_GETPWNAM_R_POSIX],[
+AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
+if test "$ac_cv_func_getpwnam_r" = yes; then
+ AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
+ ac_libs="$LIBS"
+ LIBS="$LIBS $LIB_getpwnam_r"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#define _POSIX_PTHREAD_SEMANTICS
+#include <pwd.h>
+int main(int argc, char **argv)
+{
+ struct passwd pw, *pwd;
+ return getpwnam_r("", &pw, 0, 0, &pwd) < 0;
+}
+]])],[ac_cv_func_getpwnam_r_posix=yes],[ac_cv_func_getpwnam_r_posix=no],[:])
+LIBS="$ac_libs")
+ AC_CACHE_CHECK(if _POSIX_PTHREAD_SEMANTICS is needed,ac_cv_func_getpwnam_r_posix_def,
+ ac_libs="$LIBS"
+ LIBS="$LIBS $LIB_getpwnam_r"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <pwd.h>
+int main(int argc, char **argv)
+{
+ struct passwd pw, *pwd;
+ return getpwnam_r("", &pw, 0, 0, &pwd) < 0;
+}
+]])],[ac_cv_func_getpwnam_r_posix_def=no],[ac_cv_func_getpwnam_r_posix_def=yes],[:])
+LIBS="$ac_libs")
+if test "$ac_cv_func_getpwnam_r_posix" = yes; then
+ AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
+fi
+if test "$ac_cv_func_getpwnam_r_posix" = yes -a "$ac_cv_func_getpwnam_r_posix_def" = yes; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to get POSIX getpwnam_r in some systems.])
+fi
+fi
+])
+
+AC_DEFUN([AC_CHECK_GETPWUID_R_POSIX],[
+AC_FIND_FUNC_NO_LIBS(getpwuid_r,c_r)
+if test "$ac_cv_func_getpwuid_r" = yes; then
+ AC_CACHE_CHECK(if getpwuid_r is posix,ac_cv_func_getpwuid_r_posix,
+ ac_libs="$LIBS"
+ LIBS="$LIBS $LIB_getpwuid_r"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#define _POSIX_PTHREAD_SEMANTICS
+#include <pwd.h>
+int main(int argc, char **argv)
+{
+ struct passwd pw, *pwd;
+ return getpwuid_r(0, &pw, 0, 0, &pwd) < 0;
+}
+]])],[ac_cv_func_getpwuid_r_posix=yes],[ac_cv_func_getpwuid_r_posix=no],[:])
+LIBS="$ac_libs")
+ AC_CACHE_CHECK(if _POSIX_PTHREAD_SEMANTICS is needed,ac_cv_func_getpwuid_r_posix_def,
+ ac_libs="$LIBS"
+ LIBS="$LIBS $LIB_getpwuid_r"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <pwd.h>
+int main(int argc, char **argv)
+{
+ struct passwd pw, *pwd;
+ return getpwuid_r("", &pw, 0, 0, &pwd) < 0;
+}
+]])],[ac_cv_func_getpwuid_r_posix_def=no],[ac_cv_func_getpwuid_r_posix_def=yes],[:])
+LIBS="$ac_libs")
+if test "$ac_cv_func_getpwuid_r_posix" = yes; then
+ AC_DEFINE(POSIX_GETPWUID_R, 1, [Define if getpwuid_r has POSIX flavour.])
+fi
+fi
+])
diff --git a/third_party/heimdal/cf/check-man.m4 b/third_party/heimdal/cf/check-man.m4
new file mode 100644
index 0000000..ad013a4
--- /dev/null
+++ b/third_party/heimdal/cf/check-man.m4
@@ -0,0 +1,57 @@
+dnl $Id$
+dnl check how to format manual pages
+dnl
+
+AC_DEFUN([rk_CHECK_MAN],
+[AC_PATH_PROG(NROFF, nroff)
+AC_PATH_PROG(GROFF, groff)
+AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
+[cat > conftest.1 << END
+.Dd January 1, 1970
+.Dt CONFTEST 1
+.Sh NAME
+.Nm conftest
+.Nd foobar
+END
+
+if test "$NROFF" ; then
+ for i in "-mdoc" "-mandoc"; do
+ if "$NROFF" $i conftest.1 2> /dev/null | \
+ grep Jan > /dev/null 2>&1 ; then
+ ac_cv_sys_man_format="$NROFF $i"
+ break
+ fi
+ done
+fi
+if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
+ for i in "-mdoc" "-mandoc"; do
+ if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
+ grep Jan > /dev/null 2>&1 ; then
+ ac_cv_sys_man_format="$GROFF -Tascii $i"
+ break
+ fi
+ done
+fi
+if test "$ac_cv_sys_man_format"; then
+ ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
+fi
+])
+if test "$ac_cv_sys_man_format"; then
+ CATMAN="$ac_cv_sys_man_format"
+ AC_SUBST(CATMAN)
+fi
+AM_CONDITIONAL(CATMAN, test "$CATMAN")
+AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
+[if grep _suffix /etc/man.conf > /dev/null 2>&1; then
+ ac_cv_sys_catman_ext=0
+else
+ ac_cv_sys_catman_ext=number
+fi
+])
+if test "$ac_cv_sys_catman_ext" = number; then
+ CATMANEXT='$$section'
+else
+ CATMANEXT=0
+fi
+AC_SUBST(CATMANEXT)
+])
diff --git a/third_party/heimdal/cf/check-netinet-ip-and-tcp.m4 b/third_party/heimdal/cf/check-netinet-ip-and-tcp.m4
new file mode 100644
index 0000000..65c5f64
--- /dev/null
+++ b/third_party/heimdal/cf/check-netinet-ip-and-tcp.m4
@@ -0,0 +1,33 @@
+dnl
+dnl $Id$
+dnl
+
+dnl extra magic check for netinet/{ip.h,tcp.h} because on irix 6.5.3
+dnl you have to include standards.h before including these files
+
+AC_DEFUN([CHECK_NETINET_IP_AND_TCP],
+[
+AC_CHECK_HEADERS(standards.h)
+for i in netinet/ip.h netinet/tcp.h; do
+
+cv=`echo "$i" | sed 'y%./+-%__p_%'`
+
+AC_CACHE_CHECK([for $i],ac_cv_header_$cv,
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_STANDARDS_H
+#include <standards.h>
+#endif
+#include <$i>
+]])],
+[eval "ac_cv_header_$cv=yes"],
+[eval "ac_cv_header_$cv=no"])])
+ac_res=`eval echo \\$ac_cv_header_$cv`
+if test "$ac_res" = yes; then
+ ac_tr_hdr=HAVE_`echo $i | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
+fi
+done
+if false;then
+ AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h)
+fi
+])
diff --git a/third_party/heimdal/cf/check-type-extra.m4 b/third_party/heimdal/cf/check-type-extra.m4
new file mode 100644
index 0000000..f881120
--- /dev/null
+++ b/third_party/heimdal/cf/check-type-extra.m4
@@ -0,0 +1,23 @@
+dnl $Id$
+dnl
+dnl ac_check_type + extra headers
+
+dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS)
+AC_DEFUN([AC_CHECK_TYPE_EXTRA],
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(ac_cv_type_$1,
+[AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<$1[^a-zA-Z_0-9]>>dnl
+changequote([,]), [#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+$3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
+AC_MSG_RESULT($ac_cv_type_$1)
+if test $ac_cv_type_$1 = no; then
+ AC_DEFINE($1, $2, [Define this to what the type $1 should be.])
+fi
+])
diff --git a/third_party/heimdal/cf/check-var.m4 b/third_party/heimdal/cf/check-var.m4
new file mode 100644
index 0000000..71d6f70
--- /dev/null
+++ b/third_party/heimdal/cf/check-var.m4
@@ -0,0 +1,28 @@
+dnl $Id$
+dnl
+dnl rk_CHECK_VAR(variable, includes)
+AC_DEFUN([rk_CHECK_VAR], [
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(ac_cv_var_$1, [
+m4_ifval([$2],[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2
+ void * foo(void) { return &$1; }]],[[foo()]])],
+ [ac_cv_var_$1=yes],[ac_cv_var_$1=no])])
+if test "$ac_cv_var_$1" != yes ; then
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2
+extern int $1;
+int foo(void) { return $1; }]],[[foo()]])],
+ [ac_cv_var_$1=yes],[ac_cv_var_$1=no])
+fi
+])
+ac_foo=`eval echo \\$ac_cv_var_$1`
+AC_MSG_RESULT($ac_foo)
+if test "$ac_foo" = yes; then
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1,
+ [Define if you have the `]$1[' variable.])
+ m4_ifval([$2], [AC_CHECK_DECLS([$1],[],[],[$2])])
+fi
+])
+
+AC_WARNING_ENABLE([obsolete])
+AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo])
diff --git a/third_party/heimdal/cf/crypto.m4 b/third_party/heimdal/cf/crypto.m4
new file mode 100644
index 0000000..b8b011d
--- /dev/null
+++ b/third_party/heimdal/cf/crypto.m4
@@ -0,0 +1,166 @@
+dnl $Id$
+dnl
+dnl test for crypto libraries:
+dnl - libcrypto (from openssl)
+dnl - own-built libhcrypto
+
+m4_define([test_headers], [
+ #undef KRB5 /* makes md4.h et al unhappy */
+ #ifdef HAVE_HCRYPTO_W_OPENSSL
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <openssl/evp.h>
+ #include <openssl/bn.h>
+ #include <openssl/md4.h>
+ #include <openssl/md5.h>
+ #include <openssl/sha.h>
+ #include <openssl/des.h>
+ #include <openssl/rc4.h>
+ #include <openssl/aes.h>
+ #include <openssl/rsa.h>
+ #include <openssl/dsa.h>
+ #include <openssl/dh.h>
+ #include <openssl/ec.h>
+ #include <openssl/engine.h>
+ #include <openssl/ui.h>
+ #include <openssl/rand.h>
+ #include <openssl/hmac.h>
+ #include <openssl/pkcs12.h>
+ #else
+ #include <hcrypto/evp.h>
+ #include <hcrypto/md4.h>
+ #include <hcrypto/md5.h>
+ #include <hcrypto/sha.h>
+ #include <hcrypto/des.h>
+ #include <hcrypto/rc4.h>
+ #include <hcrypto/aes.h>
+ #include <hcrypto/engine.h>
+ #include <hcrypto/hmac.h>
+ #include <hcrypto/pkcs12.h>
+ #endif
+ ])
+m4_define([test_body], [
+ void *schedule = 0;
+ EVP_MD_CTX mdctx;
+
+ EVP_md4();
+ EVP_md5();
+ EVP_sha1();
+ EVP_sha256();
+
+ EVP_MD_CTX_init(&mdctx);
+ EVP_DigestInit_ex(&mdctx, EVP_sha1(), (ENGINE *)0);
+ EVP_CIPHER_iv_length(((EVP_CIPHER*)0));
+ UI_UTIL_read_pw_string(0,0,0,0);
+ RAND_status();
+ #ifdef HAVE_HCRYPTO_W_OPENSSL
+ EC_KEY_new();
+ #endif
+
+ OpenSSL_add_all_algorithms();
+ AES_encrypt(0,0,0);
+ DES_cbc_encrypt(0, 0, 0, schedule, 0, 0);
+ RC4(0, 0, 0, 0);])
+
+AC_DEFUN([KRB_CRYPTO],[
+AC_ARG_WITH([hcrypto-default-backend],
+ AS_HELP_STRING([--with-hcrypto-default-backend=cc|pkcs11_hcrypto|ossl|w32crypto|hcrypto],
+ [specify the default hcrypto backend]),
+ [
+ CFLAGS="${CFLAGS} -DHCRYPTO_DEF_PROVIDER=${withval}"
+ case "$withval" in
+ cc) AC_DEFINE(HCRYPTO_DEF_PROVIDER, [cc], [Define to one of cc, pkcs11, ossl, w32crypto, or hcrypto to set a default hcrypto provider]);;
+ pkcs11_hcrypto) AC_DEFINE(HCRYPTO_DEF_PROVIDER, [pkcs11_hcrypto], [Define to one of cc, pkcs11, ossl, w32crypto, or hcrypto to set a default hcrypto provider]);;
+ ossl) AC_DEFINE(HCRYPTO_DEF_PROVIDER, [ossl], [Define to one of cc, pkcs11, ossl, w32crypto, or hcrypto to set a default hcrypto provider]);;
+ w32crypto) AC_DEFINE(HCRYPTO_DEF_PROVIDER, [w32crypto], [Define to one of cc, pkcs11, ossl, w32crypto, or hcrypto to set a default hcrypto provider]);;
+ hcrypto) AC_DEFINE(HCRYPTO_DEF_PROVIDER, [hcrypto], [Define to one of cc, pkcs11, ossl, w32crypto, or hcrypto to set a default hcrypto provider]);;
+ *) echo "Invalid hcrypto provider name ($withval)"; exit 5;;
+ esac
+ ],
+ [])
+AC_ARG_WITH([hcrypto-fallback],
+ AS_HELP_STRING([--without-hcrypto-fallback],
+ [disable fallback on hcrypto for unavailable algorithms]),
+ [AC_DEFINE([HCRYPTO_FALLBACK],0,[Set to 1 to allow fallback to hcrypto for unavailable algorithms])],
+ [AC_DEFINE([HCRYPTO_FALLBACK],1,[Set to 1 to allow fallback to hcrypto for unavailable algorithms])])
+AC_WITH_ALL([openssl])
+
+AC_MSG_CHECKING([for crypto library])
+
+openssl=no
+
+if test "$with_openssl" = "yes"; then
+ with_openssl=/usr
+fi
+if test "$with_openssl" != "no"; then
+ saved_CFLAGS="${CFLAGS}"
+ saved_LDFLAGS="${LDFLAGS}"
+ INCLUDE_openssl_crypto=
+ LIB_openssl_crypto=
+ if test "$with_openssl_include" != ""; then
+ INCLUDE_openssl_crypto="-I${with_openssl_include}"
+ else
+ INCLUDE_openssl_crypto="-I${with_openssl}/include"
+ fi
+ if test "$with_openssl_lib" != ""; then
+ LIB_openssl_crypto="-L${with_openssl_lib}"
+ elif test "${with_openssl}" != "/usr" -a -d "${with_openssl}/lib"; then
+ LIB_openssl_crypto="-L${with_openssl}/lib"
+ fi
+ CFLAGS="-DHAVE_HCRYPTO_W_OPENSSL ${INCLUDE_openssl_crypto} ${CFLAGS}"
+ LDFLAGS="${LIB_openssl_crypto} ${LDFLAGS}"
+ AC_CHECK_LIB([crypto], [OPENSSL_init],
+ [LIB_openssl_crypto="${LIB_openssl_crypto} -lcrypto"; openssl=yes], [openssl=no], [])
+ # These cases are just for static linking on older OSes,
+ # presumably.
+ if test "$openssl" = "no"; then
+ AC_CHECK_LIB([crypto], [OPENSSL_init],
+ [LIB_openssl_crypto="${LIB_openssl_crypto} -lcrypto -ldl"; openssl=yes], [openssl=no], [-ldl])
+ fi
+ if test "$openssl" = "no"; then
+ AC_CHECK_LIB([crypto], [OPENSSL_init],
+ [LIB_openssl_crypto="${LIB_openssl_crypto} -lcrypto -ldl -lnsl"; openssl=yes], [openssl=no], [-ldl -lnsl])
+ fi
+ if test "$openssl" = "no"; then
+ AC_CHECK_LIB([crypto], [OPENSSL_init],
+ [LIB_openssl_crypto="${LIB_openssl_crypto} -lcrypto -ldl -lnsl -lsocket"; openssl=yes], [openssl=no], [-ldl -lnsl -lsocket])
+ fi
+ if test "$openssl" = "no"; then
+ INCLUDE_openssl_crypto=
+ LIB_openssl_crypto=
+ fi
+ CFLAGS="${saved_CFLAGS}"
+ LDFLAGS="${saved_LDFLAGS}"
+fi
+
+LIB_hcrypto='$(top_builddir)/lib/hcrypto/libhcrypto.la'
+LIB_hcrypto_a='$(top_builddir)/lib/hcrypto/.libs/libhcrypto.a'
+LIB_hcrypto_so='$(top_builddir)/lib/hcrypto/.libs/libhcrypto.so'
+LIB_hcrypto_appl="-lhcrypto"
+
+AC_MSG_RESULT([included libhcrypto])
+
+AC_ARG_WITH(pkcs11-module,
+ AS_HELP_STRING([--with-pkcs11-module=path],
+ [use PKCS11 module in path]),
+ [pkcs11_module="$withval"],
+ [])
+
+if test "$pkcs11_module" != ""; then
+ AC_DEFINE_UNQUOTED(PKCS11_MODULE_PATH, "$pkcs11_module", [path to PKCS11 module])
+ openssl=no
+fi
+
+if test "$openssl" = "yes"; then
+ AC_DEFINE([HAVE_HCRYPTO_W_OPENSSL], 1, [define to use openssl's libcrypto as the default backend for libhcrypto])
+fi
+AM_CONDITIONAL(HAVE_HCRYPTO_W_OPENSSL, test "$openssl" = yes)dnl
+
+AC_SUBST(INCLUDE_openssl_crypto)
+AC_SUBST(LIB_openssl_crypto)
+AC_SUBST(LIB_hcrypto)
+AC_SUBST(LIB_hcrypto_a)
+AC_SUBST(LIB_hcrypto_so)
+AC_SUBST(LIB_hcrypto_appl)
+])
diff --git a/third_party/heimdal/cf/db.m4 b/third_party/heimdal/cf/db.m4
new file mode 100644
index 0000000..c0b4510
--- /dev/null
+++ b/third_party/heimdal/cf/db.m4
@@ -0,0 +1,268 @@
+dnl $Id$
+dnl
+dnl tests for various db libraries
+dnl
+
+AC_DEFUN([rk_DB],[
+AC_ARG_WITH(db-type-preference,
+ AS_HELP_STRING([--with-db-type-preference=list],
+ [specify HDB backend DB type preference as whitespace-separated list of db1, db3, lmdb, and/or sqlite]),
+ [db_type_preference="$withval"],
+ [db_type_preference="lmdb db3 db1 sqlite"])
+AC_ARG_WITH(berkeley-db,
+ AS_HELP_STRING([--with-berkeley-db],
+ [enable support for berkeley db @<:@default=check@:>@]),
+ [],
+ [with_berkeley_db=check])
+
+dbheader=""
+AC_ARG_WITH(berkeley-db-include,
+ AS_HELP_STRING([--with-berkeley-db-include=dir],
+ [use berkeley-db headers in dir]),
+ [dbheader=$withval],
+ [with_berkeley_db_include=check])
+
+AC_ARG_ENABLE(ndbm-db,
+ AS_HELP_STRING([--disable-ndbm-db],
+ [if you don't want ndbm db]),[
+])
+
+AC_ARG_ENABLE(mdb-db,
+ AS_HELP_STRING([--disable-mdb-db],
+ [if you don't want LMDB]),[
+])
+
+have_db1=no
+have_db3=no
+have_lmdb=no
+db_type=unknown
+
+AS_IF([test "x$with_berkeley_db" != xno],
+ [AS_IF([test "x$with_berkeley_db_include" != xcheck],
+ [AC_CHECK_HEADERS(["$dbheader/db.h"],
+ [AC_SUBST([DBHEADER], [$dbheader])
+ AC_DEFINE([HAVE_DBHEADER], [1],
+ [Define if you have user supplied header location])
+ ],
+ [if test "x$with_berkeley_db_include" != xcheck; then
+ AC_MSG_FAILURE(
+ [--with-berkeley-db-include was given but include test failed])
+ fi
+ ])],
+ [AC_CHECK_HEADERS([ \
+ db6/db.h \
+ db5/db.h \
+ db4/db.h \
+ db3/db.h \
+ db.h \
+ ])])
+
+dnl db_create is used by db3 and db4 and db5 and db6
+
+ AC_FIND_FUNC_NO_LIBS(db_create, [$dbheader] db-6 db-5 db4 db3 db, [
+ #include <stdio.h>
+ #ifdef HAVE_DBHEADER
+ #include <$dbheader/db.h>
+ #elif HAVE_DB6_DB_H
+ #include <db6/db.h>
+ #elif HAVE_DB5_DB_H
+ #include <db5/db.h>
+ #elif HAVE_DB4_DB_H
+ #include <db4/db.h>
+ #elif defined(HAVE_DB3_DB_H)
+ #include <db3/db.h>
+ #else
+ #include <db.h>
+ #endif
+ ],[NULL, NULL, 0])
+
+ if test "$ac_cv_func_db_create" = "yes"; then
+ have_db3=yes
+ if test "$ac_cv_funclib_db_create" != "yes"; then
+ DB3LIB="$ac_cv_funclib_db_create"
+ else
+ DB3LIB=""
+ fi
+ AC_DEFINE(HAVE_DB3, 1, [define if you have a berkeley db3/4/5/6 library])
+ fi
+
+dnl dbopen is used by db1/db2
+
+ AC_FIND_FUNC_NO_LIBS(dbopen, db2 db, [
+ #include <stdio.h>
+ #if defined(HAVE_DB2_DB_H)
+ #include <db2/db.h>
+ #elif defined(HAVE_DB_H)
+ #include <db.h>
+ #else
+ #error no db.h
+ #endif
+ ],[NULL, 0, 0, 0, NULL])
+
+ if test "$ac_cv_func_dbopen" = "yes"; then
+ have_db1=yes
+ if test "$ac_cv_funclib_dbopen" != "yes"; then
+ DB1LIB="$ac_cv_funclib_dbopen"
+ else
+ DB1LIB=""
+ fi
+ AC_DEFINE(HAVE_DB1, 1, [define if you have a berkeley db1/2 library])
+ fi
+
+dnl test for ndbm compatability
+
+ if test "$ac_cv_func_dbm_firstkey" != yes; then
+ AC_FIND_FUNC_NO_LIBS2(dbm_firstkey, $ac_cv_funclib_dbopen $ac_cv_funclib_db_create, [
+ #include <stdio.h>
+ #define DB_DBM_HSEARCH 1
+ #include <db.h>
+ DBM *dbm;
+ ],[NULL])
+
+ if test "$ac_cv_func_dbm_firstkey" = "yes"; then
+ if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
+ NDBMLIB="$ac_cv_funclib_dbm_firstkey"
+ else
+ NDBMLIB=""
+ fi
+ AC_DEFINE(HAVE_DB_NDBM, 1, [define if you have ndbm compat in db])
+ AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])
+ else
+ $as_unset ac_cv_func_dbm_firstkey
+ $as_unset ac_cv_funclib_dbm_firstkey
+ fi
+ fi
+
+]) # fi berkeley db
+
+
+AS_IF([test "x$enable_mdb_db" != xno],
+ [AC_CHECK_HEADER(lmdb.h, [
+ AC_CHECK_LIB(lmdb, mdb_env_create, have_lmdb=yes; LMDBLIB="-llmdb"
+ AC_DEFINE(HAVE_LMDB, 1, [define if you have the LMDB library]))])])
+
+for db_type in unknown $db_type_preference; do
+ if eval test \"x\$have_${db_type}\" = xyes -o ${db_type} = sqlite; then
+ break
+ fi
+ db_type=unknown
+done
+
+AS_IF([test "x$have_db3" = xyes -a "$db_type" = unknown], db_type=db3, db_type="$db_type")
+AS_IF([test "x$have_db1" = xyes -a "$db_type" = unknown], db_type=db1, db_type="$db_type")
+AS_IF([test "x$have_lmdb" = xyes -a "$db_type" = unknown], db_type=lmdb, db_type="$db_type")
+
+if test "$enable_ndbm_db" != "no"; then
+
+ if test "$db_type" = "unknown" -o "$ac_cv_func_dbm_firstkey" = ""; then
+
+ AC_CHECK_HEADERS([ \
+ dbm.h \
+ ndbm.h \
+ ])
+
+ AC_FIND_FUNC_NO_LIBS(dbm_firstkey, ndbm, [
+ #include <stdio.h>
+ #if defined(HAVE_NDBM_H)
+ #include <ndbm.h>
+ #elif defined(HAVE_DBM_H)
+ #include <dbm.h>
+ #endif
+ DBM *dbm;
+ ],[NULL])
+
+ if test "$ac_cv_func_dbm_firstkey" = "yes"; then
+ if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
+ NDBMLIB="$ac_cv_funclib_dbm_firstkey"
+ else
+ NDBMLIB=""
+ fi
+ AC_DEFINE(HAVE_NDBM, 1, [define if you have a ndbm library])dnl
+ have_ndbm=yes
+ else
+
+ $as_unset ac_cv_func_dbm_firstkey
+ $as_unset ac_cv_funclib_dbm_firstkey
+
+ AC_CHECK_HEADERS([ \
+ gdbm/ndbm.h \
+ ])
+
+ AC_FIND_FUNC_NO_LIBS(dbm_firstkey, gdbm, [
+ #include <stdio.h>
+ #include <gdbm/ndbm.h>
+ DBM *dbm;
+ ],[NULL])
+
+ if test "$ac_cv_func_dbm_firstkey" = "yes"; then
+ if test "$ac_cv_funclib_dbm_firstkey" != "yes"; then
+ NDBMLIB="$ac_cv_funclib_dbm_firstkey"
+ else
+ NDBMLIB=""
+ fi
+ AC_DEFINE(HAVE_NDBM, 1, [define if you have a ndbm library])dnl
+ have_ndbm=yes
+ if test "$db_type" = "unknown"; then
+ db_type=ndbm
+ fi
+ fi
+ fi
+ fi #enable_ndbm_db
+fi # unknown
+
+if test "$have_ndbm" = "yes"; then
+ AC_MSG_CHECKING([if ndbm is implemented with db])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <fcntl.h>
+#if defined(HAVE_GDBM_NDBM_H)
+#include <gdbm/ndbm.h>
+#elif defined(HAVE_NDBM_H)
+#include <ndbm.h>
+#elif defined(HAVE_DBM_H)
+#include <dbm.h>
+#endif
+int main(int argc, char **argv)
+{
+ DBM *d;
+
+ d = dbm_open("conftest", O_RDWR | O_CREAT, 0666);
+ if (d == NULL)
+ return 1;
+ dbm_close(d);
+ return 0;
+}]])],[
+ if test -f conftest.db; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files *.db)])
+ else
+ AC_MSG_RESULT([no])
+ fi],[AC_MSG_RESULT([no])],[AC_MSG_RESULT([no-cross])])
+fi
+
+AM_CONDITIONAL(HAVE_DB1, test "$have_db1" = yes)dnl
+AM_CONDITIONAL(HAVE_DB3, test "$have_db3" = yes)dnl
+AM_CONDITIONAL(HAVE_LMDB, test "$have_lmdb" = yes)dnl
+AM_CONDITIONAL(HAVE_NDBM, test "$have_ndbm" = yes)dnl
+AM_CONDITIONAL(HAVE_DBHEADER, test "$dbheader" != "")dnl
+
+## it's probably not correct to include LDFLAGS here, but we might
+## need it, for now just add any possible -L
+z=""
+for i in $LDFLAGS; do
+ case "$i" in
+ -L*) z="$z $i";;
+ esac
+done
+DB3LIB="$z $DB3LIB"
+DB1LIB="$z $DB1LIB"
+LMDBLIB="$z $LMDBLIB"
+NDMBLIB="$z $NDBMLIB"
+AC_SUBST(DB3LIB)dnl
+AC_SUBST(DB1LIB)dnl
+AC_SUBST(LMDBLIB)dnl
+AC_SUBST(NDBMLIB)dnl
+AC_SUBST(NDBMLIB)dnl
+AC_SUBST(db_type)dnl
+AC_SUBST(db_type_preference)dnl
+])
diff --git a/third_party/heimdal/cf/destdirs.m4 b/third_party/heimdal/cf/destdirs.m4
new file mode 100644
index 0000000..36baafd
--- /dev/null
+++ b/third_party/heimdal/cf/destdirs.m4
@@ -0,0 +1,18 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([rk_DESTDIRS], [
+# This is done by AC_OUTPUT but we need the result here.
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+AC_FOREACH([rk_dir], [bin lib libexec localstate sbin sysconf], [
+ x="${rk_dir[]dir}"
+ eval y="$x"
+ while test "x$y" != "x$x"; do
+ x="$y"
+ eval y="$x"
+ done
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(rk_dir[]dir), "$x", [path to ]rk_dir[])])
+])
diff --git a/third_party/heimdal/cf/dispatch.m4 b/third_party/heimdal/cf/dispatch.m4
new file mode 100644
index 0000000..76c5f47
--- /dev/null
+++ b/third_party/heimdal/cf/dispatch.m4
@@ -0,0 +1,23 @@
+
+AC_DEFUN([rk_LIBDISPATCH],[
+
+AC_CHECK_PROGS(GCD_MIG, mig, no)
+
+if test "$GCD_MIG" != no; then
+ AC_CHECK_HEADERS([dispatch/dispatch.h])
+ AC_FIND_FUNC_NO_LIBS(dispatch_async_f, dispatch,
+ [#ifdef HAVE_DISPATCH_DISPATCH_H
+ #include <dispatch/dispatch.h>
+ #endif],[0,0,0])
+
+ if test "$ac_cv_func_dispatch_async_f" = yes -a "$GCD_MIG" != no; then
+ AC_DEFINE([HAVE_GCD], 1, [Define if os support gcd.])
+ libdispatch=yes
+ else
+ libdispatch=no
+ fi
+
+fi
+AM_CONDITIONAL(have_gcd, test "$libdispatch" = yes -a "$GCD_MIG" != no)
+
+])
diff --git a/third_party/heimdal/cf/dlopen.m4 b/third_party/heimdal/cf/dlopen.m4
new file mode 100644
index 0000000..1756843
--- /dev/null
+++ b/third_party/heimdal/cf/dlopen.m4
@@ -0,0 +1,19 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([rk_DLOPEN], [
+ AC_FIND_FUNC_NO_LIBS(dlopen, dl,[
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif],[0,0])
+ AM_CONDITIONAL(HAVE_DLOPEN, test "$ac_cv_funclib_dlopen" != no)
+])
+
+AC_DEFUN([rk_DLADDR], [
+ AC_FIND_FUNC_NO_LIBS(dladdr, dl,[
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif],[0,0])
+ AM_CONDITIONAL(HAVE_DLADDR, test "$ac_cv_funclib_dladdr" != no)
+])
diff --git a/third_party/heimdal/cf/find-func-no-libs.m4 b/third_party/heimdal/cf/find-func-no-libs.m4
new file mode 100644
index 0000000..f341340
--- /dev/null
+++ b/third_party/heimdal/cf/find-func-no-libs.m4
@@ -0,0 +1,9 @@
+dnl $Id$
+dnl
+dnl
+dnl Look for function in any of the specified libraries
+dnl
+
+dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args)
+AC_DEFUN([AC_FIND_FUNC_NO_LIBS], [
+AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])])
diff --git a/third_party/heimdal/cf/find-func-no-libs2.m4 b/third_party/heimdal/cf/find-func-no-libs2.m4
new file mode 100644
index 0000000..5e5ed0e
--- /dev/null
+++ b/third_party/heimdal/cf/find-func-no-libs2.m4
@@ -0,0 +1,62 @@
+dnl $Id$
+dnl
+dnl
+dnl Look for function in any of the specified libraries
+dnl
+
+dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
+AC_DEFUN([AC_FIND_FUNC_NO_LIBS2], [
+
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(ac_cv_funclib_$1,
+[
+if eval "test \"\$ac_cv_func_$1\" != yes" ; then
+ ac_save_LIBS="$LIBS"
+ for ac_lib in $2; do
+ case "$ac_lib" in
+ "") ;;
+ yes) ac_lib="" ;;
+ no) continue ;;
+ -l*) ;;
+ *) ac_lib="-l$ac_lib" ;;
+ esac
+ LIBS="$6 $ac_lib $5 $ac_save_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$3]],[[$1($4)]])],[eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break])
+ done
+ eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
+ LIBS="$ac_save_LIBS"
+fi
+])
+
+eval "ac_res=\$ac_cv_funclib_$1"
+
+if false; then
+ AC_CHECK_FUNCS($1)
+dnl AC_CHECK_LIBS($2, foo)
+fi
+# $1
+eval "ac_tr_func=HAVE_[]upcase($1)"
+eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
+eval "LIB_$1=$ac_res"
+
+case "$ac_res" in
+ yes)
+ eval "ac_cv_func_$1=yes"
+ eval "LIB_$1="
+ AC_DEFINE_UNQUOTED($ac_tr_func)
+ AC_MSG_RESULT([yes])
+ ;;
+ no)
+ eval "ac_cv_func_$1=no"
+ eval "LIB_$1="
+ AC_MSG_RESULT([no])
+ ;;
+ *)
+ eval "ac_cv_func_$1=yes"
+ AC_DEFINE_UNQUOTED($ac_tr_func)
+ AC_DEFINE_UNQUOTED($ac_tr_lib)
+ AC_MSG_RESULT([yes, in $ac_res])
+ ;;
+esac
+AC_SUBST(LIB_$1)
+])
diff --git a/third_party/heimdal/cf/find-func.m4 b/third_party/heimdal/cf/find-func.m4
new file mode 100644
index 0000000..865772a
--- /dev/null
+++ b/third_party/heimdal/cf/find-func.m4
@@ -0,0 +1,9 @@
+dnl $Id$
+dnl
+dnl AC_FIND_FUNC(func, libraries, includes, arguments)
+AC_DEFUN([AC_FIND_FUNC], [
+AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4])
+if test -n "$LIB_$1"; then
+ LIBS="$LIB_$1 $LIBS"
+fi
+])
diff --git a/third_party/heimdal/cf/find-if-not-broken.m4 b/third_party/heimdal/cf/find-if-not-broken.m4
new file mode 100644
index 0000000..1397616
--- /dev/null
+++ b/third_party/heimdal/cf/find-if-not-broken.m4
@@ -0,0 +1,12 @@
+dnl $Id$
+dnl
+dnl
+dnl Mix between AC_FIND_FUNC and AC_BROKEN
+dnl
+
+AC_DEFUN([AC_FIND_IF_NOT_BROKEN],
+[AC_FIND_FUNC([$1], [$2], [$3], [$4])
+if eval "test \"$ac_cv_func_$1\" != yes"; then
+ rk_LIBOBJ([$1])
+fi
+])
diff --git a/third_party/heimdal/cf/framework-corefoundation.m4 b/third_party/heimdal/cf/framework-corefoundation.m4
new file mode 100644
index 0000000..a23c4c7
--- /dev/null
+++ b/third_party/heimdal/cf/framework-corefoundation.m4
@@ -0,0 +1,28 @@
+AC_DEFUN([rk_FRAMEWORK_COREFOUNDATION], [
+
+AC_MSG_CHECKING([for framework CoreFoundation])
+AC_CACHE_VAL(rk_cv_framework_corefoundation,
+[
+if test "$rk_cv_framework_corefoundation" != yes; then
+ ac_save_LIBS="$LIBS"
+ LIBS="$ac_save_LIBS -framework CoreFoundation"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CoreFoundation.h>
+]],
+[[CFURLRef url;
+char path[] = "/";
+url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8 *)
+path, strlen(path), FALSE);
+CFRelease(url);
+]])],[rk_cv_framework_corefoundation=yes])
+ LIBS="$ac_save_LIBS"
+fi
+])
+
+if test "$rk_cv_framework_corefoundation" = yes; then
+ AC_DEFINE(HAVE_FRAMEWORK_COREFOUNDATION, 1, [Have -framework CoreFoundation])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(FRAMEWORK_COREFOUNDATION, test "$rk_cv_framework_corefoundation" = yes)
+])
diff --git a/third_party/heimdal/cf/framework-security.m4 b/third_party/heimdal/cf/framework-security.m4
new file mode 100644
index 0000000..3358292
--- /dev/null
+++ b/third_party/heimdal/cf/framework-security.m4
@@ -0,0 +1,31 @@
+AC_DEFUN([rk_FRAMEWORK_SECURITY], [
+
+AC_MSG_CHECKING([for framework security])
+AC_CACHE_VAL(rk_cv_framework_security,
+[
+if test "$rk_cv_framework_security" != yes; then
+ ac_save_LIBS="$LIBS"
+ LIBS="$ac_save_LIBS -framework Security -framework CoreFoundation"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <Security/Security.h>
+]],
+[[SecKeychainSearchRef searchRef;
+SecKeychainSearchCreateFromAttributes(NULL,kSecCertificateItemClass,NULL, &searchRef);
+CFRelease(&searchRef);
+]])],[rk_cv_framework_security=yes])
+ LIBS="$ac_save_LIBS"
+fi
+])
+
+if test "$rk_cv_framework_security" = yes; then
+ AC_DEFINE(HAVE_FRAMEWORK_SECURITY, 1, [Have -framework Security])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(FRAMEWORK_SECURITY, test "$rk_cv_framework_security" = yes)
+
+if test "$rk_cv_framework_security" = yes; then
+ AC_NEED_PROTO([#include <Security/Security.h>],SecKeyGetCSPHandle)
+fi
+
+])
diff --git a/third_party/heimdal/cf/have-pragma-weak.m4 b/third_party/heimdal/cf/have-pragma-weak.m4
new file mode 100644
index 0000000..cd892bd
--- /dev/null
+++ b/third_party/heimdal/cf/have-pragma-weak.m4
@@ -0,0 +1,37 @@
+dnl $Id$
+dnl
+AC_DEFUN([AC_HAVE_PRAGMA_WEAK], [
+if test "${enable_shared}" = "yes"; then
+AC_MSG_CHECKING(for pragma weak)
+AC_CACHE_VAL(ac_have_pragma_weak, [
+ac_have_pragma_weak=no
+cat > conftest_foo.$ac_ext <<'EOF'
+[#]line __oline__ "configure"
+#include "confdefs.h"
+#pragma weak foo = _foo
+int _foo = 17;
+EOF
+cat > conftest_bar.$ac_ext <<'EOF'
+[#]line __oline__ "configure"
+#include "confdefs.h"
+extern int foo;
+
+int t(void) {
+ return foo;
+}
+
+int main(int argc, char **argv) {
+ return t();
+}
+EOF
+if AC_TRY_EVAL('CC -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest_foo.$ac_ext conftest_bar.$ac_ext 1>&AC_FD_CC'); then
+ac_have_pragma_weak=yes
+fi
+rm -rf conftest*
+])
+if test "$ac_have_pragma_weak" = "yes"; then
+ AC_DEFINE(HAVE_PRAGMA_WEAK, 1, [Define this if your compiler supports \`#pragma weak.'])dnl
+fi
+AC_MSG_RESULT($ac_have_pragma_weak)
+fi
+])
diff --git a/third_party/heimdal/cf/have-struct-field.m4 b/third_party/heimdal/cf/have-struct-field.m4
new file mode 100644
index 0000000..bb7bcef
--- /dev/null
+++ b/third_party/heimdal/cf/have-struct-field.m4
@@ -0,0 +1,21 @@
+dnl $Id$
+dnl
+dnl check for fields in a structure
+dnl
+dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
+
+AC_DEFUN([AC_HAVE_STRUCT_FIELD], [
+define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
+AC_CACHE_CHECK([for $2 in $1], cache_val,[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]],
+ [[$1 x; memset(&x, 0, sizeof(x)); x.$2]])],
+ [cache_val=yes],
+ [cache_val=no])
+])
+if test "$cache_val" = yes; then
+ define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
+ AC_DEFINE(foo, 1, [Define if $1 has field $2.])
+ undefine([foo])
+fi
+undefine([cache_val])
+])
diff --git a/third_party/heimdal/cf/have-type.m4 b/third_party/heimdal/cf/have-type.m4
new file mode 100644
index 0000000..4c533a6
--- /dev/null
+++ b/third_party/heimdal/cf/have-type.m4
@@ -0,0 +1,30 @@
+dnl $Id$
+dnl
+dnl check for existance of a type
+
+dnl AC_HAVE_TYPE(TYPE,INCLUDES)
+AC_DEFUN([AC_HAVE_TYPE], [
+AC_REQUIRE([AC_HEADER_STDC])
+cv=`echo "$1" | sed 'y%./+- %__p__%'`
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL([ac_cv_type_$cv],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+$2]],
+[[$1 foo;]])],
+[eval "ac_cv_type_$cv=yes"],
+[eval "ac_cv_type_$cv=no"]))dnl
+ac_foo=`eval echo \\$ac_cv_type_$cv`
+AC_MSG_RESULT($ac_foo)
+if test "$ac_foo" = yes; then
+ ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
+if false; then
+ AC_CHECK_TYPES($1)
+fi
+ AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
+fi
+])
diff --git a/third_party/heimdal/cf/have-types.m4 b/third_party/heimdal/cf/have-types.m4
new file mode 100644
index 0000000..7e6e493
--- /dev/null
+++ b/third_party/heimdal/cf/have-types.m4
@@ -0,0 +1,12 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([AC_HAVE_TYPES], [
+for i in $1; do
+ AC_HAVE_TYPE($i)
+done
+if false;then
+ AC_CHECK_FUNCS($1)
+fi
+])
diff --git a/third_party/heimdal/cf/install-catman.sh b/third_party/heimdal/cf/install-catman.sh
new file mode 100644
index 0000000..f1a2581
--- /dev/null
+++ b/third_party/heimdal/cf/install-catman.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# $Id$
+#
+# install preformatted manual pages
+
+cmd="$1"; shift
+INSTALL_DATA="$1"; shift
+mkinstalldirs="$1"; shift
+srcdir="$1"; shift
+manbase="$1"; shift
+suffix="$1"; shift
+catinstall="${INSTALL_CATPAGES-yes}"
+
+for f in "$@"; do
+ echo $f
+ base=`echo "$f" | sed 's~\.[^.]*$~~; s~.*/~~'`
+ section=`echo "$f" | sed 's/^[^.]*\.//'`
+ mandir="$manbase/man$section"
+ catdir="$manbase/cat$section"
+ c="$base.cat$section"
+
+ if test "$catinstall" = yes -a -f "$srcdir/$c"; then
+ if test "$cmd" = install ; then
+ if test \! -d "$catdir"; then
+ eval "$mkinstalldirs $catdir"
+ fi
+ eval "echo $INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
+ eval "$INSTALL_DATA $srcdir/$c $catdir/$base.$suffix"
+ elif test "$cmd" = uninstall ; then
+ eval "echo rm -f $catdir/$base.$suffix"
+ eval "rm -f $catdir/$base.$suffix"
+ fi
+ fi
+ for link in `sed -n -e '/SYNOPSIS/q;/DESCRIPTION/q;s/^\.Nm \([^ ]*\).*/\1/p' $srcdir/$f`; do
+ if test "$link" = "$base" ; then
+ continue
+ fi
+ if test "$cmd" = install ; then
+ target="$mandir/$link.$section"
+ for lncmd in "ln -f $mandir/$base.$section $target" \
+ "ln -s $base.$section $target" \
+ "cp -f $mandir/$base.$section $target"
+ do
+ if eval "$lncmd"; then
+ eval echo "$lncmd"
+ break
+ fi
+ done
+ if test "$catinstall" = yes -a -f "$srcdir/$c"; then
+ eval target="$catdir/$link.$suffix"
+ eval source="$catdir/$base.$suffix"
+ for lncmd in "ln -f $source $target" \
+ "ln -fs $source $target" \
+ "cp -f $catdir/$source $target"
+ do
+ if eval "$lncmd"; then
+ eval echo "$lncmd"
+ break
+ fi
+ done
+ fi
+ elif test "$cmd" = uninstall ; then
+ target="$mandir/$link.$section"
+ eval "echo rm -f $target"
+ eval "rm -f $target"
+ if test "$catinstall" = yes; then
+ target="$catdir/$link.$suffix"
+ eval "echo rm -f $target"
+ eval "rm -f $target"
+ fi
+ fi
+ done
+done
diff --git a/third_party/heimdal/cf/irix.m4 b/third_party/heimdal/cf/irix.m4
new file mode 100644
index 0000000..d2b0009
--- /dev/null
+++ b/third_party/heimdal/cf/irix.m4
@@ -0,0 +1,15 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([rk_IRIX],
+[
+irix=no
+case "$host" in
+*-*-irix*)
+ irix=yes
+ ;;
+esac
+AM_CONDITIONAL(IRIX, test "$irix" != no)dnl
+
+])
diff --git a/third_party/heimdal/cf/krb-bigendian.m4 b/third_party/heimdal/cf/krb-bigendian.m4
new file mode 100644
index 0000000..e803750
--- /dev/null
+++ b/third_party/heimdal/cf/krb-bigendian.m4
@@ -0,0 +1,62 @@
+dnl
+dnl $Id$
+dnl
+
+dnl check if this computer is little or big-endian
+dnl if we can figure it out at compile-time then don't define the cpp symbol
+dnl otherwise test for it and define it. also allow options for overriding
+dnl it when cross-compiling
+
+AC_DEFUN([KRB_C_BIGENDIAN], [
+AC_ARG_ENABLE(bigendian,
+ AS_HELP_STRING([--enable-bigendian],[the target is big endian]),
+krb_cv_c_bigendian=yes)
+AC_ARG_ENABLE(littleendian,
+ AS_HELP_STRING([--enable-littleendian],[the target is little endian]),
+krb_cv_c_bigendian=no)
+AC_CACHE_CHECK([whether byte order is known at compile time],
+krb_cv_c_bigendian_compile,
+[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/param.h>
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif]])],[krb_cv_c_bigendian_compile=yes],[krb_cv_c_bigendian_compile=no])])
+AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
+ if test "$krb_cv_c_bigendian_compile" = "yes"; then
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/param.h>
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif]])],[krb_cv_c_bigendian=yes],[krb_cv_c_bigendian=no])
+ else
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[main (int argc, char **argv) {
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long l;
+ char c[sizeof (long)];
+ } u;
+ u.l = 1;
+ exit (u.c[sizeof (long) - 1] == 1);
+ }]])],[krb_cv_c_bigendian=no],[krb_cv_c_bigendian=yes],
+ [AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])])
+ fi
+])
+if test "$krb_cv_c_bigendian" = "yes"; then
+ AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl
+fi
+if test "$krb_cv_c_bigendian_compile" = "yes"; then
+ AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl
+fi
+AH_BOTTOM([
+#ifdef ENDIANESS_IN_SYS_PARAM_H
+# include <sys/types.h>
+# include <sys/param.h>
+# if BYTE_ORDER == BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+# endif
+#endif
+])
+])
diff --git a/third_party/heimdal/cf/krb-func-getlogin.m4 b/third_party/heimdal/cf/krb-func-getlogin.m4
new file mode 100644
index 0000000..8adfddb
--- /dev/null
+++ b/third_party/heimdal/cf/krb-func-getlogin.m4
@@ -0,0 +1,32 @@
+dnl
+dnl $Id$
+dnl
+dnl test for POSIX (broken) getlogin
+dnl
+
+
+AC_DEFUN([AC_FUNC_GETLOGIN], [
+AC_CHECK_FUNCS(getlogin getlogin_r setlogin)
+if test "$ac_cv_func_getlogin" = yes; then
+AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
+if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
+ ac_cv_func_getlogin_posix=no
+else
+ ac_cv_func_getlogin_posix=yes
+fi
+])
+AC_CACHE_CHECK(if getlogin_r is posix, ac_cv_func_getlogin_r_posix, [
+if test "$ac_cv_func_getlogin_r" = yes -a "$ac_cv_func_setlogin" = yes; then
+ ac_cv_func_getlogin_r_posix=no
+else
+ ac_cv_func_getlogin_r_posix=yes
+fi
+])
+if test "$ac_cv_func_getlogin_posix" = yes; then
+ AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
+fi
+if test "$ac_cv_func_getlogin_r_posix" = yes; then
+ AC_DEFINE(POSIX_GETLOGIN_R, 1, [Define if getlogin_r has POSIX flavour (and not BSD).])
+fi
+fi
+])
diff --git a/third_party/heimdal/cf/krb-ipv6.m4 b/third_party/heimdal/cf/krb-ipv6.m4
new file mode 100644
index 0000000..4fbe2d6
--- /dev/null
+++ b/third_party/heimdal/cf/krb-ipv6.m4
@@ -0,0 +1,154 @@
+dnl $Id$
+dnl
+dnl test for IPv6
+dnl
+ac_cv_lib_ipv6=check
+
+AC_DEFUN([AC_KRB_IPV6], [
+AC_ARG_WITH(ipv6,
+ AS_HELP_STRING([--without-ipv6],[do not enable IPv6 support]),[
+ ac_cv_lib_ipv6="$withval"
+])
+save_CFLAGS="${CFLAGS}"
+
+if test "X$ac_cv_lib_ipv6" != "Xno"; then
+
+ AC_CACHE_CHECK([for IPv6 stack type], rk_cv_v6type,
+ [dnl check for different v6 implementations (by itojun)
+ v6type=unknown
+ v6lib=none
+
+ for i in v6d toshiba kame inria zeta linux; do
+ case $i in
+ v6d)
+ AC_EGREP_CPP(yes, [
+#include </usr/local/v6/include/sys/types.h>
+#ifdef __V6D__
+yes
+#endif],
+ [v6type=$i; v6lib=v6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-I/usr/local/v6/include $CFLAGS"])
+ ;;
+ toshiba)
+ AC_EGREP_CPP(yes, [
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif],
+ [v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DINET6 $CFLAGS"])
+ ;;
+ kame)
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif],
+ [v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DINET6 $CFLAGS"])
+ ;;
+ inria)
+ AC_EGREP_CPP(yes, [
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif],
+ [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
+ ;;
+ zeta)
+ AC_EGREP_CPP(yes, [
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+yes
+#endif],
+ [v6type=$i; v6lib=inet6;
+ v6libdir=/usr/local/v6/lib;
+ CFLAGS="-DINET6 $CFLAGS"])
+ ;;
+ linux)
+ if test -d /usr/inet6; then
+ v6type=$i
+ v6lib=inet6
+ v6libdir=/usr/inet6
+ CFLAGS="-DINET6 $CFLAGS"
+ fi
+ ;;
+ esac
+ if test "$v6type" != "unknown"; then
+ break
+ fi
+ done
+
+ if test "$v6lib" != "none"; then
+ for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
+ if test -d $dir -a -f $dir/lib$v6lib.a; then
+ LIBS="-L$dir -l$v6lib $LIBS"
+ break
+ fi
+ done
+ fi])
+
+ AC_CACHE_CHECK([for IPv6], rk_cv_lib_ipv6, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+]],
+ [[
+ struct sockaddr_in6 sin6;
+ int s;
+
+ s = socket(AF_INET6, SOCK_DGRAM, 0);
+
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(17);
+ sin6.sin6_addr = in6addr_any;
+ bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
+]])],
+ [ac_cv_lib_ipv6=yes],
+ [ac_cv_lib_ipv6=no])])
+fi
+
+if test "$ac_cv_lib_ipv6" = yes; then
+ AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
+else
+ CFLAGS="${save_CFLAGS}"
+fi
+
+## test for AIX missing in6addr_loopback
+if test "$ac_cv_lib_ipv6" = yes; then
+ AC_CACHE_CHECK([for in6addr_loopback],[rk_cv_var_in6addr_loopback],[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif]],[[
+struct sockaddr_in6 sin6;
+sin6.sin6_addr = in6addr_loopback;
+]])],[ac_cv_var_in6addr_loopback=yes],[ac_cv_var_in6addr_loopback=no])])
+ if test "$ac_cv_var_in6addr_loopback" = yes; then
+ AC_DEFINE(HAVE_IN6ADDR_LOOPBACK, 1,
+ [Define if you have the in6addr_loopback variable])
+ fi
+fi
+]) \ No newline at end of file
diff --git a/third_party/heimdal/cf/krb-prog-ln-s.m4 b/third_party/heimdal/cf/krb-prog-ln-s.m4
new file mode 100644
index 0000000..35ab877
--- /dev/null
+++ b/third_party/heimdal/cf/krb-prog-ln-s.m4
@@ -0,0 +1,28 @@
+dnl $Id$
+dnl
+dnl
+dnl Better test for ln -s, ln or cp
+dnl
+
+AC_DEFUN([AC_KRB_PROG_LN_S],
+[AC_MSG_CHECKING(for ln -s or something else)
+AC_CACHE_VAL(ac_cv_prog_LN_S,
+[rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ touch conftestdata1
+ if ln conftestdata1 conftestdata2; then
+ rm -f conftestdata*
+ ac_cv_prog_LN_S=ln
+ else
+ ac_cv_prog_LN_S=cp
+ fi
+fi])dnl
+LN_S="$ac_cv_prog_LN_S"
+AC_MSG_RESULT($ac_cv_prog_LN_S)
+AC_SUBST(LN_S)dnl
+])
+
diff --git a/third_party/heimdal/cf/krb-prog-perl.m4 b/third_party/heimdal/cf/krb-prog-perl.m4
new file mode 100644
index 0000000..b359111
--- /dev/null
+++ b/third_party/heimdal/cf/krb-prog-perl.m4
@@ -0,0 +1,21 @@
+dnl
+dnl perl and some of its module are required to build some headers
+dnl
+
+AC_DEFUN([AC_KRB_PROG_PERL],
+[AC_CHECK_PROGS(PERL, perl, perl)
+if test "$PERL" = ""; then
+ AC_MSG_ERROR([perl not found - Cannot build Heimdal without perl])
+fi
+])
+
+AC_DEFUN([AC_KRB_PERL_MOD],
+[
+AC_MSG_CHECKING([for Perl5 module $1])
+if ! $PERL -M$1 -e 'exit(0);' >/dev/null 2>&1; then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([perl module $1 not found - Cannot build Heimdal without perl module $1])
+else
+ AC_MSG_RESULT([yes])
+fi
+])
diff --git a/third_party/heimdal/cf/krb-prog-ranlib.m4 b/third_party/heimdal/cf/krb-prog-ranlib.m4
new file mode 100644
index 0000000..8bc5b9e
--- /dev/null
+++ b/third_party/heimdal/cf/krb-prog-ranlib.m4
@@ -0,0 +1,8 @@
+dnl $Id$
+dnl
+dnl
+dnl Also look for EMXOMF for OS/2
+dnl
+
+AC_DEFUN([AC_KRB_PROG_RANLIB],
+[AC_CHECK_PROGS(RANLIB, ranlib EMXOMF, :)])
diff --git a/third_party/heimdal/cf/krb-prog-yacc.m4 b/third_party/heimdal/cf/krb-prog-yacc.m4
new file mode 100644
index 0000000..4c0afd9
--- /dev/null
+++ b/third_party/heimdal/cf/krb-prog-yacc.m4
@@ -0,0 +1,18 @@
+dnl $Id$
+dnl
+dnl
+dnl OLD: We prefer byacc or yacc because they do not use `alloca'
+dnl
+dnl CURRENT: We don't mind `alloca', but we do mind `bison -y' because
+dnl newer versions of `bison', with `-y' complain about %expect and
+dnl anything that yacc didn't document. Because `bison' typically
+dnl also installs a `yacc' link that acts like `bison y', we put
+dnl `yacc' last in this list.
+dnl
+
+AC_DEFUN([AC_KRB_PROG_YACC],
+[AC_CHECK_PROGS(YACC, 'bison -d' 'byacc -d' yacc)
+if test "$YACC" = ""; then
+ AC_MSG_WARN([byacc and bison not found - some stuff will not build])
+fi
+])
diff --git a/third_party/heimdal/cf/krb-readline.m4 b/third_party/heimdal/cf/krb-readline.m4
new file mode 100644
index 0000000..ddb94bf
--- /dev/null
+++ b/third_party/heimdal/cf/krb-readline.m4
@@ -0,0 +1,28 @@
+dnl $Id$
+dnl
+dnl Tests for readline functions
+dnl
+
+dnl el_init
+
+AC_DEFUN([KRB_READLINE],[
+
+dnl readline
+
+ac_foo=no
+build_editline=no
+if test "$with_readline" = yes; then
+ :
+elif test "$with_libedit" = yes; then
+ LIB_readline="${LIB_libedit}"
+elif test "$ac_cv_func_readline" = yes; then
+ :
+else
+ build_libedit=yes
+ LIB_readline="\$(top_builddir)/lib/libedit/src/libheimedit.la \$(LIB_tgetent)"
+fi
+AM_CONDITIONAL(LIBEDIT, test "$build_libedit" = yes)
+AC_DEFINE(HAVE_READLINE, 1,
+ [Define if you have a readline compatible library.])dnl
+
+])
diff --git a/third_party/heimdal/cf/krb-struct-spwd.m4 b/third_party/heimdal/cf/krb-struct-spwd.m4
new file mode 100644
index 0000000..aebf20c
--- /dev/null
+++ b/third_party/heimdal/cf/krb-struct-spwd.m4
@@ -0,0 +1,21 @@
+dnl $Id$
+dnl
+dnl Test for `struct spwd'
+
+AC_DEFUN([AC_KRB_STRUCT_SPWD], [
+AC_MSG_CHECKING(for struct spwd)
+AC_CACHE_VAL(ac_cv_struct_spwd, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <pwd.h>
+#ifdef HAVE_SHADOW_H
+#include <shadow.h>
+#endif]],[[struct spwd foo;]])],
+[ac_cv_struct_spwd=yes],
+[ac_cv_struct_spwd=no])
+])
+AC_MSG_RESULT($ac_cv_struct_spwd)
+
+if test "$ac_cv_struct_spwd" = "yes"; then
+ AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
+fi
+])
diff --git a/third_party/heimdal/cf/krb-struct-winsize.m4 b/third_party/heimdal/cf/krb-struct-winsize.m4
new file mode 100644
index 0000000..5f46b8d
--- /dev/null
+++ b/third_party/heimdal/cf/krb-struct-winsize.m4
@@ -0,0 +1,25 @@
+dnl $Id$
+dnl
+dnl
+dnl Search for struct winsize
+dnl
+
+AC_DEFUN([AC_KRB_STRUCT_WINSIZE], [
+AC_MSG_CHECKING(for struct winsize)
+AC_CACHE_VAL(ac_cv_struct_winsize, [
+ac_cv_struct_winsize=no
+for i in sys/termios.h sys/ioctl.h; do
+AC_EGREP_HEADER(
+struct[[ ]]*winsize,dnl
+$i, ac_cv_struct_winsize=yes; break)dnl
+done
+])
+if test "$ac_cv_struct_winsize" = "yes"; then
+ AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
+fi
+AC_MSG_RESULT($ac_cv_struct_winsize)
+AC_EGREP_HEADER(ws_xpixel, termios.h,
+ AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
+AC_EGREP_HEADER(ws_ypixel, termios.h,
+ AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
+])
diff --git a/third_party/heimdal/cf/krb-sys-aix.m4 b/third_party/heimdal/cf/krb-sys-aix.m4
new file mode 100644
index 0000000..c599ef8
--- /dev/null
+++ b/third_party/heimdal/cf/krb-sys-aix.m4
@@ -0,0 +1,15 @@
+dnl $Id$
+dnl
+dnl
+dnl AIX have a very different syscall convention
+dnl
+AC_DEFUN([AC_KRB_SYS_AIX], [
+AC_MSG_CHECKING(for AIX)
+AC_CACHE_VAL(krb_cv_sys_aix,
+AC_EGREP_CPP(yes,
+[#ifdef _AIX
+ yes
+#endif
+], krb_cv_sys_aix=yes, krb_cv_sys_aix=no) )
+AC_MSG_RESULT($krb_cv_sys_aix)
+])
diff --git a/third_party/heimdal/cf/krb-sys-nextstep.m4 b/third_party/heimdal/cf/krb-sys-nextstep.m4
new file mode 100644
index 0000000..d9308a0
--- /dev/null
+++ b/third_party/heimdal/cf/krb-sys-nextstep.m4
@@ -0,0 +1,18 @@
+dnl $Id$
+dnl
+dnl NEXTSTEP is not posix compliant by default,
+dnl you need a switch -posix to the compiler
+dnl
+
+AC_DEFUN([rk_SYS_NEXTSTEP], [
+AC_CACHE_CHECK(for NeXTSTEP, rk_cv_sys_nextstep, [
+AC_EGREP_CPP(yes,
+[#if defined(NeXT) && !defined(__APPLE__)
+ yes
+#endif
+], rk_cv_sys_nextstep=yes, rk_cv_sys_nextstep=no)])
+if test "$rk_cv_sys_nextstep" = "yes"; then
+ CFLAGS="$CFLAGS -posix"
+ LIBS="$LIBS -posix"
+fi
+])
diff --git a/third_party/heimdal/cf/largefile.m4 b/third_party/heimdal/cf/largefile.m4
new file mode 100644
index 0000000..5c54897
--- /dev/null
+++ b/third_party/heimdal/cf/largefile.m4
@@ -0,0 +1,16 @@
+dnl $Id$
+dnl
+dnl Figure out what flags we need for 64-bit file access, and also set
+dnl them on the command line.
+dnl
+AC_DEFUN([rk_SYS_LARGEFILE],[
+AC_REQUIRE([AC_SYS_LARGEFILE])dnl
+dnl need to set this on the command line, since it might otherwise break
+dnl with generated code, such as lex
+if test "$enable_largefile" != no -a "$ac_cv_sys_large_files" != no; then
+ CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
+fi
+if test "$enable_largefile" != no -a "$ac_cv_sys_file_offset_bits" != no; then
+ CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+fi
+])
diff --git a/third_party/heimdal/cf/make-proto.pl b/third_party/heimdal/cf/make-proto.pl
new file mode 100644
index 0000000..36a040c
--- /dev/null
+++ b/third_party/heimdal/cf/make-proto.pl
@@ -0,0 +1,528 @@
+# Make prototypes from .c files
+# $Id$
+
+use Getopt::Std;
+use File::Compare;
+
+use JSON;
+
+my $comment = 0;
+my $doxygen = 0;
+my $funcdoc = 0;
+my $if_0 = 0;
+my $brace = 0;
+my $line = "";
+my $debug = 0;
+my $oproto = 1;
+my $private_func_re = "^_";
+my %depfunction;
+my %exported;
+my %deprecated;
+my $apple = 0;
+my %documentation;
+
+getopts('x:m:o:p:dqE:R:P:') || die "foo";
+if($opt_a) {
+ $apple = 1;
+}
+
+if($opt_a) {
+ $apple = 1;
+}
+
+if($opt_d) {
+ $debug = 1;
+}
+
+if($opt_q) {
+ $oproto = 0;
+}
+
+if($opt_R) {
+ $private_func_re = $opt_R;
+}
+my %flags = (
+ 'multiline-proto' => 1,
+ 'header' => 1,
+ 'function-blocking' => 0,
+ 'gnuc-attribute' => 1,
+ 'cxx' => 1
+ );
+if($opt_m) {
+ foreach $i (split(/,/, $opt_m)) {
+ if($i eq "roken") {
+ $flags{"multiline-proto"} = 0;
+ $flags{"header"} = 0;
+ $flags{"function-blocking"} = 0;
+ $flags{"gnuc-attribute"} = 0;
+ $flags{"cxx"} = 0;
+ } else {
+ if(substr($i, 0, 3) eq "no-") {
+ $flags{substr($i, 3)} = 0;
+ } else {
+ $flags{$i} = 1;
+ }
+ }
+ }
+}
+
+if($opt_x) {
+ my $EXP;
+ local $/;
+ open(EXP, '<', $opt_x) || die "open ${opt_x}";
+ my $obj = JSON->new->utf8->decode(<EXP>);
+ close $EXP;
+
+ foreach my $x (keys %$obj) {
+ if (defined $obj->{$x}->{"export"}) {
+ $exported{$x} = $obj->{$x};
+ }
+ if (defined $obj->{$x}->{"deprecated"}) {
+ $deprecated{$x} = $obj->{$x}->{"deprecated"};
+ }
+ }
+}
+
+while(<>) {
+ print $brace, " ", $_ if($debug);
+
+ # Handle C comments
+ s@/\*.*\*/@@;
+ s@//.*/@@;
+ if ( s@/\*\*(.*)@@) { $comment = 1; $doxygen = 1; $funcdoc = $1;
+ } elsif ( s@/\*.*@@) { $comment = 1;
+ } elsif ($comment && s@.*\*/@@) { $comment = 0; $doxygen = 0;
+ } elsif ($doxygen) { $funcdoc .= $_; next;
+ } elsif ($comment) { next; }
+
+ # Handle CPP #define's
+ $define = 1 if /^\s*\#\s*define/;
+ if ($define) {
+ $define = 0 if ! /\\$/;
+ next;
+ }
+
+ if(/^\#if 0/) {
+ $if_0 = 1;
+ }
+ if($if_0 && /^\#endif/) {
+ $if_0 = 0;
+ }
+ if($if_0) { next }
+ if(/^\s*\#/) {
+ next;
+ }
+ if(/^\s*$/) {
+ $line = "";
+ next;
+ }
+ if(/\{/){
+ if (!/\}/) {
+ $brace++;
+ }
+ $_ = $line;
+ while(s/\*\//\ca/){
+ s/\/\*(.|\n)*\ca//;
+ }
+ s/^\s*//;
+ s/\s*$//;
+ s/\s+/ /g;
+ if($_ =~ /\)$/){
+ if(!/^static/ && !/^PRIVATE/){
+ $attr = "";
+ if(m/(.*)(__attribute__\s?\(.*\))/) {
+ $attr .= " $2";
+ $_ = $1;
+ }
+ if(m/(.*)\s(\w+DEPRECATED_FUNCTION)\s?(\(.*\))(.*)/) {
+ $depfunction{$2} = 1;
+ $attr .= " $2$3";
+ $_ = "$1 $4";
+ }
+ if(m/(.*)\s(\w+DEPRECATED)(.*)/) {
+ $attr .= " $2";
+ $_ = "$1 $3";
+ }
+ if(m/(.*)\s(HEIMDAL_\w+_ATTRIBUTE)\s?(\(.*\))?(.*)/) {
+ $attr .= " $2$3";
+ $_ = "$1 $4";
+ }
+ # remove outer ()
+ s/\s*\(/</;
+ s/\)\s?$/>/;
+ # remove , within ()
+ while(s/\(([^()]*),(.*)\)/($1\$$2)/g){}
+ s/\<\s*void\s*\>/<>/;
+ # remove parameter names
+ if($opt_P eq "remove") {
+ s/(\s*)([a-zA-Z0-9_]+)([,>])/$3/g;
+ s/\s+\*/*/g;
+ s/\(\*(\s*)([a-zA-Z0-9_]+)\)/(*)/g;
+ } elsif($opt_P eq "comment") {
+ s/([a-zA-Z0-9_]+)([,>])/\/\*$1\*\/$2/g;
+ s/\(\*([a-zA-Z0-9_]+)\)/(*\/\*$1\*\/)/g;
+ }
+ s/\<\>/<void>/;
+ # add newlines before parameters
+ if($flags{"multiline-proto"}) {
+ s/,\s*/,\n\t/g;
+ } else {
+ s/,\s*/, /g;
+ }
+ # fix removed ,
+ s/\$/,/g;
+ # match function name
+ /([a-zA-Z0-9_]+)\s*\</;
+ $f = $1;
+ if($oproto) {
+ $LP = "__P((";
+ $RP = "))";
+ } else {
+ $LP = "(";
+ $RP = ")";
+ }
+ # only add newline if more than one parameter
+ if($flags{"multiline-proto"} && /,/){
+ s/\</ $LP\n\t/;
+ }else{
+ s/\</ $LP/;
+ }
+ s/\>/$RP/;
+ # insert newline before function name
+ if($flags{"multiline-proto"}) {
+ s/(.*)\s([a-zA-Z0-9_]+ \Q$LP\E)/$1\n$2/;
+ }
+ if($attr ne "") {
+ $_ .= "\n $attr";
+ }
+ if ($funcdoc) {
+ $documentation{$f} = $funcdoc;
+ }
+ $funcdoc = undef;
+ if ($apple && exists $exported{$f}) {
+ $ios = $exported{$f}{ios};
+ $ios = "NA" if (!defined $ios);
+ $mac = $exported{$f}{macos};
+ $mac = "NA" if (!defined $mac);
+ die "$f neither" if ($mac eq "NA" and $ios eq "NA");
+ $_ = $_ . " __OSX_AVAILABLE_STARTING(__MAC_${mac}, __IPHONE_${ios})";
+ }
+ if (exists $deprecated{$f}) {
+ $_ = $_ . " GSSAPI_DEPRECATED_FUNCTION(\"$deprecated{$f}\")";
+ $depfunction{GSSAPI_DEPRECATED_FUNCTION} = 1;
+ }
+ $_ = $_ . ";";
+ $funcs{$f} = $_;
+ }
+ }
+ $line = "";
+ }
+ if(/\}/){
+ $brace--;
+ }
+ if(/^\}/){
+ $brace = 0;
+ }
+ if($brace == 0) {
+ $line = $line . " " . $_;
+ }
+}
+
+die "reached end of code and still in doxygen comment" if ($doxygen);
+die "reached end of code and still in comment" if ($comment);
+
+sub foo {
+ local ($arg) = @_;
+ $_ = $arg;
+ s/.*\/([^\/]*)/$1/;
+ s/.*\\([^\\]*)/$1/;
+ s/[^a-zA-Z0-9]/_/g;
+ "__" . $_ . "__";
+}
+
+if($opt_o) {
+ open(OUT, ">${opt_o}.new");
+ $block = &foo($opt_o);
+} else {
+ $block = "__public_h__";
+}
+
+if($opt_p) {
+ open(PRIV, ">${opt_p}.new");
+ $private = &foo($opt_p);
+} else {
+ $private = "__private_h__";
+}
+
+$public_h = "";
+$private_h = "";
+
+$public_h_header .= "/* This is a generated file */
+#ifndef $block
+#define $block
+#ifndef DOXY
+
+";
+if ($oproto) {
+ $public_h_header .= "#ifdef __STDC__
+#include <stdarg.h>
+#ifndef __P
+#define __P(x) x
+#endif
+#else
+#ifndef __P
+#define __P(x) ()
+#endif
+#endif
+
+";
+} else {
+ $public_h_header .= "#include <stdarg.h>
+
+";
+}
+$public_h_trailer = "";
+
+$private_h_header = "/* This is a generated file */
+#ifndef $private
+#define $private
+
+";
+if($oproto) {
+ $private_h_header .= "#ifdef __STDC__
+#include <stdarg.h>
+#ifndef __P
+#define __P(x) x
+#endif
+#else
+#ifndef __P
+#define __P(x) ()
+#endif
+#endif
+
+";
+} else {
+ $private_h_header .= "#include <stdarg.h>
+
+";
+}
+$private_h_trailer = "";
+
+
+foreach(sort keys %funcs){
+ if(/^(DllMain|main)$/) { next }
+ if ($funcs{$_} =~ /\^/) {
+ $beginblock = "#ifdef __BLOCKS__\n";
+ $endblock = "#endif /* __BLOCKS__ */\n";
+ } else {
+ $beginblock = $endblock = "";
+ }
+ # if we have an export table and doesn't have content, or matches private RE
+ if((scalar(keys(%exported)) ne 0 && !exists $exported{$_} ) || /$private_func_re/) {
+ $private_h .= $beginblock;
+# if ($apple and not /$private_func_re/) {
+# $private_h .= "#define $_ __ApplePrivate_${_}\n";
+# }
+ $private_h .= $funcs{$_} . "\n" ;
+ $private_h .= $endblock . "\n";
+ if($funcs{$_} =~ /__attribute__/) {
+ $private_attribute_seen = 1;
+ }
+ } else {
+ if($documentation{$_}) {
+ $public_h .= "/**\n";
+ $public_h .= "$documentation{$_}";
+ $public_h .= " */\n\n";
+ }
+ if($flags{"function-blocking"}) {
+ $fupper = uc $_;
+ if($exported{$_} =~ /proto/) {
+ $public_h .= "#if !defined(HAVE_$fupper) || defined(NEED_${fupper}_PROTO)\n";
+ } else {
+ $public_h .= "#ifndef HAVE_$fupper\n";
+ }
+ }
+ $public_h .= $beginblock . $funcs{$_} . "\n" . $endblock;
+ if($funcs{$_} =~ /__attribute__/) {
+ $public_attribute_seen = 1;
+ }
+ if($flags{"function-blocking"}) {
+ $public_h .= "#endif\n";
+ }
+ $public_h .= "\n";
+ }
+}
+
+if($flags{"gnuc-attribute"}) {
+ if ($public_attribute_seen) {
+ $public_h_header .= "#if !defined(__GNUC__) && !defined(__attribute__)
+#define __attribute__(x)
+#endif
+
+";
+ }
+
+ if ($private_attribute_seen) {
+ $private_h_header .= "#if !defined(__GNUC__) && !defined(__attribute__)
+#define __attribute__(x)
+#endif
+
+";
+ }
+}
+
+my $depstr = "";
+my $undepstr = "";
+foreach (keys %depfunction) {
+ $depstr .= "#ifndef $_
+#ifndef __has_extension
+#define __has_extension(x) 0
+#define ${_}has_extension 1
+#endif
+#if __has_extension(attribute_deprecated_with_message)
+#define $_(x) __attribute__((__deprecated__(x)))
+#elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))
+#define $_(X) __attribute__((__deprecated__))
+#else
+#define $_(X)
+#endif
+#ifdef ${_}has_extension
+#undef __has_extension
+#undef ${_}has_extension
+#endif
+#endif /* $_ */
+
+
+";
+ $public_h_trailer .= "#undef $_
+
+";
+ $private_h_trailer .= "#undef $_
+#define $_(X)
+
+";
+}
+
+$public_h_header .= $depstr;
+$private_h_header .= $depstr;
+
+
+if($flags{"cxx"}) {
+ $public_h_header .= "#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+";
+ $public_h_trailer = "#ifdef __cplusplus
+}
+#endif
+
+" . $public_h_trailer;
+
+}
+if ($opt_E) {
+ $public_h_header .= "#ifndef $opt_E
+ #ifndef ${opt_E}_FUNCTION
+ #if defined(_WIN32)
+ #define ${opt_E}_FUNCTION __declspec(dllimport)
+ #else
+ #define ${opt_E}_FUNCTION
+ #endif
+ #endif
+ #ifndef ${opt_E}_NORETURN_FUNCTION
+ #if defined(_WIN32)
+ #define ${opt_E}_NORETURN_FUNCTION __declspec(dllimport noreturn)
+ #else
+ #define ${opt_E}_NORETURN_FUNCTION
+ #endif
+ #endif
+ #ifndef ${opt_E}_CALL
+ #if defined(_WIN32)
+ #define ${opt_E}_CALL __stdcall
+ #else
+ #define ${opt_E}_CALL
+ #endif
+ #endif
+ #ifndef ${opt_E}_VARIABLE
+ #if defined(_WIN32)
+ #define ${opt_E}_VARIABLE __declspec(dllimport)
+ #else
+ #define ${opt_E}_VARIABLE
+ #endif
+ #endif
+#endif
+";
+
+ $private_h_header .= "#ifndef $opt_E
+ #ifndef ${opt_E}_FUNCTION
+ #if defined(_WIN32)
+ #define ${opt_E}_FUNCTION __declspec(dllimport)
+ #else
+ #define ${opt_E}_FUNCTION
+ #endif
+ #endif
+ #ifndef ${opt_E}_NORETURN_FUNCTION
+ #if defined(_WIN32)
+ #define ${opt_E}_NORETURN_FUNCTION __declspec(dllimport noreturn)
+ #else
+ #define ${opt_E}_NORETURN_FUNCTION
+ #endif
+ #endif
+ #ifndef ${opt_E}_CALL
+ #if defined(_WIN32)
+ #define ${opt_E}_CALL __stdcall
+ #else
+ #define ${opt_E}_CALL
+ #endif
+ #endif
+ #ifndef ${opt_E}_VARIABLE
+ #if defined(_WIN32)
+ #define ${opt_E}_VARIABLE __declspec(dllimport)
+ #else
+ #define ${opt_E}_VARIABLE
+ #endif
+ #endif
+#endif
+";
+}
+
+$public_h_trailer .= $undepstr;
+$private_h_trailer .= $undepstr;
+
+if ($public_h ne "" && $flags{"header"}) {
+ $public_h = $public_h_header . $public_h .
+ $public_h_trailer . "#endif /* DOXY */\n#endif /* $block */\n";
+}
+if ($private_h ne "" && $flags{"header"}) {
+ $private_h = $private_h_header . $private_h .
+ $private_h_trailer . "#endif /* $private */\n";
+}
+
+if($opt_o) {
+ print OUT $public_h;
+}
+if($opt_p) {
+ print PRIV $private_h;
+}
+
+close OUT;
+close PRIV;
+
+if ($opt_o) {
+
+ if (compare("${opt_o}.new", ${opt_o}) != 0) {
+ printf("updating ${opt_o}\n");
+ rename("${opt_o}.new", ${opt_o});
+ } else {
+ unlink("${opt_o}.new");
+ }
+}
+
+if ($opt_p) {
+ if (compare("${opt_p}.new", ${opt_p}) != 0) {
+ printf("updating ${opt_p}\n");
+ rename("${opt_p}.new", ${opt_p});
+ } else {
+ unlink("${opt_p}.new");
+ }
+}
diff --git a/third_party/heimdal/cf/maybe-valgrind.sh b/third_party/heimdal/cf/maybe-valgrind.sh
new file mode 100755
index 0000000..5e20d98
--- /dev/null
+++ b/third_party/heimdal/cf/maybe-valgrind.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan
+# (Royal Institute of Technology, Stockholm, Sweden).
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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.
+
+
+while true
+do
+ case $1 in
+ -s) tsrcdir="$2"; shift 2;;
+ -o) tobjdir="$2"; shift 2;;
+ -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
+ *) break;;
+ esac
+done
+
+if [ X"${tobjdir}" = "X" -o X"${tsrcdir}" = X ] ; then
+ echo "tobjdir or tsrcdir not defined"
+ exit 1
+fi
+
+if [ ! -f "${tobjdir}/libtool" ]; then
+ echo "libtool missing from \"${tobjdir}\""
+ exit 1
+fi
+
+doit=1
+
+libtool="${tobjdir}/libtool --mode=execute"
+
+valgrind="valgrind --leak-check=full --quiet -q --num-callers=30 --suppressions=${tsrcdir}/cf/valgrind-suppressions"
+
+if head -10 "$1" | grep 'Generated by ltmain.sh' > /dev/null ; then
+ uselibtool=1
+elif head -10 "$1" | grep 'bin/sh' > /dev/null ; then
+ libtool=
+ valgrind=
+fi
+
+exec $libtool $valgrind "$@"
diff --git a/third_party/heimdal/cf/mips-abi.m4 b/third_party/heimdal/cf/mips-abi.m4
new file mode 100644
index 0000000..20035be
--- /dev/null
+++ b/third_party/heimdal/cf/mips-abi.m4
@@ -0,0 +1,87 @@
+dnl $Id$
+dnl
+dnl
+dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
+dnl value.
+
+AC_DEFUN([AC_MIPS_ABI], [
+AC_ARG_WITH(mips_abi,
+ AS_HELP_STRING([--with-mips-abi=abi],[ABI to use for IRIX (32, n32, or 64)]))
+
+case "$host_os" in
+irix*)
+with_mips_abi="${with_mips_abi:-yes}"
+if test -n "$GCC"; then
+
+# GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
+# which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
+#
+# Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
+# GCC and revert back to O32. The same goes if O32 is asked for - old
+# GCCs doesn't like the -mabi option, and new GCCs can't output O32.
+#
+# Don't you just love *all* the different SGI ABIs?
+
+case "${with_mips_abi}" in
+ 32|o32) abi='-mabi=32'; abilibdirext='' ;;
+ n32|yes) abi='-mabi=n32'; abilibdirext='32' ;;
+ 64) abi='-mabi=64'; abilibdirext='64' ;;
+ no) abi=''; abilibdirext='';;
+ *) AC_MSG_ERROR("Invalid ABI specified") ;;
+esac
+if test -n "$abi" ; then
+ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
+dnl
+dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
+dnl AC_MSG_RESULT
+dnl
+AC_MSG_CHECKING([if $CC supports the $abi option])
+AC_CACHE_VAL($ac_foo, [
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $abi"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int x;]])],[eval $ac_foo=yes], [eval $ac_foo=no])dnl
+CFLAGS="$save_CFLAGS"
+])
+ac_res=`eval echo \\\$$ac_foo`
+AC_MSG_RESULT($ac_res)
+if test $ac_res = no; then
+# Try to figure out why that failed...
+case $abi in
+ -mabi=32)
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -mabi=n32"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int x;]])],[ac_res=yes],[ac_res=no])dnl
+ CLAGS="$save_CFLAGS"
+ if test $ac_res = yes; then
+ # New GCC
+ AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
+ fi
+ # Old GCC
+ abi=''
+ abilibdirext=''
+ ;;
+ -mabi=n32|-mabi=64)
+ if test $with_mips_abi = yes; then
+ # Old GCC, default to O32
+ abi=''
+ abilibdirext=''
+ else
+ # Some broken GCC
+ AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
+ fi
+ ;;
+esac
+fi #if test $ac_res = no; then
+fi #if test -n "$abi" ; then
+else
+case "${with_mips_abi}" in
+ 32|o32) abi='-32'; abilibdirext='' ;;
+ n32|yes) abi='-n32'; abilibdirext='32' ;;
+ 64) abi='-64'; abilibdirext='64' ;;
+ no) abi=''; abilibdirext='';;
+ *) AC_MSG_ERROR("Invalid ABI specified") ;;
+esac
+fi #if test -n "$GCC"; then
+;;
+esac
+])
diff --git a/third_party/heimdal/cf/misc.m4 b/third_party/heimdal/cf/misc.m4
new file mode 100644
index 0000000..c6d8827
--- /dev/null
+++ b/third_party/heimdal/cf/misc.m4
@@ -0,0 +1,15 @@
+
+dnl $Id$
+dnl
+AC_DEFUN([upcase],[`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`])dnl
+AC_DEFUN([rk_LIBOBJ],[AC_LIBOBJ([$1])])dnl
+AC_DEFUN([rk_CONFIG_HEADER],[AH_TOP([#ifndef RCSID
+#define RCSID(msg) \
+static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
+#endif
+
+/* Maximum values on all known systems */
+#define MaxHostNameLen (64+4)
+#define MaxPathLen (1024+4)
+
+])]) \ No newline at end of file
diff --git a/third_party/heimdal/cf/need-proto.m4 b/third_party/heimdal/cf/need-proto.m4
new file mode 100644
index 0000000..2f7a221
--- /dev/null
+++ b/third_party/heimdal/cf/need-proto.m4
@@ -0,0 +1,22 @@
+dnl $Id$
+dnl
+dnl
+dnl Check if we need the prototype for a function
+dnl
+
+dnl AC_NEED_PROTO(includes, function)
+
+AC_DEFUN([AC_NEED_PROTO], [
+if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
+AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1
+struct foo { int foo; } xx;
+extern int $2 (struct foo*);]],[[$2(&xx)]])],
+[eval "ac_cv_func_$2_noproto=yes"],
+[eval "ac_cv_func_$2_noproto=no"]))
+if test "$ac_cv_func_$2_noproto" = yes; then
+ AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1,
+ [define if the system is missing a prototype for $2()])
+fi
+fi
+])
diff --git a/third_party/heimdal/cf/osfc2.m4 b/third_party/heimdal/cf/osfc2.m4
new file mode 100644
index 0000000..cb8768a
--- /dev/null
+++ b/third_party/heimdal/cf/osfc2.m4
@@ -0,0 +1,14 @@
+dnl $Id$
+dnl
+dnl enable OSF C2 stuff
+
+AC_DEFUN([AC_CHECK_OSFC2],[
+AC_ARG_ENABLE(osfc2,
+ AS_HELP_STRING([--enable-osfc2],[enable some OSF C2 support]))
+LIB_security=
+if test "$enable_osfc2" = yes; then
+ AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
+ LIB_security=-lsecurity
+fi
+AC_SUBST(LIB_security)
+])
diff --git a/third_party/heimdal/cf/otp.m4 b/third_party/heimdal/cf/otp.m4
new file mode 100644
index 0000000..d354515
--- /dev/null
+++ b/third_party/heimdal/cf/otp.m4
@@ -0,0 +1,27 @@
+dnl $Id$
+dnl
+dnl check requirements for OTP library
+dnl
+AC_DEFUN([rk_OTP],[
+AC_REQUIRE([rk_DB])dnl
+AC_ARG_ENABLE(otp,
+ AS_HELP_STRING([--disable-otp],[if you don't want OTP support]))
+if test "$enable_otp" = yes -a "$db_type" = unknown; then
+ AC_MSG_ERROR([OTP requires a NDBM/DB compatible library])
+fi
+if test "$enable_otp" != no; then
+ if test "$db_type" != unknown; then
+ enable_otp=yes
+ else
+ enable_otp=no
+ fi
+fi
+if test "$enable_otp" = yes; then
+ AC_DEFINE(OTP, 1, [Define if you want OTP support in applications.])
+ LIB_otp='$(top_builddir)/lib/otp/libotp.la'
+ AC_SUBST(LIB_otp)
+fi
+AC_MSG_CHECKING([whether to enable OTP library])
+AC_MSG_RESULT($enable_otp)
+AM_CONDITIONAL(OTP, test "$enable_otp" = yes)dnl
+])
diff --git a/third_party/heimdal/cf/pkg.m4 b/third_party/heimdal/cf/pkg.m4
new file mode 100644
index 0000000..8cdc5e4
--- /dev/null
+++ b/third_party/heimdal/cf/pkg.m4
@@ -0,0 +1,157 @@
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+ if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ else
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ [pkg_failed=yes])
+ fi
+else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+ [AC_MSG_RESULT([no])
+ $4])
+elif test $pkg_failed = untried; then
+ ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+ [$4])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
diff --git a/third_party/heimdal/cf/proto-compat.m4 b/third_party/heimdal/cf/proto-compat.m4
new file mode 100644
index 0000000..7d0fd70
--- /dev/null
+++ b/third_party/heimdal/cf/proto-compat.m4
@@ -0,0 +1,21 @@
+dnl $Id$
+dnl
+dnl
+dnl Check if the prototype of a function is compatible with another one
+dnl
+
+dnl AC_PROTO_COMPAT(includes, function, prototype)
+
+AC_DEFUN([AC_PROTO_COMPAT], [
+AC_CACHE_CHECK([if $2 is compatible with system prototype],
+ac_cv_func_$2_proto_compat,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]],[[$3]])],
+[eval "ac_cv_func_$2_proto_compat=yes"],
+[eval "ac_cv_func_$2_proto_compat=no"]))
+define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
+if test "$ac_cv_func_$2_proto_compat" = yes; then
+ AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
+ $3])
+fi
+undefine([foo])
+]) \ No newline at end of file
diff --git a/third_party/heimdal/cf/pthreads.m4 b/third_party/heimdal/cf/pthreads.m4
new file mode 100644
index 0000000..4d84395
--- /dev/null
+++ b/third_party/heimdal/cf/pthreads.m4
@@ -0,0 +1,117 @@
+Dnl $Id$
+
+AC_DEFUN([KRB_PTHREADS], [
+AC_MSG_CHECKING(if compiling threadsafe libraries)
+
+AC_ARG_ENABLE(pthread-support,
+ AS_HELP_STRING([--enable-pthread-support],
+ [if you want thread safe libraries]),
+ [],[enable_pthread_support=maybe])
+
+case "$host" in
+*-*-solaris2*)
+ native_pthread_support=yes
+ if test "$GCC" = yes; then
+ PTHREAD_CFLAGS="-D_REENTRANT -D_TS_ERRNO"
+ PTHREAD_LIBADD=-lpthread
+ else
+ PTHREAD_CFLAGS="-mt -D_REENTRANT -D_TS_ERRNO"
+ PTHREAD_LDADD=-mt
+ PTHREAD_LIBADD="-mt -lpthread"
+ fi
+ ;;
+*-*-netbsd[[12]]*)
+ native_pthread_support="if running netbsd 1.6T or newer"
+ dnl heim_threads.h knows this
+ PTHREAD_LIBADD="-lpthread"
+ ;;
+*-*-netbsd[[3456789]]*)
+ native_pthread_support="netbsd 3 uses explict pthread"
+ dnl heim_threads.h knows this
+ PTHREAD_LIBADD="-lpthread"
+ ;;
+*-*-freebsd[[1234]])
+ ;;
+*-*-freebsd*)
+ native_pthread_support=yes
+ PTHREAD_LIBADD="-pthread"
+ ;;
+*-*-openbsd*)
+ native_pthread_support=yes
+ PTHREAD_CFLAGS=-pthread
+ PTHREAD_LIBADD=-pthread
+ ;;
+*-*-gnu*)
+ native_pthread_support=yes
+ PTHREADS_CFLAGS=-pthread
+ PTHREAD_LIBADD="-pthread -lpthread"
+ ;;
+*-*-linux* | *-*-linux-gnu)
+ case `uname -r` in
+ 2.*|3.*)
+ native_pthread_support=yes
+ PTHREAD_CFLAGS=-pthread
+ PTHREAD_LIBADD=-pthread
+ ;;
+ esac
+ ;;
+*-*-kfreebsd*-gnu*)
+ native_pthread_support=yes
+ PTHREAD_CFLAGS=-pthread
+ PTHREAD_LIBADD=-pthread
+ ;;
+*-*-aix*)
+ dnl AIX is disabled since we don't handle the utmp/utmpx
+ dnl problems that aix causes when compiling with pthread support
+ dnl (2016-11-14, we longer use utmp). Original logic was:
+ dnl if test "$GCC" = yes; then
+ dnl native_pthread_support=yes
+ dnl PTHREADS_LIBS="-pthread"
+ dnl elif expr "$CC" : ".*_r" > /dev/null ; then
+ dnl native_pthread_support=yes
+ dnl PTHREADS_CFLAGS=""
+ dnl PTHREADS_LIBS=""
+ dnl else
+ dnl native_pthread_support=no
+ dnl fi
+ native_pthread_support=no
+ ;;
+mips-sgi-irix6.[[5-9]]) # maybe works for earlier versions too
+ native_pthread_support=yes
+ PTHREAD_LIBADD="-lpthread"
+ ;;
+*-*-darwin*)
+ native_pthread_support=yes
+ ;;
+*)
+ native_pthread_support=no
+ ;;
+esac
+
+if test "$enable_pthread_support" = maybe ; then
+ enable_pthread_support="$native_pthread_support"
+fi
+
+if test "$enable_pthread_support" != no; then
+ AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1,
+ [Define if you want have a thread safe libraries])
+ dnl This sucks, but libtool doesn't save the depenecy on -pthread
+ dnl for libraries.
+ LIBS="$PTHREAD_LIBADD $LIBS"
+else
+ PTHREAD_CFLAGS=""
+ PTHREAD_LIBADD=""
+fi
+
+AM_CONDITIONAL(ENABLE_PTHREAD_SUPPORT, test "$enable_pthread_support" != no)
+
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+LDADD="$LDADD $PTHREAD_LDADD"
+LIBADD="$LIBADD $PTHREAD_LIBADD"
+
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_LDADD)
+AC_SUBST(PTHREAD_LIBADD)
+
+AC_MSG_RESULT($enable_pthread_support)
+])
diff --git a/third_party/heimdal/cf/resolv.m4 b/third_party/heimdal/cf/resolv.m4
new file mode 100644
index 0000000..49c868a
--- /dev/null
+++ b/third_party/heimdal/cf/resolv.m4
@@ -0,0 +1,118 @@
+dnl stuff used by DNS resolv code in roken
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([rk_RESOLV],[
+
+AC_CHECK_HEADERS([arpa/nameser.h dns.h])
+
+AC_CHECK_HEADERS(resolv.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+])
+
+AC_FIND_FUNC(res_search, resolv,
+[
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+],
+[0,0,0,0,0])
+
+AC_FIND_FUNC(res_nsearch, resolv,
+[
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+],
+[0,0,0,0,0,0])
+
+AC_FIND_FUNC(res_ndestroy, resolv,
+[
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+],
+[0])
+
+AC_FIND_FUNC_NO_LIBS(dns_search,,
+[
+#ifdef HAVE_DNS_H
+#include <dns.h>
+#endif
+],
+[0,0,0,0,0,0,0,0])
+
+
+AC_FIND_FUNC(dn_expand, resolv,
+[
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+],
+[0,0,0,0,0])
+
+rk_CHECK_VAR(_res,
+[#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif])
+
+])
diff --git a/third_party/heimdal/cf/retsigtype.m4 b/third_party/heimdal/cf/retsigtype.m4
new file mode 100644
index 0000000..5dfd820
--- /dev/null
+++ b/third_party/heimdal/cf/retsigtype.m4
@@ -0,0 +1,18 @@
+dnl
+dnl $Id$
+dnl
+dnl Figure out return type of signal handlers, and define SIGRETURN macro
+dnl that can be used to return from one
+dnl
+AC_DEFUN([rk_RETSIGTYPE],[
+AC_TYPE_SIGNAL
+if test "$ac_cv_type_signal" = "void" ; then
+ AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
+fi
+
+AH_BOTTOM([#ifdef VOID_RETSIGTYPE
+#define SIGRETURN(x) return
+#else
+#define SIGRETURN(x) return (RETSIGTYPE)(x)
+#endif])
+]) \ No newline at end of file
diff --git a/third_party/heimdal/cf/roken-frag.m4 b/third_party/heimdal/cf/roken-frag.m4
new file mode 100644
index 0000000..2c2ef83
--- /dev/null
+++ b/third_party/heimdal/cf/roken-frag.m4
@@ -0,0 +1,766 @@
+dnl $Id$
+dnl
+dnl some code to get roken working
+dnl
+dnl rk_ROKEN(subdir)
+dnl
+AC_DEFUN([rk_ROKEN], [
+
+AC_REQUIRE([rk_CONFIG_HEADER])
+
+DIR_roken=roken
+LIB_roken='$(top_builddir)/$1/libroken.la'
+INCLUDES_roken='-I$(top_builddir)/$1 -I$(top_srcdir)/$1'
+
+dnl Checks for programs
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_AWK])
+AC_REQUIRE([AC_OBJEXT])
+AC_REQUIRE([AC_EXEEXT])
+AC_REQUIRE([LT_INIT])
+
+AC_REQUIRE([AC_MIPS_ABI])
+
+AC_DEFINE(rk_PATH_DELIM, '/', [Path name delimiter])
+
+dnl C characteristics
+
+AC_REQUIRE([AC_C___ATTRIBUTE__])
+AC_REQUIRE([AC_C_INLINE])
+AC_REQUIRE([AC_C_CONST])
+rk_WFLAGS(-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -Wshadow)
+
+dnl -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
+dnl -Wcast-qual -Wswitch -Wformat=2 -Wwrite-strings
+
+AC_REQUIRE([rk_DB])
+
+dnl C types
+
+AC_REQUIRE([AC_TYPE_SIZE_T])
+AC_HAVE_TYPE([ssize_t],[#include <unistd.h>])
+AC_REQUIRE([AC_TYPE_PID_T])
+AC_REQUIRE([AC_TYPE_UID_T])
+AC_HAVE_TYPE([long long])
+
+AC_REQUIRE([rk_RETSIGTYPE])
+
+dnl Checks for header files.
+AC_REQUIRE([AC_HEADER_STDC])
+AC_REQUIRE([AC_HEADER_TIME])
+
+AC_CHECK_HEADERS([\
+ auxv.h \
+ arpa/inet.h \
+ config.h \
+ crypt.h \
+ dirent.h \
+ errno.h \
+ err.h \
+ fcntl.h \
+ fnmatch.h \
+ grp.h \
+ ifaddrs.h \
+ netinet/in.h \
+ netinet/in6.h \
+ netinet/in_systm.h \
+ netinet6/in6.h \
+ paths.h \
+ poll.h \
+ pwd.h \
+ rpcsvc/ypclnt.h \
+ search.h \
+ shadow.h \
+ stdint.h \
+ sys/auxv.h \
+ sys/bswap.h \
+ sys/errno.h \
+ sys/exec_elf.h \
+ sys/ioctl.h \
+ sys/mman.h \
+ sys/param.h \
+ sys/resource.h \
+ sys/sockio.h \
+ sys/stat.h \
+ sys/time.h \
+ sys/tty.h \
+ sys/types.h \
+ sys/uio.h \
+ sys/utsname.h \
+ sys/wait.h \
+ syslog.h \
+ termios.h \
+ winsock2.h \
+ ws2tcpip.h \
+ unistd.h \
+ userconf.h \
+ usersec.h \
+ util.h \
+])
+
+AC_HAVE_TYPE([auxv_t],[#ifdef HAVE_AUXV_H
+#include <auxv.h>
+#endif
+#ifdef HAVE_SYS_AUXV_H
+#include <sys/auxv.h>
+#endif
+])
+
+AC_HAVE_TYPE([uintptr_t],[#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif])
+
+dnl Sunpro 5.2 has a vis.h which is something different.
+AC_CHECK_HEADERS(vis.h, , , [
+#include <vis.h>
+#ifndef VIS_SP
+#error invis
+#endif])
+
+AC_CHECK_HEADERS(netdb.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+])
+
+AC_CHECK_HEADERS(sys/socket.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+])
+
+AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif])
+
+AC_CHECK_HEADERS(netinet6/in6_var.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET6_IN6_H
+#include <netinet6/in6.h>
+#endif
+])
+
+AC_CHECK_HEADERS(sys/sysctl.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+])
+
+AC_CHECK_HEADERS(sys/proc.h, , , [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+])
+
+AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
+
+AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
+AM_CONDITIONAL(have_ifaddrs_h, test "$ac_cv_header_ifaddrs_h" = yes)
+AM_CONDITIONAL(have_search_h, test "$ac_cv_header_search_h" = yes)
+AM_CONDITIONAL(have_vis_h, test "$ac_cv_header_vis_h" = yes)
+
+dnl Check for functions and libraries
+
+AC_KRB_IPV6
+
+AC_FIND_FUNC(gethostbyname2, inet6 ip6)
+
+rk_RESOLV
+
+AC_BROKEN_SNPRINTF
+AC_BROKEN_VSNPRINTF
+
+AC_CHECK_FUNCS([ \
+ asnprintf \
+ asprintf \
+ atexit \
+ getauxval \
+ getconfattr \
+ getprogname \
+ getrlimit \
+ issetugid \
+ memmem \
+ mkdtemp \
+ mkostemp \
+ on_exit \
+ poll \
+ random \
+ secure_getenv \
+ setprogname \
+ strsvis \
+ strsvisx \
+ strunvis \
+ strvis \
+ strvisx \
+ svis \
+ sysconf \
+ sysctl \
+ tdelete \
+ tfind \
+ twalk \
+ uname \
+ unlinkat \
+ unvis \
+ vasnprintf \
+ vasprintf \
+ vis \
+])
+
+AC_REQUIRE([AC_FUNC_GETLOGIN])
+
+AC_REQUIRE([AC_FUNC_MMAP])
+
+AC_FIND_FUNC_NO_LIBS(getsockopt,,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif],
+[0,0,0,0,0])
+AC_FIND_FUNC_NO_LIBS(setsockopt,,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif],
+[0,0,0,0,0])
+
+AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif],
+17)
+AC_NEED_PROTO([
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif],
+hstrerror)
+
+AC_FOREACH([rk_func], [asprintf vasprintf asnprintf vasnprintf],
+ [AC_NEED_PROTO([
+ #include <stdio.h>
+ #include <string.h>],
+ rk_func)])
+
+AC_FIND_FUNC_NO_LIBS(bswap16,,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_BSWAP_H
+#include <sys/bswap.h>
+#endif],0)
+
+AC_FIND_FUNC_NO_LIBS(bswap32,,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_BSWAP_H
+#include <sys/bswap.h>
+#endif],0)
+
+AC_FIND_FUNC_NO_LIBS(bswap64,,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_BSWAP_H
+#include <sys/bswap.h>
+#endif],0)
+
+AC_FIND_FUNC_NO_LIBS(pidfile,util,
+[#ifdef HAVE_UTIL_H
+#include <util.h>
+#endif],0)
+
+AC_FIND_IF_NOT_BROKEN(getaddrinfo,,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif],[0,0,0,0])
+
+AC_FIND_IF_NOT_BROKEN(getnameinfo,,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif],[0,0,0,0,0,0,0])
+
+AC_FIND_IF_NOT_BROKEN(freeaddrinfo,,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif],[0])
+
+AC_FIND_IF_NOT_BROKEN(gai_strerror,,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif],[0])
+
+AC_CHECK_LIB(util, emalloc)
+
+case "$host_os" in
+ darwin*)
+ ;;
+ *)
+ AC_BROKEN([daemon]) ;;
+esac
+
+AC_BROKEN([ \
+ chown \
+ copyhostent \
+ closefrom \
+ ecalloc \
+ emalloc \
+ erealloc \
+ estrdup \
+ err \
+ errx \
+ fchown \
+ flock \
+ fnmatch \
+ freehostent \
+ getcwd \
+ getdtablesize \
+ getegid \
+ geteuid \
+ getgid \
+ gethostname \
+ getifaddrs \
+ getipnodebyaddr \
+ getipnodebyname \
+ getopt \
+ gettimeofday \
+ getuid \
+ getusershell \
+ initgroups \
+ innetgr \
+ localtime_r \
+ lstat \
+ memmove \
+ memset_s \
+ mergesort \
+ mergesort_r \
+ mkstemp \
+ putenv \
+ rcmd \
+ readv \
+ recvmsg \
+ sendmsg \
+ setegid \
+ setenv \
+ seteuid \
+ strcasecmp \
+ strdup \
+ strerror \
+ strftime \
+ strlcat \
+ strlcpy \
+ strlwr \
+ strncasecmp \
+ strndup \
+ strnlen \
+ strptime \
+ strsep \
+ strsep_copy \
+ strtok_r \
+ strtoll \
+ strtoull \
+ strupr \
+ swab \
+ tsearch \
+ timegm \
+ unsetenv \
+ verr \
+ verrx \
+ vsyslog \
+ vwarn \
+ vwarnx \
+ warn \
+ warnx \
+ writev \
+])
+
+AM_CONDITIONAL(have_fnmatch_h,
+ test "$ac_cv_header_fnmatch_h" = yes -a "$ac_cv_func_fnmatch" = yes)
+
+AC_FOREACH([rk_func], [strndup strsep strtok_r],
+ [AC_NEED_PROTO([#include <string.h>], rk_func)])
+
+AC_CHECK_FUNC([strtoll],
+ [AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
+ [Define if you have the function strtoll.])])
+
+AC_CHECK_FUNC([strtoull],
+ [AC_DEFINE_UNQUOTED(HAVE_STRTOULL, 1,
+ [Define if you have the function strtoull.])])
+
+AC_FOREACH([rk_func], [strsvis strsvisx strunvis strvis strvisx svis unvis vis],
+[AC_NEED_PROTO([#ifdef HAVE_VIS_H
+#include <vis.h>
+#endif], rk_func)])
+
+AC_MSG_CHECKING([checking for dirfd])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+]],
+ [[DIR *d = 0; dirfd(d);]])],
+ [ac_rk_have_dirfd=yes], [ac_rk_have_dirfd=no])
+if test "$ac_rk_have_dirfd" = "yes" ; then
+ AC_DEFINE_UNQUOTED(HAVE_DIRFD, 1, [have a dirfd function/macro])
+fi
+AC_MSG_RESULT($ac_rk_have_dirfd)
+
+AC_HAVE_STRUCT_FIELD(DIR, dd_fd, [#include <sys/types.h>
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif])
+
+AC_HAVE_STRUCT_FIELD(DIR, d_fd, [#include <sys/types.h>
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif])
+
+AC_BROKEN2(inet_aton,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif],
+[0,0])
+
+AC_BROKEN2(inet_ntop,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif],
+[0, 0, 0, 0])
+
+AC_BROKEN2(inet_pton,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif],
+[0,0,0])
+
+dnl
+dnl Check for sa_len in struct sockaddr,
+dnl needs to come before the getnameinfo test
+dnl
+AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
+#include <sys/socket.h>])
+
+if test "$ac_cv_func_getaddrinfo" = "yes"; then
+ rk_BROKEN_GETADDRINFO
+ if test "$ac_cv_func_getaddrinfo_numserv" = no; then
+ AC_LIBOBJ(getaddrinfo)
+ AC_LIBOBJ(freeaddrinfo)
+ fi
+fi
+
+AC_NEED_PROTO([#include <stdlib.h>], setenv)
+AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
+AC_NEED_PROTO([#include <unistd.h>], gethostname)
+AC_NEED_PROTO([#include <unistd.h>], mkstemp)
+AC_NEED_PROTO([#include <unistd.h>], getusershell)
+AC_NEED_PROTO([#include <unistd.h>], daemon)
+
+AC_NEED_PROTO([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif],
+inet_aton)
+
+AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
+
+AC_REQUIRE([rk_BROKEN_REALLOC])dnl
+
+dnl strerror_r is great fun, on linux it exists before sus catched up,
+dnl so the return type is diffrent, lets check for both
+
+AC_PROTO_COMPAT([
+#include <stdio.h>
+#include <string.h>
+],
+strerror_r, int strerror_r(int, char *, size_t))
+
+AC_CHECK_FUNC([strerror_r],
+ [AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
+ [Define if you have the function strerror_r.])])
+
+dnl
+dnl Checks for prototypes and declarations
+dnl
+
+AC_PROTO_COMPAT([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+],
+gethostbyname, struct hostent *gethostbyname(const char *))
+
+AC_PROTO_COMPAT([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+],
+gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
+
+AC_PROTO_COMPAT([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+],
+getservbyname, struct servent *getservbyname(const char *, const char *))
+
+AC_PROTO_COMPAT([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+],
+getsockname, int getsockname(int, struct sockaddr*, socklen_t*))
+
+AC_PROTO_COMPAT([
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+],
+openlog, void openlog(const char *, int, int))
+
+AC_NEED_PROTO([
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+],
+crypt)
+
+dnl variables
+
+rk_CHECK_VAR(h_errno,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+
+rk_CHECK_VAR(h_errlist,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+
+rk_CHECK_VAR(h_nerr,
+[#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+
+rk_CHECK_VAR([__progname],
+[#ifdef HAVE_ERR_H
+#include <err.h>
+#endif])
+
+AC_CHECK_DECLS([optarg, optind, opterr, optopt, environ],[],[],[
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif])
+
+dnl
+dnl Check for fields in struct tm
+dnl
+
+AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
+AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
+
+dnl
+dnl or do we have a variable `timezone' ?
+dnl
+
+rk_CHECK_VAR(timezone,[#include <time.h>])
+rk_CHECK_VAR(altzone,[#include <time.h>])
+
+AC_HAVE_TYPE([sa_family_t],[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+AC_HAVE_TYPE([socklen_t],[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+AC_HAVE_TYPE([struct sockaddr], [
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+AC_HAVE_TYPE([struct sockaddr_storage], [
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+AC_HAVE_TYPE([struct addrinfo], [
+#include <sys/types.h>
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
+AC_HAVE_TYPE([struct iovec],[
+#include <sys/types.h>
+#include <sys/uio.h>
+])
+AC_HAVE_TYPE([struct msghdr],[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif])
+
+dnl
+dnl Check for struct winsize
+dnl
+
+AC_KRB_STRUCT_WINSIZE
+
+dnl
+dnl Check for struct spwd
+dnl
+
+AC_KRB_STRUCT_SPWD
+
+#
+# Check if we want samba's socket wrapper
+#
+
+samba_SOCKET_WRAPPER
+
+dnl won't work with automake
+dnl moved to AC_OUTPUT in configure.in
+dnl AC_CONFIG_FILES($1/Makefile)
+
+LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
+
+AC_SUBST(DIR_roken)dnl
+AC_SUBST(LIB_roken)dnl
+AC_SUBST(INCLUDES_roken)dnl
+])
diff --git a/third_party/heimdal/cf/roken-h-process.pl b/third_party/heimdal/cf/roken-h-process.pl
new file mode 100644
index 0000000..e797dd2
--- /dev/null
+++ b/third_party/heimdal/cf/roken-h-process.pl
@@ -0,0 +1,184 @@
+#!/usr/bin/perl
+
+use Getopt::Std;
+
+my $debug = 0;
+
+getopts('dc:p:o:') || die "foo";
+
+if ($opt_d) {
+ $debug = 1;
+}
+
+die "missing arg" if (!defined $opt_c || !defined $opt_p || !defined $opt_o);
+
+my %defines;
+my $IN;
+my $OUT;
+
+print "parse config.h\n" if ($debug);
+
+open IN, $opt_c || die "failed open ${opt_c}";
+
+my @nesting;
+
+push @nesting, 1;
+
+while (<IN>) {
+ if (m/\s*#ifdef\s+(.*)/) {
+ my $var = $1;
+ if (defined $defines{$var}) {
+ push @nesting, 1;
+ } else {
+ push @nesting, 0;
+ }
+ next;
+ } elsif (m/\s*#ifndef\s+(.*)/) {
+ my $var = $1;
+ if (defined $defines{$var}) {
+ push @nesting, 0;
+ } else {
+ push @nesting, 1;
+ }
+ next;
+ } elsif (m/\s*#else/) {
+ my $var = pop @nesting;
+ $var = !$var;
+ push @nesting, $var;
+ next;
+ } elsif ($nesting[$#nesting] and m/\s*#define\s+(\w+)\s+(\S+)/) {
+ my $res = $2;
+ $res = 1 if (!defined $res);
+ $defines{$1} = $res;
+ }
+}
+
+close IN;
+
+if ($debug) {
+ foreach my $i (keys %defines) {
+ print "k: $i v: $defines{$i}\n";
+ }
+}
+
+open IN, "$opt_p" || die "failed open ${opt_p}";
+open OUT, ">$opt_o" || die "failed open ${opt_o}";
+
+print "parse roken.h.in\n" if ($debug);
+
+print OUT "/* This is an OS dependent, generated file */\n";
+print OUT "\n";
+print OUT "\n";
+print OUT "#ifndef __ROKEN_H__\n";
+print OUT "#define __ROKEN_H__\n";
+print OUT "\n";
+
+@nesting = (1);
+
+while (<IN>) {
+ if (m/\s*#ifdef\s+(.*)/) {
+ my $var = $1;
+ if (defined $defines{$var}) {
+ push @nesting, 1;
+ } else {
+ push @nesting, 0;
+ }
+ next;
+ } elsif (m/\s*#ifndef\s+(.*)/) {
+ my $var = $1;
+ if (defined $defines{$var}) {
+ push @nesting, 0;
+ } else {
+ push @nesting, 1;
+ }
+ next;
+ } elsif (m/\s*#if\s+(.*)/) {
+ my $res = parse_if($1);
+ print "line = $res: $1\n" if ($debug);
+ push @nesting, $res;
+ next;
+ } elsif (m/\s*#elif\s+(.*)/) {
+ my $res = pop @nesting;
+ if ($res gt 0) {
+ $res = -1;
+ } else {
+ my $res = parse_if($1);
+ }
+ push @nesting, $res;
+ next;
+ } elsif (m/\s*#else/) {
+ my $var = pop @nesting;
+ $var = !$var;
+ push @nesting, $var;
+ next;
+ } elsif (m/\s*#endif/) {
+ pop @nesting;
+ next;
+ }
+ print "line: $_\n" if ($debug);
+ print "nesting dep $#{nesting}\n" if ($debug);
+ my $i = 0, $t = 1;
+ while ($i le $#nesting) {
+ $t = 0 if ($nesting[$i] le 0);
+ print "nesting $i val $nesting[$i] -> $t\n" if ($debug);
+ $i++;
+ }
+ if ($t) {
+ print OUT;
+ }
+}
+
+print OUT "\n";
+print OUT "#endif /* __ROKEN_H__ */\n";
+
+
+close IN;
+
+exit 0;
+
+sub parse_if
+{
+ my ($neg, $var);
+
+ $_ = shift;
+
+ if (m/^\s*$/) {
+ print "end $_\n" if ($debug);
+ return 1;
+ } elsif (m/^\(([^&]+)\&\&(.*)\)\s*\|\|\s*\(([^&]+)\&\&(.*)\)$/) {
+ print "($1 and $2) or ($3 and $4)\n" if ($debug);
+ return ((parse_if($1) and parse_if($2)) or (parse_if($3) and parse_if($4)));
+ } elsif (m/^([^&]+)\&\&(.*)$/) {
+ print "$1 and $2\n" if ($debug);
+ return parse_if($1) and parse_if($2);
+ } elsif (m/^([^\|]+)\|\|(.*)$/) {
+ print "$1 or $2\n" if ($debug);
+ return (parse_if($1) or parse_if($2));
+ } elsif (m/^\s*(\!)?\s*defined\((\w+)\)/) {
+ ($neg, $var) = ($1, $2);
+ print "def: ${neg}-defined(${var})\n" if ($debug);
+ my $res = defined $defines{$var};
+ if ($neg eq "!") {
+ if ($res) {
+ $res = 0;
+ } else {
+ $res = 1;
+ }
+ }
+ print "res: $res\n" if ($debug);
+ return $res;
+ } elsif (m/^\s*(\!)?(\w+)/) {
+ ($neg, $var) = ($1, $2);
+ print "var: $neg $var\n" if ($debug);
+ my $res;
+ if (defined $defines{$var}) {
+ $res = $defines{$var};
+ } else {
+ $res = 0;
+ }
+ $res = ! $res if ($neg =~ m/!/);
+ print "res: $res\n" if ($debug);
+ return $res;
+ }
+ die "failed parse: $_\n";
+}
diff --git a/third_party/heimdal/cf/roken.m4 b/third_party/heimdal/cf/roken.m4
new file mode 100644
index 0000000..d4fedda
--- /dev/null
+++ b/third_party/heimdal/cf/roken.m4
@@ -0,0 +1,64 @@
+dnl $Id$
+dnl
+dnl try to look for an installed roken library with sufficient stuff
+dnl
+dnl set LIB_roken to the what we should link with
+dnl set DIR_roken to if the directory should be built
+dnl set CPPFLAGS_roken to stuff to add to CPPFLAGS
+
+dnl AC_ROKEN(version,directory-to-try,roken-dir,fallback-library,fallback-cppflags)
+AC_DEFUN([AC_ROKEN], [
+
+AC_ARG_WITH(roken,
+ AS_HELP_STRING([--with-roken=dir],[use the roken library in dir]),
+[if test "$withval" = "no"; then
+ AC_MSG_ERROR(roken is required)
+fi])
+
+save_CPPFLAGS="${CPPFLAGS}"
+
+case $with_roken in
+yes|"")
+ dirs="$2" ;;
+*)
+ dirs="$with_roken" ;;
+esac
+
+roken_installed=no
+
+for i in $dirs; do
+
+AC_MSG_CHECKING(for roken in $i)
+
+CPPFLAGS="-I$i/include ${CPPFLAGS}"
+
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#include <roken.h>
+#if ROKEN_VERSION < $1
+#error old roken version, should be $1
+fail
+#endif
+]])],[roken_installed=yes; break])
+
+AC_MSG_RESULT($roken_installed)
+
+done
+
+CPPFLAGS="$save_CPPFLAGS"
+
+if test "$roken_installed" != "yes"; then
+ DIR_roken="roken"
+ LIB_roken='$4'
+ CPPFLAGS_roken='$5'
+ AC_CONFIG_SUBDIRS(lib/roken)
+else
+ LIB_roken="$i/lib/libroken.la"
+ CPPFLAGS_roken="-I$i/include"
+fi
+
+LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
+
+AC_SUBST(LIB_roken)dnl
+AC_SUBST(DIR_roken)dnl
+AC_SUBST(CPPFLAGS_roken)dnl
+])
diff --git a/third_party/heimdal/cf/socket-wrapper.m4 b/third_party/heimdal/cf/socket-wrapper.m4
new file mode 100644
index 0000000..2804d1f
--- /dev/null
+++ b/third_party/heimdal/cf/socket-wrapper.m4
@@ -0,0 +1,16 @@
+dnl $Id$
+dnl
+AC_DEFUN([samba_SOCKET_WRAPPER], [
+
+AC_ARG_ENABLE(socket-wrapper,
+ AS_HELP_STRING([--enable-socket-wrapper],
+ [use sambas socket-wrapper for testing]))
+
+AM_CONDITIONAL(have_socket_wrapper, test "x$enable_socket_wrapper" = xyes)dnl
+
+if test "x$enable_socket_wrapper" = xyes ; then
+ AC_DEFINE(SOCKET_WRAPPER_REPLACE, 1,
+ [Define if you want to use samba socket wrappers.])
+fi
+
+])
diff --git a/third_party/heimdal/cf/sunos.m4 b/third_party/heimdal/cf/sunos.m4
new file mode 100644
index 0000000..938fc3a
--- /dev/null
+++ b/third_party/heimdal/cf/sunos.m4
@@ -0,0 +1,29 @@
+dnl
+dnl $Id$
+dnl
+
+AC_DEFUN([rk_SUNOS],[
+sunos=no
+case "$host" in
+*-*-solaris2.7)
+ sunos=57
+ ;;
+*-*-solaris2.1[[1-9]])
+ AC_DEFINE([__EXTENSIONS__], [1],
+ [Enable general extensions on Solaris.])
+ AC_DEFINE([_STDC_C11_BCI], [1],
+ [Enable C11 prototypes for memset_s and friends])
+ sunos=511
+ ;;
+*-*-solaris2.[[89]] | *-*-solaris2.10)
+ sunos=58
+ ;;
+*-*-solaris2*)
+ sunos=50
+ ;;
+esac
+if test "$sunos" != no; then
+ AC_DEFINE_UNQUOTED(SunOS, $sunos,
+ [Define to what version of SunOS you are running.])
+fi
+])
diff --git a/third_party/heimdal/cf/symbol-version.py b/third_party/heimdal/cf/symbol-version.py
new file mode 100644
index 0000000..414f06f
--- /dev/null
+++ b/third_party/heimdal/cf/symbol-version.py
@@ -0,0 +1,85 @@
+#
+# Copyright (c) 2008 Kungliga Tekniska Högskolan
+# (Royal Institute of Technology, Stockholm, Sweden).
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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.
+
+
+import sys
+
+tokens = [ 'SYMBOL' ]
+literals = ['{','}',';', ':']
+
+t_SYMBOL = r'[a-zA-Z_][a-zA-Z0-9_\.]*'
+t_ignore = " \t\n"
+
+def t_error(t):
+ print "Illegal character '%s'" % t.value[0]
+ t.lexer.skip(1)
+
+import ply.lex as lex
+lex.lex()
+
+namespace = "global"
+symbols = []
+
+def p_syms(p):
+ 'syms : SYMBOL "{" elements "}"'
+ print "# %s" % p[1]
+
+def p_elements(p):
+ '''elements : element
+ | element elements'''
+
+def p_element(p):
+ '''element : SYMBOL ":"
+ | SYMBOL ";"'''
+ global namespace
+ if p[2] == ':':
+ namespace = p[1]
+ else:
+ symbols.append([namespace, p[1]])
+
+def p_error(p):
+ if p:
+ print "Syntax error at '%s'" % p.value
+ else:
+ print "Syntax error at EOF"
+
+import ply.yacc as yacc
+yacc.yacc()
+
+lines = sys.stdin.readlines()
+
+for line in lines:
+ yacc.parse(line)
+
+for symbol in symbols:
+ if symbol[0] == "global":
+ print "%s" % symbol[1]
diff --git a/third_party/heimdal/cf/telnet.m4 b/third_party/heimdal/cf/telnet.m4
new file mode 100644
index 0000000..c48e5f9
--- /dev/null
+++ b/third_party/heimdal/cf/telnet.m4
@@ -0,0 +1,75 @@
+dnl
+dnl $Id$
+dnl
+dnl stuff used by telnet
+
+AC_DEFUN([rk_TELNET],[
+AC_DEFINE(AUTHENTICATION, 1,
+ [Define if you want authentication support in telnet.])dnl
+AC_DEFINE(ENCRYPTION, 1,
+ [Define if you want encryption support in telnet.])dnl
+AC_DEFINE(DES_ENCRYPTION, 1,
+ [Define if you want to use DES encryption in telnet.])dnl
+AC_DEFINE(DIAGNOSTICS, 1,
+ [Define this to enable diagnostics in telnet.])dnl
+AC_DEFINE(OLD_ENVIRON, 1,
+ [Define this to enable old environment option in telnet.])dnl
+if false; then
+ AC_DEFINE(ENV_HACK, 1,
+ [Define this if you want support for broken ENV_{VAR,VAL} telnets.])
+fi
+
+# Simple test for streamspty, based on the existance of getmsg(), alas
+# this breaks on SunOS4 which have streams but BSD-like ptys
+#
+# And also something wierd has happend with dec-osf1, fallback to bsd-ptys
+
+case "$host" in
+*-*-aix3*|*-*-sunos4*|*-*-osf*|*-*-hpux1[[01]]*)
+ ;;
+*)
+ AC_CHECK_FUNC(getmsg)
+ if test "$ac_cv_func_getmsg" = "yes"; then
+ AC_CACHE_CHECK([if getmsg works], ac_cv_func_getmsg_works,
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <stdio.h>
+ #include <errno.h>
+
+ int main(int argc, char **argv)
+ {
+ int ret;
+ ret = getmsg(open("/dev/null", 0), NULL, NULL, NULL);
+ if(ret < 0 && errno == ENOSYS)
+ return 1;
+ return 0;
+ }
+ ]])], [ac_cv_func_getmsg_works=yes],
+ [ac_cv_func_getmsg_works=no],
+ [ac_cv_func_getmsg_works=no]))
+ if test "$ac_cv_func_getmsg_works" = "yes"; then
+ AC_DEFINE(HAVE_GETMSG, 1,
+ [Define if you have a working getmsg.])
+ AC_DEFINE(STREAMSPTY, 1,
+ [Define if you have streams ptys.])
+ fi
+ fi
+ ;;
+esac
+
+AH_BOTTOM([
+
+/* Set this to the default system lead string for telnetd
+ * can contain %-escapes: %s=sysname, %m=machine, %r=os-release
+ * %v=os-version, %t=tty, %h=hostname, %d=date and time
+ */
+#undef USE_IM
+
+/* Used with login -p */
+#undef LOGIN_ARGS
+
+/* set this to a sensible login */
+#ifndef LOGIN_PATH
+#define LOGIN_PATH BINDIR "/login"
+#endif
+])
+])
diff --git a/third_party/heimdal/cf/test-package.m4 b/third_party/heimdal/cf/test-package.m4
new file mode 100644
index 0000000..afada2f
--- /dev/null
+++ b/third_party/heimdal/cf/test-package.m4
@@ -0,0 +1,135 @@
+dnl $Id$
+dnl
+dnl rk_TEST_PACKAGE(package,program,libraries,extra libs,
+dnl default locations, conditional, config-program, headers)
+
+AC_DEFUN([rk_TEST_PACKAGE],[
+AC_ARG_WITH($1,
+ AS_HELP_STRING([--with-$1=dir],[use $1 in dir]))
+AC_ARG_WITH($1-lib,
+ AS_HELP_STRING([--with-$1-lib=dir],[use $1 libraries in dir]),
+[if test "$withval" = "yes" -o "$withval" = "no"; then
+ AC_MSG_ERROR([No argument for --with-$1-lib])
+elif test "X$with_$1" = "X"; then
+ with_$1=yes
+fi])
+AC_ARG_WITH($1-include,
+ AS_HELP_STRING([--with-$1-include=dir],[use $1 headers in dir]),
+[if test "$withval" = "yes" -o "$withval" = "no"; then
+ AC_MSG_ERROR([No argument for --with-$1-include])
+elif test "X$with_$1" = "X"; then
+ with_$1=yes
+fi])
+AC_ARG_WITH($1-config,
+ AS_HELP_STRING([--with-$1-config=path],[config program for $1]))
+
+m4_ifval([$6],
+ m4_define([rk_pkgname], $6),
+ m4_define([rk_pkgname], AS_TR_CPP($1)))
+
+AC_MSG_CHECKING(for $1)
+
+case "$with_$1" in
+yes|"") d='$5' ;;
+no) d= ;;
+*) d="$with_$1" ;;
+esac
+
+header_dirs=
+lib_dirs=
+for i in $d; do
+ if test "$with_$1_include" = ""; then
+ if test -d "$i/include/$1"; then
+ header_dirs="$header_dirs $i/include/$1"
+ fi
+ if test -d "$i/include"; then
+ header_dirs="$header_dirs $i/include"
+ fi
+ fi
+ if test "$with_$1_lib" = ""; then
+ if test -d "$i/lib$abilibdirext"; then
+ lib_dirs="$lib_dirs $i/lib$abilibdirext"
+ fi
+ fi
+done
+
+if test "$with_$1_include"; then
+ header_dirs="$with_$1_include $header_dirs"
+fi
+if test "$with_$1_lib"; then
+ lib_dirs="$with_$1_lib $lib_dirs"
+fi
+
+if test "$with_$1_config" = ""; then
+ with_$1_config='$7'
+fi
+
+$1_cflags=
+$1_libs=
+
+case "$with_$1_config" in
+yes|no|""|"$7")
+ if test -f $with_$1/bin/$7 ; then
+ with_$1_config=$with_$1/bin/$7
+ fi
+ ;;
+esac
+
+case "$with_$1_config" in
+yes|no|"")
+ ;;
+*)
+ $1_cflags="`$with_$1_config --cflags 2>&1`"
+ $1_libs="`$with_$1_config --libs 2>&1`"
+ ;;
+esac
+
+found=no
+if test "$with_$1" != no; then
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ if test "$[]$1_cflags" -a "$[]$1_libs"; then
+ CFLAGS="$[]$1_cflags $save_CFLAGS"
+ LIBS="$[]$1_libs $save_LIBS"
+ m4_ifval([$8],[AC_CHECK_HEADERS([[$8]])])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[]])],[
+ INCLUDE_$1="$[]$1_cflags"
+ LIB_$1="$[]$1_libs"
+ AC_MSG_RESULT([from $with_$1_config])
+ found=yes])
+ fi
+ if test "$found" = no; then
+ ires= lres=
+ for i in $header_dirs; do
+ CFLAGS="-I$i $save_CFLAGS"
+ m4_ifval([$8],[AC_CHECK_HEADERS([[$8]])])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]],[[]])],[ires=$i;break])
+ done
+ for i in $lib_dirs; do
+ LIBS="-L$i $3 $4 $save_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[]])],[lres=$i;break])
+ done
+ if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
+ INCLUDE_$1="-I$ires"
+ LIB_$1="-L$lres $3 $4"
+ found=yes
+ AC_MSG_RESULT([headers $ires, libraries $lres])
+ fi
+ fi
+ CFLAGS="$save_CFLAGS"
+ LIBS="$save_LIBS"
+fi
+
+if test "$found" = yes; then
+ AC_DEFINE_UNQUOTED(rk_pkgname, 1, [Define if you have the $1 package.])
+ with_$1=yes
+else
+ with_$1=no
+ INCLUDE_$1=
+ LIB_$1=
+ AC_MSG_RESULT(no)
+fi
+
+AC_SUBST(INCLUDE_$1)
+AC_SUBST(LIB_$1)
+])
diff --git a/third_party/heimdal/cf/valgrind-suppressions b/third_party/heimdal/cf/valgrind-suppressions
new file mode 100644
index 0000000..44f3f37
--- /dev/null
+++ b/third_party/heimdal/cf/valgrind-suppressions
@@ -0,0 +1,168 @@
+{
+ linux db init brokenness
+ Memcheck:Param
+ pwrite64(buf)
+ fun:do_pwrite64
+ fun:__os_io
+ fun:__memp_pgwrite
+ fun:__memp_fsync
+ fun:__bam_read_root
+ fun:__bam_open
+ fun:__db_dbopen
+ fun:__db_open
+ fun:DB_open
+}
+{
+ linux strerror
+ Memcheck:Leak
+ fun:_vgrZU_libcZdsoZa_malloc
+ fun:rwlock_add_to_list
+ fun:rwlock_have_already
+ fun:pthread_rwlock_rdlock
+ fun:__dcigettext
+ fun:dcgettext
+ fun:strerror_r
+ fun:strerror
+}
+{
+ linux db close brokenness
+ Memcheck:Param
+ pwrite64(buf)
+ fun:do_pwrite64
+ fun:__os_io
+ fun:__memp_pgwrite
+ fun:__memp_fsync
+ fun:__db_sync
+ fun:__db_close
+ fun:DB_close
+}
+{
+ GLIBC 2.1.2 getservbyname defect
+ Memcheck:Leak
+ fun:_vgrZU_libcZdsoZa_malloc
+ fun:strdup
+ obj:*
+ obj:*
+ fun:getservbyname_r@@GLIBC_2.1.2
+ fun:getservbyname
+}
+{
+ glibc getaddrinfo defect
+ Memcheck:Leak
+ fun:_vgrZU_libcZdsoZa_malloc
+ fun:__libc_res_nsend
+ fun:__libc_res_nquery
+ fun:__libc_res_nquerydomain
+ fun:__libc_res_nsearch
+ obj:*
+ fun:gaih_inet
+ fun:getaddrinfo
+}
+{
+ glibc dlopen failure called from /bin/ls
+ Memcheck:Addr4
+ obj:/lib/ld-2.3.6.so
+ obj:/lib/ld-2.3.6.so
+ obj:/lib/ld-2.3.6.so
+}
+{
+ Unknown suppression in runtime link editor
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+}
+{
+ Unknown suppression in runtime link editor
+ Memcheck:Addr4
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+}
+{
+ glibc sed leak 1
+ Memcheck:Leak
+ fun:calloc
+ obj:/bin/sed
+ obj:/bin/sed
+ obj:/bin/sed
+ obj:/bin/sed
+ obj:/bin/sed
+ fun:(below main)
+}
+{
+ Heimdal one-time init leak 1
+ Memcheck:Leak
+ ...
+ fun:heim_base_once_f
+ ...
+}
+{
+ Heimdal one-time init leak 2
+ Memcheck:Leak
+ fun:pthread_once
+ ...
+}
+{
+ Heimdal one-time init leak 3
+ Memcheck:Leak
+ fun:calloc
+ fun:_heim_alloc_object
+ fun:heim_dict_create
+ fun:_krb5_load_plugins
+ fun:init_context_once
+ fun:once_callback_caller
+ fun:pthread_once
+ fun:heim_base_once_f
+ fun:krb5_init_context
+ fun:main
+}
+{
+ Heimdal one-time init leak 4
+ Memcheck:Leak
+ fun:calloc
+ fun:heim_dict_create
+ fun:_krb5_load_plugins
+ fun:init_context_once
+ fun:once_callback_caller
+ fun:pthread_once
+ fun:heim_base_once_f
+ fun:krb5_init_context
+ fun:main
+}
+{
+ Heimdal ipropd-master leak 1
+ Memcheck:Leak
+ ...
+ fun:krb5_kt_resolve
+ fun:main
+ obj:*ipropd-master
+}
+{
+ Heimdal ipropd-master leak 2
+ Memcheck:Leak
+ ...
+ fun:kadm5_init_with_skey_ctx
+ fun:main
+ obj:*ipropd-master
+}
+{
+ Heimdal ipropd-slave leak 1
+ Memcheck:Leak
+ ...
+ fun:krb5_auth_con_init
+ ...
+ fun:krb5_sendauth
+ fun:main
+ obj:*ipropd-slave
+}
+{
+ Heimdal ipropd-slave leak 2
+ Memcheck:Leak
+ ...
+ fun:kadm5_init_with_password_ctx
+ fun:main
+ obj:*ipropd-slave
+}
diff --git a/third_party/heimdal/cf/vararray.m4 b/third_party/heimdal/cf/vararray.m4
new file mode 100644
index 0000000..8511b16
--- /dev/null
+++ b/third_party/heimdal/cf/vararray.m4
@@ -0,0 +1,16 @@
+dnl
+dnl $Id$
+dnl
+dnl Test for variable size arrays.
+dnl
+
+AC_DEFUN([rk_C_VARARRAY], [
+ AC_CACHE_CHECK([if the compiler supports variable-length arrays],[rk_cv_c_vararray],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int x = 0; { int y[x]; }]])],
+ [rk_cv_c_vararray=yes],
+ [rk_cv_c_vararray=no])])
+ if test "$rk_cv_c_vararray" = yes; then
+ AC_DEFINE([HAVE_VARIABLE_LENGTH_ARRAY], [1],
+ [Define if your compiler supports variable-length arrays.])
+ fi
+])
diff --git a/third_party/heimdal/cf/version-script.m4 b/third_party/heimdal/cf/version-script.m4
new file mode 100644
index 0000000..f08e013
--- /dev/null
+++ b/third_party/heimdal/cf/version-script.m4
@@ -0,0 +1,39 @@
+dnl check if ld supports --version-script
+dnl
+AC_DEFUN([rk_VERSIONSCRIPT],[
+AC_CACHE_CHECK(for ld --version-script, rk_cv_version_script,[
+ rk_cv_version_script=no
+
+ cat > conftest.map <<EOF
+HEIM_GSS_V1 {
+ global: gss*;
+};
+HEIM_GSS_V1_1 {
+ global: gss_init_creds;
+} HEIM_GSS_V1;
+EOF
+cat > conftest.c <<EOF
+int gss_init_creds(int foo) { return 0; }
+EOF
+
+ if AC_TRY_COMMAND([${CC-cc} -c $CFLAGS -fPIC conftest.c]) &&
+ AC_TRY_COMMAND([${CC-cc} -shared -Wl,--version-script,conftest.map $CFLAGS $LDFLAGS -o libconftestlib.so conftest.o]);
+ then
+ rk_cv_version_script=yes
+ fi
+rm -rf conftest* libconftest* .libs
+])
+
+if test $rk_cv_version_script = yes ; then
+ doversioning=yes
+ LDFLAGS_VERSION_SCRIPT="-Wl,--version-script,"
+else
+ doversioning=no
+ LDFLAGS_VERSION_SCRIPT=
+fi
+AC_SUBST(VERSIONING)
+
+AM_CONDITIONAL(versionscript,test $doversioning = yes)
+AC_SUBST(LDFLAGS_VERSION_SCRIPT)
+
+]) \ No newline at end of file
diff --git a/third_party/heimdal/cf/w32-check-exported-symbols.pl b/third_party/heimdal/cf/w32-check-exported-symbols.pl
new file mode 100644
index 0000000..5de49ff
--- /dev/null
+++ b/third_party/heimdal/cf/w32-check-exported-symbols.pl
@@ -0,0 +1,129 @@
+########################################################################
+#
+# Copyright (c) 2010, Secure Endpoints Inc.
+# All rights reserved.
+#
+# 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.
+#
+# 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
+# COPYRIGHT HOLDER 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.
+#
+
+use Getopt::Long;
+use Pod::Usage;
+use feature "switch";
+
+my $def_name = '';
+my $vs_name = '';
+my $show_help = 0;
+
+my %syms;
+
+my $def_only = 0;
+my $vs_only = 0;
+
+GetOptions ("def=s" => \$def_name,
+ "vs=s" => \$vs_name,
+ "help|?" => \$show_help) or pod2usage( -exitval => 2,
+ -verbose => 3 );
+pod2usage( -exitval => 1,
+ -verbose => 3 ) if $show_help or !$def_name or !$vs_name;
+
+open (my $def, '<', $def_name) or die $!;
+open (my $vs, '<', $vs_name) or die $!;
+
+# First go through the version-script
+
+my $global = 0;
+
+while(<$vs>)
+{
+ next unless m/^([^#]+)/;
+
+ @a = split(/\s+|(\{|})/,$1);
+
+ for $f (@a) {
+ given ($f) {
+ when (/global\:/) { $global = 1; }
+ when (/{|}|.*\:/) { $global = 0; }
+ when (/(.*)\;/ and $global == 1) {
+ $syms{$1} = 1;
+ }
+ }
+ }
+}
+
+while(<$def>)
+{
+ next if m/^#/;
+ next unless m/^;!([^;]+)/ or m/^([^;]+);?(!?)/;
+
+ @a = split(/\s+/, $1);
+
+ for $f (@a) {
+ next if $f =~ /EXPORTS/ or $f =~ /DATA/ or not $f;
+
+ if (not exists $syms{$f} and not $2) {
+ print "$f: Only in DEF\n";
+ ++$def_only;
+ }
+ delete $syms{$f};
+ }
+}
+
+#while (($k,$v) = each %syms) {
+for $k (sort keys %syms) {
+ print "$k: Only in VS\n";
+ ++$vs_only;
+}
+
+close($def);
+close($vs);
+
+if ($def_only or $vs_only) {
+ print "\nMismatches found.\n";
+ exit(1);
+}
+
+__END__
+
+=head1 NAME
+
+w32-sync-exported-symbols.pl - Synchronize Windows .def with version-script
+
+=head1 SYNOPSIS
+
+w32-sync-exported-symbols.pl {options}
+
+ Options:
+ --def Name of .def file
+ --vs Name of version-script file
+
+=head1 DESCRIPTION
+
+Verifies that all the symbols exported by the version-script is also
+accounted for in the .def file. Also checks that no extra symbols are
+exported by the .def file unless they are marked as safe.
+
+=cut
+
diff --git a/third_party/heimdal/cf/w32-def-from-dll.pl b/third_party/heimdal/cf/w32-def-from-dll.pl
new file mode 100644
index 0000000..77fb4d9
--- /dev/null
+++ b/third_party/heimdal/cf/w32-def-from-dll.pl
@@ -0,0 +1,212 @@
+########################################################################
+#
+# Copyright (c) 2010, Secure Endpoints Inc.
+# All rights reserved.
+#
+# 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.
+#
+# 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
+# COPYRIGHT HOLDER 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.
+#
+
+my $show_module_name = 1;
+my $use_indent = 1;
+my $strip_leading_underscore = 0;
+my $always_export = 0;
+my $module_name = "";
+my $local_prefix = "SHIM_";
+my %forward_exports = ();
+my %local_exports = ();
+
+sub build_forwarder_target_list($)
+{
+ $fn = shift;
+
+ print STDERR "Processing defs from file [$fn]\n";
+
+ open(SP, '-|', "dumpbin /exports \"".$fn."\"") or die "Can't open pipe for $fn";
+
+ LINE:
+ while (<SP>) {
+# 112 6F 00071CDC krb5_encrypt_size
+
+ /^ +([[:digit:]]+)\s+[[:xdigit:]]+\s[[:xdigit:]]{8,}\s+(\S+)(?:| = (\S*))$/ && do {
+ my ($ordinal, $symbol, $in) = ($1, $2, $3);
+
+ if ($in eq "") { $in = $symbol };
+ $forward_exports{$symbol} = $in;
+ };
+ }
+
+ close SP;
+}
+
+# Dump all symbols for the given dll file that are defined and have
+# external scope.
+
+sub build_def_file($)
+{
+ $fn = shift;
+
+ print STDERR "Opening dump of DLL [$fn]\n";
+
+ open(SP, '-|', "dumpbin /exports \"".$fn."\"") or die "Can't open pipe for $fn";
+
+ LINE:
+ while (<SP>) {
+# 112 6F 00071CDC krb5_encrypt_size
+
+ /^ +([[:digit:]]+)\s+[[:xdigit:]]+\s[[:xdigit:]]{8,}\s+(\S+)(?:| = (\S*))$/ && do {
+ my ($ordinal, $symbol, $in) = ($1, $2, $3);
+
+ if ($strip_leading_underscore && $symbol =~ /_(.*)/) {
+ $symbol = $1;
+ }
+ if (exists $local_exports{$symbol}) {
+ print "\t".$symbol;
+ print " = ".$local_exports{$symbol};
+ if ($in ne $local_exports{$symbol} and $in ne "") {
+ print STDERR "Incorrect calling convention for local $symbol\n";
+ print STDERR " ".$in." != ".$local_exports{$symbol}."\n";
+ }
+ print "\t@".$ordinal."\n";
+ } elsif (exists $local_exports{$local_prefix.$symbol}) {
+ print "\t".$symbol;
+ print " = ".$local_exports{$local_prefix.$symbol};
+ print "\t@".$ordinal."\n";
+ } elsif (exists $forward_exports{$symbol}) {
+ print "\t".$symbol;
+ print " = ".$module_name;
+ if ($in ne $forward_exports{$symbol} and $in ne "") {
+ print STDERR "Incorrect calling convention for $symbol\n";
+ print STDERR " ".$in." != ".$forward_exports{$symbol}."\n";
+ }
+ my $texp = $forward_exports{$symbol};
+ if ($texp =~ /^_([^@]+)$/) { $texp = $1; }
+ print $texp."\t@".$ordinal."\n";
+ } elsif ($always_export) {
+ print "\t".$symbol." = ".$local_prefix.$symbol;
+ print "\t@".$ordinal."\n";
+ } else {
+ print STDERR "Symbol not found: $symbol\n";
+ }
+ };
+ }
+
+ close SP;
+}
+
+sub build_local_exports_list($)
+{
+ $fn = shift;
+
+ print STDERR "Opening dump of object [$fn]\n";
+
+ open(SP, '-|', "dumpbin /symbols \"".$fn."\"") or die "Can't open pipe for $fn";
+
+ LINE:
+ while (<SP>) {
+ # 009 00000010 SECT3 notype () External | _remove_error_table@4
+ m/^[[:xdigit:]]{3,}\s[[:xdigit:]]{8,}\s(\w+)\s+\w*\s+(?:\(\)| )\s+(\w+)\s+\|\s+(\S+)$/ && do {
+ my ($section, $visibility, $symbol) = ($1, $2, $3);
+
+ if ($section ne "UNDEF" && $visibility eq "External") {
+
+ my $exp_name = $symbol;
+
+ if ($symbol =~ m/^_(\w+)(?:@.*|)$/) {
+ $exp_name = $1;
+ }
+
+ if ($symbol =~ m/^_([^@]+)$/) {
+ $symbol = $1;
+ }
+
+ $local_exports{$exp_name} = $symbol;
+ }
+ };
+ }
+
+ close SP;
+}
+
+sub process_file($)
+{
+ $fn = shift;
+
+ if ($fn =~ m/\.dll$/i) {
+ build_def_file($fn);
+ } elsif ($fn =~ m/\.obj$/i) {
+ build_local_exports_list($fn);
+ } else {
+ die "File type not recognized for $fn.";
+ }
+}
+
+sub use_response_file($)
+{
+ $fn = shift;
+
+ open (RF, '<', $fn) or die "Can't open response file $fn";
+
+ while (<RF>) {
+ /^(\S+)$/ && do {
+ process_file($1);
+ }
+ }
+ close RF;
+}
+
+print "; This is a generated file. Do not modify directly.\n";
+print "EXPORTS\n";
+
+for (@ARGV) {
+ ARG: {
+ /^-m(.*)$/ && do {
+ $module_name = $1.".";
+ last ARG;
+ };
+
+ /^-l(.*)$/ && do {
+ $local_prefix = $1."_";
+ last ARG;
+ };
+
+ /^-a$/ && do {
+ $always_export = 1;
+ last ARG;
+ };
+
+ /^-e(.*)$/ && do {
+ build_forwarder_target_list($1);
+ last ARG;
+ };
+
+ /^@(.*)$/ && do {
+ use_response_file($1);
+ last ARG;
+ };
+
+ process_file($_);
+ }
+}
diff --git a/third_party/heimdal/cf/w32-detect-vc-version.pl b/third_party/heimdal/cf/w32-detect-vc-version.pl
new file mode 100644
index 0000000..213ca29
--- /dev/null
+++ b/third_party/heimdal/cf/w32-detect-vc-version.pl
@@ -0,0 +1,49 @@
+########################################################################
+#
+# Copyright (c) 2010, Secure Endpoints Inc.
+# All rights reserved.
+#
+# 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.
+#
+# 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
+# COPYRIGHT HOLDER 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.
+#
+
+# Try to detect the version of Visual C++ in use by parsing the output
+# of cl.exe.
+
+$cl_cmd = shift;
+
+die "C compiler command should be specified" if ($cl_cmd eq '');
+
+open(CL, '-|', $cl_cmd." 2>&1") or die "Can't run C compiler command [$cl_cmd]";
+
+$verline = <CL>;
+
+if ($verline =~ /(\d+).(\d+).(\d+).(\d+)/) {
+ print "Found Version: $1.$2.$3.$4\n";
+ exit $1 + 0;
+} else {
+ print "Mismatch";
+ exit 1;
+}
diff --git a/third_party/heimdal/cf/w32-hh-toc-from-info.pl b/third_party/heimdal/cf/w32-hh-toc-from-info.pl
new file mode 100644
index 0000000..9be8ef6
--- /dev/null
+++ b/third_party/heimdal/cf/w32-hh-toc-from-info.pl
@@ -0,0 +1,124 @@
+########################################################################
+#
+# Copyright (c) 2010, Secure Endpoints Inc.
+# All rights reserved.
+#
+# 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.
+#
+# 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
+# COPYRIGHT HOLDER 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.
+#
+
+use HTML::TreeBuilder;
+
+
+my $input_file = "index.html";
+my $toc_file = "toc.hhc";
+
+for (@ARGV) {
+ ARG: {
+ /-o(.*)/ && do {
+ $toc_file = $1;
+ last ARG;
+ };
+
+ $input_file = $_;
+ }
+}
+
+print "Processing TOC in $input_file\n";
+print "Writing to $toc_file\n";
+
+open(TOC, '>', $toc_file) or die "Can't open $toc_file\n";
+
+my $tree = HTML::TreeBuilder->new();
+
+$tree->parse_file($input_file);
+
+my $contents = $tree->look_down('class', 'contents');
+if (defined($contents)) {
+ my $clist = $contents->find_by_tag_name('ul');
+}
+
+print TOC '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<meta name="GENERATOR" content="Heimdal">
+</head>
+<body>
+';
+
+process_ul_element($clist, 0);
+
+print TOC '
+</body>
+</html>
+';
+
+
+sub process_ul_element
+{
+ my $e = shift;
+ my $level = shift;
+
+ return unless defined($e);
+
+ if ($e->tag() eq "ul") {
+
+ print TOC ' 'x$level;
+ print TOC "<ul>\n";
+
+ my @items = $e->content_list();
+
+ for (@items) {
+ process_li_element($_, $level + 1);
+ }
+
+ print TOC ' 'x$level;
+ print TOC "</ul>\n";
+ }
+}
+
+sub process_li_element
+{
+ my $e = shift;
+ my $level = shift;
+
+ if ($e->tag() eq "li") {
+ my $a = $e->find_by_tag_name('a');
+
+ my $href = $a->attr('href');
+ my @ac = $a->content_list();
+ my $title = $ac[0];
+
+ print TOC " "x$level;
+ print TOC "<li><object type=\"text/sitemap\"><param name=\"Name\" value=\"$title\"><param name=\"Local\" value=\"$href\"></object>\n";
+
+ my @items = $e->content_list();
+
+ for (@items) {
+ process_ul_element($_, $level + 1);
+ }
+ }
+}
+
diff --git a/third_party/heimdal/cf/w32-list-externs-from-objs.pl b/third_party/heimdal/cf/w32-list-externs-from-objs.pl
new file mode 100644
index 0000000..9712120
--- /dev/null
+++ b/third_party/heimdal/cf/w32-list-externs-from-objs.pl
@@ -0,0 +1,114 @@
+########################################################################
+#
+# Copyright (c) 2010, Secure Endpoints Inc.
+# All rights reserved.
+#
+# 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.
+#
+# 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
+# COPYRIGHT HOLDER 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.
+#
+
+my $show_module_name = 1;
+my $use_indent = 1;
+my $strip_leading_underscore = 0;
+
+# Dump all symbols for the given object file that are defined and have
+# external scope.
+
+sub dump_symbols_for_file($)
+{
+ $fn = shift;
+
+ print STDERR "Opening dump of object [$fn]\n";
+
+ open(SP, '-|', "dumpbin /symbols \"".$fn."\"") or die "Can't open pipe for $fn";
+
+ LINE:
+ while (<SP>) {
+ # 008 00000000 SECT3 notype () External | _encode_AccessDescription
+
+ /^[[:xdigit:]]{3,}\s[[:xdigit:]]{8,}\s(\w+)\s+\w*\s+(\(\)| )\s+(\w+)\s+\|\s+([0-9a-zA-Z\@\_]+)$/ && do {
+ my ($section, $type, $visibility, $symbol) = ($1, $2, $3, $4);
+
+ if ($section ne "UNDEF" && $visibility eq "External") {
+ print $fn if $show_module_name;
+ print "\t" if $use_indent || $show_module_name;
+
+ if ($strip_leading_underscore && $symbol =~ /_(.*)/) {
+ $symbol = $1;
+ }
+ if ($strip_leading_underscore && $symbol =~ /(.*)\@.*$/) {
+ $symbol = $1;
+ }
+ print $symbol;
+ if ($type ne "()") {
+ print "\tDATA";
+ }
+ print "\n";
+ }
+ };
+ }
+
+ close SP;
+}
+
+sub use_response_file($)
+{
+ $fn = shift;
+
+ open (RF, '<', $fn) or die "Can't open response file $fn";
+
+ while (<RF>) {
+ /(\S+)/ && do {
+ dump_symbols_for_file($1);
+ }
+ }
+ close RF;
+}
+
+for (@ARGV) {
+ ARG: {
+ /^-q$/ && do {
+ $show_module_name = 0;
+ last ARG;
+ };
+
+ /^-1$/ && do {
+ $use_indent = 0;
+ last ARG;
+ };
+
+ /^-u$/ && do {
+ $strip_leading_underscore = 1;
+ last ARG;
+ };
+
+ /^@(.*)$/ && do {
+ use_response_file($1);
+ last ARG;
+ };
+
+ dump_symbols_for_file($_);
+ }
+}
diff --git a/third_party/heimdal/cf/wflags.m4 b/third_party/heimdal/cf/wflags.m4
new file mode 100644
index 0000000..bc128bc
--- /dev/null
+++ b/third_party/heimdal/cf/wflags.m4
@@ -0,0 +1,33 @@
+dnl $Id$
+dnl
+dnl set WFLAGS
+
+AC_DEFUN([rk_WFLAGS],[
+
+AC_ARG_ENABLE(developer,
+ AS_HELP_STRING([--enable-developer], [enable developer warnings]))
+if test "X$enable_developer" = Xyes; then
+ dwflags="-Werror"
+fi
+AM_CONDITIONAL(DEVELOPER_MODE, test "X$enable_developer" = Xyes)
+
+WFLAGS_NOUNUSED=""
+if test -z "$WFLAGS" -a "$GCC" = "yes"; then
+ # leave these out for now:
+ # -Wcast-align doesn't work well on alpha osf/1
+ # -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast
+ # -Wmissing-declarations -Wnested-externs
+ # -Wstrict-overflow=5
+ WFLAGS="ifelse($#, 0,-Wall, $1) $dwflags"
+
+ #
+ # WFLAGS_LITE can be appended to WFLAGS to turn off a host of warnings
+ # that fail for various bits of older code in appl/. Let's not use it
+ # for the main libraries, though.
+ WFLAGS_LITE="-Wno-extra -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-shadow"
+ # -Wno-unused-result (not supported on gcc-4.2)
+
+fi
+AC_SUBST(WFLAGS)dnl
+AC_SUBST(WFLAGS_LITE)dnl
+])
diff --git a/third_party/heimdal/cf/win32.m4 b/third_party/heimdal/cf/win32.m4
new file mode 100644
index 0000000..5561ad9
--- /dev/null
+++ b/third_party/heimdal/cf/win32.m4
@@ -0,0 +1,16 @@
+dnl $Id$
+dnl rk_WIN32_EXPORT buildsymbol symbol-that-export
+AC_DEFUN([rk_WIN32_EXPORT],[AH_TOP([#ifdef $1
+#ifndef $2
+#ifdef _WIN32_
+#define $2_FUNCTION __declspec(dllexport)
+#define $2_CALL __stdcall
+#define $2_VARIABLE __declspec(dllexport)
+#else
+#define $2_FUNCTION
+#define $2_CALL
+#define $2_VARIABLE
+#endif
+#endif
+#endif
+])])
diff --git a/third_party/heimdal/cf/with-all.m4 b/third_party/heimdal/cf/with-all.m4
new file mode 100644
index 0000000..adfde1f
--- /dev/null
+++ b/third_party/heimdal/cf/with-all.m4
@@ -0,0 +1,42 @@
+dnl
+dnl $Id$
+dnl
+
+dnl AC_WITH_ALL(name)
+
+AC_DEFUN([AC_WITH_ALL], [
+AC_ARG_WITH($1,
+ AS_HELP_STRING([--with-$1=dir],
+ [use $1 in dir]))
+
+AC_ARG_WITH($1-lib,
+ AS_HELP_STRING([--with-$1-lib=dir],
+ [use $1 libraries in dir]),
+[if test "$withval" = "yes" -o "$withval" = "no"; then
+ AC_MSG_ERROR([No argument for --with-$1-lib])
+elif test "X$with_$1" = "X"; then
+ with_$1=yes
+fi])
+
+AC_ARG_WITH($1-include,
+ AS_HELP_STRING([--with-$1-include=dir],
+ [use $1 headers in dir]),
+[if test "$withval" = "yes" -o "$withval" = "no"; then
+ AC_MSG_ERROR([No argument for --with-$1-include])
+elif test "X$with_$1" = "X"; then
+ with_$1=yes
+fi])
+
+case "$with_$1" in
+yes) ;;
+no) ;;
+"") ;;
+*) if test "$with_$1_include" = ""; then
+ with_$1_include="$with_$1/include"
+ fi
+ if test "$with_$1_lib" = ""; then
+ with_$1_lib="$with_$1/lib$abilibdirext"
+ fi
+ ;;
+esac
+]) \ No newline at end of file