chiark / gitweb /
Fix free/xfree bug in adns support.
[mLib] / configure.in
1 dnl -*-m4-*-
2 dnl
3 dnl $Id: configure.in,v 1.38 2004/04/08 01:36:11 mdw Exp $
4 dnl
5 dnl Configuration script for mLib
6 dnl
7 dnl (c) 1998 Straylight/Edgeware
8 dnl
9
10 dnl ----- Licensing notice --------------------------------------------------
11 dnl
12 dnl This file is part of the mLib utilities library.
13 dnl
14 dnl mLib is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU Library General Public License as
16 dnl published by the Free Software Foundation; either version 2 of the
17 dnl License, or (at your option) any later version.
18 dnl 
19 dnl mLib is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 dnl GNU Library General Public License for more details.
23 dnl 
24 dnl You should have received a copy of the GNU Library General Public
25 dnl License along with mLib; if not, write to the Free
26 dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 dnl MA 02111-1307, USA.
28
29 AC_INIT(exc.c)
30 mdw_INIT_LIB(mLib, mLib, 2.0.3)
31
32 AC_PROG_CC
33 AM_PROG_LIBTOOL
34 mdw_GCC_FLAGS
35 mdw_MANEXT
36
37 AC_CHECK_HEADERS(float.h)
38
39 mdw_CHECK_MANYLIBS(socket, socket)
40 mdw_CHECK_MANYLIBS(gethostbyname, nsl resolv)
41
42 DEPLIBS=$LIBS AC_SUBST(DEPLIBS)
43 BRES_LIBEXEC="bres" BRES_SOURCE="bres"
44 AC_SUBST(BRES_LIBEXEC) AC_SUBST(BRES_SOURCE)
45 AC_ARG_WITH(adns,
46 [  --with-adns             use ADNS library for background name resolution],
47 [want_adns=$withval], [want_adns=auto])
48 if test $want_adns != no; then
49   save_LIBS=$LIBS
50   LIBS=$DEPLIBS
51   mdw_CHECK_MANYLIBS(adns_init, adns, [have_adns=yes], [have_adns=no])
52   DEPLIBS=$LIBS
53   LIBS=$save_LIBS
54   if test $have_adns = yes; then
55     AC_DEFINE(HAVE_ADNS)
56     BRES_LIBEXEC=""
57     BRES_SOURCE="bres-adns"
58   elif test $want_adns = yes; then
59     AC_MSG_ERROR([ADNS library not found, but explicitly requested])
60   fi
61 fi
62
63 AC_CACHE_CHECK([for msg_control], [mdw_cv_msg_control],
64 [AC_TRY_COMPILE(
65 [#include <sys/types.h>
66 #include <sys/socket.h>],
67 [struct msghdr msg;
68 msg.msg_control = 0;],
69 [mdw_cv_msg_control=yes],
70 [mdw_cv_msg_control=no])])
71 if test $mdw_cv_msg_control = no; then
72   AC_DEFINE([HAVE_MSG_ACCRIGHTS])
73 fi
74
75 AC_DEFINE(BUILDING_MLIB)
76 mdw_OPT_mLib_DEBUG(mLib)
77
78 AC_OUTPUT(Makefile man/Makefile mLib-config:lib-config.in)