-dnl -*-fundamental-*-
+dnl -*-m4-*-
dnl
-dnl $Id: configure.in,v 1.15 1999/07/06 19:36:41 mdw Exp $
+dnl $Id: configure.in,v 1.37 2003/12/13 20:37:59 mdw Exp $
dnl
dnl Configuration script for mLib
dnl
dnl ----- Revision history --------------------------------------------------
dnl
dnl $Log: configure.in,v $
-dnl Revision 1.15 1999/07/06 19:36:41 mdw
-dnl Wonderful new version number.
+dnl Revision 1.37 2003/12/13 20:37:59 mdw
+dnl Add adns support in background resolver.
+dnl
+dnl Revision 1.36 2003/11/29 20:38:38 mdw
+dnl Debianization fixes.
+dnl
+dnl Revision 1.35 2003/11/29 11:59:17 mdw
+dnl Various stuff.
+dnl
+dnl Revision 1.34 2003/10/12 14:54:18 mdw
+dnl Version bump.
+dnl
+dnl Revision 1.33 2003/05/18 15:17:04 mdw
+dnl Version bump.
+dnl
+dnl Revision 1.32 2003/05/16 00:26:22 mdw
+dnl Version bump.
+dnl
+dnl Revision 1.30 2003/04/23 12:50:30 mdw
+dnl New manpage installer.
+dnl
+dnl Revision 1.29 2001/06/22 19:34:07 mdw
+dnl Find out whether @<float.h>@ exists (hack for uC-Linux).
+dnl
+dnl Revision 1.28 2000/10/08 11:07:55 mdw
+dnl Define a constant to tell @mdwopt@ that @str_qword@ is available.
+dnl Reinstate the `-pedantic' option to GCC.
+dnl
+dnl Revision 1.27 2000/08/15 21:39:13 mdw
+dnl New library configuration stuff from `common'.
+dnl
+dnl Revision 1.25 2000/07/16 18:57:42 mdw
+dnl Version bump. Change compiler flags.
+dnl
+dnl Revision 1.19 1999/11/11 18:47:33 mdw
+dnl Use `libtool' to generate a shared library.
+dnl
+dnl Revision 1.18 1999/11/11 17:48:28 mdw
+dnl New configuration system for library clients.
+dnl
+dnl Revision 1.17 1999/10/04 21:48:50 mdw
+dnl Find libraries for standalone name resolver server.
dnl
dnl Revision 1.14 1999/07/06 19:18:47 mdw
dnl Handle new manual page directory.
dnl
-dnl Revision 1.13 1999/06/01 09:45:45 mdw
-dnl Another version number bump.
-dnl
dnl Revision 1.11 1999/05/21 22:11:20 mdw
dnl Omitted version number changes from change log. Changed version
dnl number. ;-)
dnl
AC_INIT(exc.c)
-AM_INIT_AUTOMAKE(mLib, 1.4.0)
+mdw_INIT_LIB(mLib, mLib, 2.0.3)
AC_PROG_CC
+AM_PROG_LIBTOOL
mdw_GCC_FLAGS
-AC_CHECK_PROG(AR, ar, ar)
-AC_PROG_RANLIB
+mdw_MANEXT
+
+AC_CHECK_HEADERS(float.h)
+
+mdw_CHECK_MANYLIBS(socket, socket)
+mdw_CHECK_MANYLIBS(gethostbyname, nsl resolv)
+
+DEPLIBS=$LIBS AC_SUBST(DEPLIBS)
+BRES_LIBEXEC="bres" BRES_SOURCE="bres"
+AC_SUBST(BRES_LIBEXEC) AC_SUBST(BRES_SOURCE)
+AC_ARG_WITH(adns,
+[ --with-adns use ADNS library for background name resolution],
+[want_adns=$withval], [want_adns=auto])
+if test $want_adns != no; then
+ save_LIBS=$LIBS
+ LIBS=$DEPLIBS
+ mdw_CHECK_MANYLIBS(adns_init, adns, [have_adns=yes], [have_adns=no])
+ DEPLIBS=$LIBS
+ LIBS=$save_LIBS
+ if test $have_adns = yes; then
+ AC_DEFINE(HAVE_ADNS)
+ BRES_LIBEXEC=""
+ BRES_SOURCE="bres-adns"
+ elif test $want_adns = yes; then
+ AC_MSG_ERROR([ADNS library not found, but explicitly requested])
+ fi
+fi
+
+AC_CACHE_CHECK([for msg_control], [mdw_cv_msg_control],
+[AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/socket.h>],
+[struct msghdr msg;
+msg.msg_control = 0;],
+[mdw_cv_msg_control=yes],
+[mdw_cv_msg_control=no])])
+if test $mdw_cv_msg_control = no; then
+ AC_DEFINE([HAVE_MSG_ACCRIGHTS])
+fi
+AC_DEFINE(BUILDING_MLIB)
mdw_OPT_mLib_DEBUG(mLib)
-AC_OUTPUT(Makefile man/Makefile)
+AC_OUTPUT(Makefile man/Makefile mLib-config:lib-config.in)