| 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | |
| 3 | dnl This is required at the start; the name is the name of a file |
| 4 | dnl it should be seeing, to verify it is in the same directory. |
| 5 | |
| 6 | AC_INIT(listtests) |
| 7 | |
| 8 | dnl A safety precaution |
| 9 | |
| 10 | AC_PREREQ(2.57) |
| 11 | |
| 12 | dnl Checks for programs. |
| 13 | |
| 14 | AC_PROG_CC |
| 15 | |
| 16 | dnl Checks for header files. |
| 17 | |
| 18 | AC_CHECK_HEADERS(sys/socket.h) |
| 19 | AC_CHECK_HEADERS(openssl/crypto.h,[CLIENT_SSL=bin/client-ssl]) |
| 20 | AC_CHECK_HEADERS(gnutls/gnutls.h,[CLIENT_GNUTLS=bin/client-gnutls]) |
| 21 | AC_CHECK_HEADERS(gnutls/gnutls.h,[B64_GNUTLS=bin/ed25519_privkey_pem_to_pubkey_raw_b64]) |
| 22 | |
| 23 | dnl The check on dynamically loaded modules requires the building of |
| 24 | dnl something to load. This seems to be something that varies between |
| 25 | dnl systems and compilers something awful. Therefore, we enable it only |
| 26 | dnl for those systems and compilers that we know about. |
| 27 | |
| 28 | dnl I tried using AC_CANONICAL_HOST, but it insisted on looking for an |
| 29 | dnl "install" script for some weird reason. |
| 30 | |
| 31 | host_os=`uname -s` |
| 32 | |
| 33 | case $CC-$host_os in |
| 34 | gcc-*linux* | gcc-*Linux* | gcc-*LINUX* | gcc-FreeBSD) |
| 35 | LOADED=bin/loaded |
| 36 | LOADED_OPT="-shared -fPIC" |
| 37 | echo "Using gcc on $host_os: will compile dynamically loaded module" |
| 38 | ;; |
| 39 | *) |
| 40 | LOADED= |
| 41 | echo "Will not compile dynamically loaded module: not known OS/CC combination" |
| 42 | ;; |
| 43 | esac |
| 44 | |
| 45 | dnl At least one operating system needs BIND_8_COMPAT to be defined. |
| 46 | |
| 47 | case $host_os in |
| 48 | Darwin) |
| 49 | BIND_8_COMPAT=-DBIND_8_COMPAT |
| 50 | ;; |
| 51 | esac |
| 52 | |
| 53 | dnl Solaris requires additional libraries for networking functions. |
| 54 | |
| 55 | AC_SEARCH_LIBS([inet_addr], [nsl]) |
| 56 | AC_SEARCH_LIBS([connect], [socket]) |
| 57 | AC_SEARCH_LIBS([inet_pton], [nsl socket resolv]) |
| 58 | AC_SEARCH_LIBS([inet_ntop], [nsl socket resolv]) |
| 59 | |
| 60 | dnl "Export" these variables |
| 61 | |
| 62 | AC_SUBST(BIND_8_COMPAT) |
| 63 | AC_SUBST(CLIENT_SSL) |
| 64 | AC_SUBST(CLIENT_GNUTLS) |
| 65 | AC_SUBST(B64_GNUTLS) |
| 66 | AC_SUBST(LOADED) |
| 67 | AC_SUBST(LOADED_OPT) |
| 68 | AC_SUBST(LIBS) |
| 69 | |
| 70 | dnl This must be last; it determines what files are written |
| 71 | |
| 72 | AC_OUTPUT(Makefile) |