Testsuite: fakens: check for sys/socket.h
[exim.git] / test / configure.ac
CommitLineData
151b83f8
PH
1dnl Process this file with autoconf to produce a configure script.
2
3dnl This is required at the start; the name is the name of a file
4dnl it should be seeing, to verify it is in the same directory.
5
6AC_INIT(listtests)
7
8dnl A safety precaution
9
10AC_PREREQ(2.57)
11
12dnl Checks for programs.
13
14AC_PROG_CC
15
16dnl Checks for header files.
17
bba15024 18AC_CHECK_HEADERS(sys/socket.h)
151b83f8
PH
19AC_CHECK_HEADERS(openssl/crypto.h,[CLIENT_SSL=bin/client-ssl])
20AC_CHECK_HEADERS(gnutls/gnutls.h,[CLIENT_GNUTLS=bin/client-gnutls])
21
22dnl The check on dynamically loaded modules requires the building of
23dnl something to load. This seems to be something that varies between
24dnl systems and compilers something awful. Therefore, we enable it only
25dnl for those systems and compilers that we know about.
26
27dnl I tried using AC_CANONICAL_HOST, but it insisted on looking for an
28dnl "install" script for some weird reason.
29
30host_os=`uname -s`
31
32case $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 ;;
42esac
43
bbe15da8
PH
44dnl At least one operating system needs BIND_8_COMPAT to be defined.
45
46case $host_os in
47 Darwin)
48 BIND_8_COMPAT=-DBIND_8_COMPAT
49 ;;
50esac
51
a4ca1b01
JH
52dnl Solaris requires additional libraries for networking functions.
53
54AC_SEARCH_LIBS([inet_addr], [nsl])
55AC_SEARCH_LIBS([connect], [socket])
a28352a0
HSHR
56AC_SEARCH_LIBS([inet_pton], [nsl socket resolv])
57AC_SEARCH_LIBS([inet_ntop], [nsl socket resolv])
a4ca1b01 58
151b83f8
PH
59dnl "Export" these variables
60
bbe15da8 61AC_SUBST(BIND_8_COMPAT)
151b83f8
PH
62AC_SUBST(CLIENT_SSL)
63AC_SUBST(CLIENT_GNUTLS)
64AC_SUBST(LOADED)
65AC_SUBST(LOADED_OPT)
a4ca1b01 66AC_SUBST(LIBS)
151b83f8
PH
67
68dnl This must be last; it determines what files are written
69
70AC_OUTPUT(Makefile)