chiark / gitweb /
Various manual fixes.
[mLib] / configure.in
index 01eb95f84d12db8e3617991d9c19598872a8f8db..6dfd734c2a640425f6d31007b75e18f7d397ab46 100644 (file)
@@ -1,6 +1,6 @@
-dnl -*-fundamental-*-
+dnl -*-m4-*-
 dnl
-dnl $Id: configure.in,v 1.4 1999/03/24 22:22:57 mdw Exp $
+dnl $Id$
 dnl
 dnl Configuration script for mLib
 dnl
@@ -12,43 +12,67 @@ dnl
 dnl This file is part of the mLib utilities library.
 dnl
 dnl mLib is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
+dnl it under the terms of the GNU Library General Public License as
+dnl published by the Free Software Foundation; either version 2 of the
+dnl License, or (at your option) any later version.
+dnl 
 dnl mLib is distributed in the hope that it will be useful,
 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with mLib; if not, write to the Free Software Foundation,
-dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-dnl ----- Revision history --------------------------------------------------
-dnl
-dnl $Log: configure.in,v $
-dnl Revision 1.4  1999/03/24 22:22:57  mdw
-dnl Remove redundant call to AC_PROG_INSTALL.
-dnl
-dnl Revision 1.3  1998/12/15 23:52:42  mdw
-dnl Reordered and tidied.
-dnl
-dnl Revision 1.2  1998/11/25 23:30:41  mdw
-dnl Bump the version number.
-dnl
-dnl Revision 1.1.1.1  1998/06/17 23:44:42  mdw
-dnl Initial version of mLib
-dnl
+dnl GNU Library General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU Library General Public
+dnl License along with mLib; if not, write to the Free
+dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+dnl MA 02111-1307, USA.
 
 AC_INIT(exc.c)
-AM_INIT_AUTOMAKE(mLib, 1.2.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\$(EXEEXT)" 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)
+AC_OUTPUT(Makefile man/Makefile mLib-config:lib-config.in)