Commit | Line | Data |
---|---|---|
151b83f8 PH |
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 | ||
bba15024 | 18 | AC_CHECK_HEADERS(sys/socket.h) |
151b83f8 PH |
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 | ||
22 | dnl The check on dynamically loaded modules requires the building of | |
23 | dnl something to load. This seems to be something that varies between | |
24 | dnl systems and compilers something awful. Therefore, we enable it only | |
25 | dnl for those systems and compilers that we know about. | |
26 | ||
27 | dnl I tried using AC_CANONICAL_HOST, but it insisted on looking for an | |
28 | dnl "install" script for some weird reason. | |
29 | ||
30 | host_os=`uname -s` | |
31 | ||
32 | case $CC-$host_os in | |
33 | gcc-*linux* | gcc-*Linux* | gcc-*LINUX* | gcc-FreeBSD) | |
34 | LOADED=bin/loaded | |
bbe15da8 | 35 | LOADED_OPT="-shared -fPIC" |
151b83f8 PH |
36 | echo "Using gcc on $host_os: will compile dynamically loaded module" |
37 | ;; | |
38 | *) | |
39 | LOADED= | |
40 | echo "Will not compile dynamically loaded module: not known OS/CC combination" | |
41 | ;; | |
42 | esac | |
43 | ||
bbe15da8 PH |
44 | dnl At least one operating system needs BIND_8_COMPAT to be defined. |
45 | ||
46 | case $host_os in | |
47 | Darwin) | |
48 | BIND_8_COMPAT=-DBIND_8_COMPAT | |
49 | ;; | |
50 | esac | |
51 | ||
a4ca1b01 JH |
52 | dnl Solaris requires additional libraries for networking functions. |
53 | ||
54 | AC_SEARCH_LIBS([inet_addr], [nsl]) | |
55 | AC_SEARCH_LIBS([connect], [socket]) | |
a28352a0 HSHR |
56 | AC_SEARCH_LIBS([inet_pton], [nsl socket resolv]) |
57 | AC_SEARCH_LIBS([inet_ntop], [nsl socket resolv]) | |
a4ca1b01 | 58 | |
151b83f8 PH |
59 | dnl "Export" these variables |
60 | ||
bbe15da8 | 61 | AC_SUBST(BIND_8_COMPAT) |
151b83f8 PH |
62 | AC_SUBST(CLIENT_SSL) |
63 | AC_SUBST(CLIENT_GNUTLS) | |
64 | AC_SUBST(LOADED) | |
65 | AC_SUBST(LOADED_OPT) | |
a4ca1b01 | 66 | AC_SUBST(LIBS) |
151b83f8 PH |
67 | |
68 | dnl This must be last; it determines what files are written | |
69 | ||
70 | AC_OUTPUT(Makefile) |