chiark / gitweb /
+ * Call MEM_ROUND in __transfer_interim (avoids assert fail
[adns.git] / configure.in
1 # configure.in - input to autoconf
2 #  
3 #  This file is
4 #    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
5 #
6 #  It is part of adns, which is
7 #    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
8 #    Copyright (C) 1999 Tony Finch <dot@dotat.at>
9 #  
10 #  This program is free software; you can redistribute it and/or modify
11 #  it under the terms of the GNU General Public License as published by
12 #  the Free Software Foundation; either version 2, or (at your option)
13 #  any later version.
14 #  
15 #  This program is distributed in the hope that it will be useful,
16 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 #  GNU General Public License for more details.
19 #  
20 #  You should have received a copy of the GNU General Public License
21 #  along with this program; if not, write to the Free Software Foundation,
22 #  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
23
24 AC_INIT(src/adns.h)
25 AC_CONFIG_HEADER(src/config.h)
26 AC_PROG_CC
27 AC_PROG_CPP
28 AC_PROG_RANLIB
29
30 AC_CHECK_FUNCS(poll)
31 ADNS_C_GETFUNC(socket,socket)
32 ADNS_C_GETFUNC(inet_ntoa,nsl)
33
34 PROGS_IF_TSEARCH=adnsresfilter
35 AC_SUBST(PROGS_HAVE_TSEARCH)
36 AC_CHECK_FUNC(tsearch,[
37  PROGS_HAVE_TSEARCH=$PROGS_IF_TSEARCH
38 ],[
39  PROGS_HAVE_TSEARCH='';
40  AC_MSG_WARN([tsearch missing - not building client program(s) $PROGS_IF_TSEARCH])
41 ])
42
43 AC_MSG_CHECKING(for INADDR_LOOPBACK)
44 AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
45  AC_TRY_COMPILE([
46 #include <sys/socket.h>
47 #include <netinet/in.h>
48 #include <arpa/inet.h>
49  ],[
50   INADDR_LOOPBACK;
51  ],
52  adns_cv_decl_inaddrloopback=yes,
53  adns_cv_decl_inaddrloopback=no)])
54 if test "$adns_cv_decl_inaddrloopback" = yes; then
55  AC_MSG_RESULT(found)
56 else
57  AC_MSG_RESULT([not in standard headers, urgh...])
58  AC_CHECK_HEADER(rpc/types.h,[
59   AC_DEFINE(HAVEUSE_RPCTYPES_H)
60  ],[
61   AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
62  ])
63 fi
64
65 ADNS_C_GETFUNC(inet_aton,resolv,[
66  LIBS="-lresolv $LIBS";
67  AC_MSG_WARN([inet_aton is in libresolv, urgh.  Must use -lresolv.])
68 ])
69
70 ADNS_C_GCCATTRIB
71
72 AC_SUBST(WARNS)
73
74 if test "${GCC-no}" = yes; then
75         WARNS="-Wall -Wmissing-prototypes -Wwrite-strings -Wstrict-prototypes -Wcast-qual -Wpointer-arith"
76 else
77         WARNS=
78 fi
79
80 AC_SUBST(SHLIBCC)
81 AC_SUBST(MKSHLIB_1)
82 AC_SUBST(MKSHLIB_2)
83 AC_SUBST(MKSHLIB_3)
84
85 AC_SUBST(SHLIBFORLINK)
86 AC_SUBST(SHLIBFILE)
87 AC_SUBST(SHLIBSONAME)
88
89 SHLIBFORLINK='libadns.so'
90 SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)'
91 SHLIBFILE='$(SHLIBSONAME).$(MINOR)'
92
93 SHLIBCC='$(CC) $(CFLAGS) -fpic'
94 MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -o'
95 MKSHLIB_2=''
96 MKSHLIB_3='-lc'
97
98 AC_OUTPUT(
99         settings.make Makefile
100         src/Makefile client/Makefile dynamic/Makefile regress/Makefile
101 )