3 dnl Configuration script for mLib
5 dnl (c) 2008 Straylight/Edgeware
8 dnl----- Licensing notice ---------------------------------------------------
10 dnl This file is part of the mLib utilities library.
12 dnl mLib is free software; you can redistribute it and/or modify
13 dnl it under the terms of the GNU Library General Public License as
14 dnl published by the Free Software Foundation; either version 2 of the
15 dnl License, or (at your option) any later version.
17 dnl mLib is distributed in the hope that it will be useful,
18 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 dnl GNU Library General Public License for more details.
22 dnl You should have received a copy of the GNU Library General Public
23 dnl License along with mLib; if not, write to the Free
24 dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 dnl MA 02111-1307, USA.
27 dnl--------------------------------------------------------------------------
31 AC_INIT([mLib], AUTO_VERSION, [mdw@distorted.org.uk], [mLib])
32 AC_CONFIG_SRCDIR([mLib.pc.in])
33 AC_CONFIG_AUX_DIR([config])
34 AC_CONFIG_MACRO_DIRS([m4])
35 AM_INIT_AUTOMAKE([foreign subdir-objects])
42 mdw_LIBTOOL_VERSION_INFO
44 AC_CHECK_PROGS([AUTOM4TE], [autom4te])
48 AC_DEFINE_UNQUOTED([SRCDIR], ["$(cd $srcdir && pwd)"],
49 [absolute pathname for the source directory.])
51 dnl--------------------------------------------------------------------------
52 dnl C programming environment.
57 AC_CHECK_HEADERS([float.h])
58 AC_CHECK_HEADERS([stdint.h])
61 mdw_ORIG_LIBS=$LIBS LIBS=$MLIB_LIBS
62 AC_SEARCH_LIBS([socket], [socket])
63 AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
64 MLIB_LIBS=$LIBS LIBS=$mdw_ORIG_LIBS
67 AC_CHECK_FUNCS([snprintf])
70 AC_CHECK_TYPE([socklen_t], [],
71 [AC_DEFINE([socklen_t], [int],
72 [Define to `int' if <sys/socket.h> does not define])],
74 #include <sys/socket.h>
77 dnl Which version of struct msghdr do we have?
78 AC_CHECK_MEMBERS([struct msgdr.msg_control],,, [
79 #include <sys/types.h>
80 #include <sys/socket.h>
83 dnl Find out whether we're cross-compiling.
84 AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
86 dnl Set the master library list.
89 dnl--------------------------------------------------------------------------
93 AS_HELP_STRING([--with-adns],
94 [use ADNS library for background name resolution]),
98 mdw_ORIG_LIBS=$LIBS LIBS=$MLIB_LIBS
101 *) AC_SEARCH_LIBS([adns_init], [adns], [have_adns=yes], [have_adns=no]) ;;
103 MLIB_LIBS=$LIBS LIBS=$mdw_ORIG_LIBS
104 case $want_adns,$have_adns in
106 AC_MSG_ERROR([ADNS library not found but explicitly requested])
110 AC_DEFINE([HAVE_ADNS], [1],
111 [define if you have (and want to use) the ADNS library.])
116 AC_DEFINE_UNQUOTED([BRES_SERVER],
117 ["mdw_PATH($libexecdir)/$PACKAGE/mdw_PROG(bres)"],
118 [pathname to the standalone `bres' binary.'])
122 AM_CONDITIONAL([WITH_ADNS], [test "$use_adns" = yes])
124 dnl--------------------------------------------------------------------------
125 dnl Python (used for testing).
127 AM_PATH_PYTHON([2.4],, [:])
129 dnl--------------------------------------------------------------------------
132 AC_CONFIG_HEADER([config/config.h])
133 AC_CONFIG_TESTDIR([t])
148 [t/Makefile t/atlocal])
151 dnl------ That's all, folks -------------------------------------------------