Release 2.3.3.1.
[mLib] / configure.ac
CommitLineData
a0150d8d
MW
1dnl -*-autoconf-*-
2dnl
3dnl Configuration script for mLib
4dnl
5dnl (c) 2008 Straylight/Edgeware
6dnl
7
51c4088b 8dnl----- Licensing notice ---------------------------------------------------
a0150d8d
MW
9dnl
10dnl This file is part of the mLib utilities library.
11dnl
12dnl mLib is free software; you can redistribute it and/or modify
13dnl it under the terms of the GNU Library General Public License as
14dnl published by the Free Software Foundation; either version 2 of the
15dnl License, or (at your option) any later version.
16dnl
17dnl mLib is distributed in the hope that it will be useful,
18dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20dnl GNU Library General Public License for more details.
21dnl
22dnl You should have received a copy of the GNU Library General Public
23dnl License along with mLib; if not, write to the Free
24dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25dnl MA 02111-1307, USA.
26
27dnl--------------------------------------------------------------------------
28dnl Initialization.
29
30mdw_AUTO_VERSION
b3a0ac5e 31AC_INIT([mLib], AUTO_VERSION, [mdw@distorted.org.uk], [mLib])
a0150d8d
MW
32AC_CONFIG_SRCDIR([mLib.pc.in])
33AC_CONFIG_AUX_DIR([config])
b012588c 34AM_INIT_AUTOMAKE([foreign subdir-objects])
3ac6fc5f 35mdw_SILENT_RULES
a0150d8d
MW
36
37AC_PROG_CC
38AM_PROG_CC_C_O
39AM_PROG_LIBTOOL
40AX_CFLAGS_WARN_ALL
41mdw_LIBTOOL_VERSION_INFO
42
7cf5c72a
MW
43AC_CHECK_PROGS([AUTOM4TE], [autom4te])
44
a0150d8d
MW
45mdw_MANEXT
46
47AC_DEFINE_UNQUOTED([SRCDIR], ["$(cd $srcdir && pwd)"],
48 [absolute pathname for the source directory.])
49
50dnl--------------------------------------------------------------------------
51dnl C programming environment.
52
5b2eac52
MW
53MLIB_LIBS=
54
a0150d8d
MW
55dnl Headers.
56AC_CHECK_HEADERS([float.h])
5007fea9 57AC_CHECK_HEADERS([stdint.h])
a0150d8d
MW
58
59dnl Libraries.
5b2eac52 60mdw_ORIG_LIBS=$LIBS LIBS=$MLIB_LIBS
a0150d8d
MW
61AC_SEARCH_LIBS([socket], [socket])
62AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
5b2eac52 63MLIB_LIBS=$LIBS LIBS=$mdw_ORIG_LIBS
a0150d8d 64
eff136f6
MW
65dnl Functions.
66AC_CHECK_FUNCS([snprintf])
67
0ce34834 68dnl Types.
892da3f9
MW
69AC_CHECK_TYPE([socklen_t], [],
70 [AC_DEFINE([socklen_t], [int],
71 [Define to `int' if <sys/socket.h> does not define])],
72 [AC_INCLUDES_DEFAULT
73#include <sys/socket.h>
74])
0ce34834 75
a0150d8d
MW
76dnl Which version of struct msghdr do we have?
77AC_CHECK_MEMBERS([struct msgdr.msg_control],,, [
78#include <sys/types.h>
79#include <sys/socket.h>
80])
81
173ff44a 82dnl Find out whether we're cross-compiling.
51c4088b 83AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
173ff44a 84
5b2eac52
MW
85dnl Set the master library list.
86AC_SUBST([MLIB_LIBS])
87
a0150d8d
MW
88dnl--------------------------------------------------------------------------
89dnl Name resolution.
90
91AC_ARG_WITH([adns],
92 AS_HELP_STRING([--with-adns],
93 [use ADNS library for background name resolution]),
94 [want_adns=$withval],
95 [want_adns=auto])
96
5b2eac52 97mdw_ORIG_LIBS=$LIBS LIBS=$MLIB_LIBS
a0150d8d
MW
98case $want_adns in
99 no) ;;
100 *) AC_SEARCH_LIBS([adns_init], [adns], [have_adns=yes], [have_adns=no]) ;;
101esac
5b2eac52 102MLIB_LIBS=$LIBS LIBS=$mdw_ORIG_LIBS
a0150d8d
MW
103case $want_adns,$have_adns in
104 yes,no)
105 AC_MSG_ERROR([ADNS library not found but explicitly requested])
106 ;;
107 yes,yes | auto,yes)
108 use_adns=yes
109 AC_DEFINE([HAVE_ADNS], [1],
110 [define if you have (and want to use) the ADNS library.])
111 ;;
112 no,* | auto,no)
113 use_adns=no
114 mdw_DEFINE_PATHS([
115 AC_DEFINE_UNQUOTED([BRES_SERVER],
116 ["mdw_PATH($libexecdir)/$PACKAGE/mdw_PROG(bres)"],
117 [pathname to the standalone `bres' binary.'])
118 ])
119 ;;
120esac
121AM_CONDITIONAL([WITH_ADNS], [test "$use_adns" = yes])
122
123dnl--------------------------------------------------------------------------
7cf5c72a
MW
124dnl Python (used for testing).
125
126AM_PATH_PYTHON([2.4],, [:])
127
128dnl--------------------------------------------------------------------------
a0150d8d
MW
129dnl Output.
130
131AC_CONFIG_HEADER([config/config.h])
7cf5c72a 132AC_CONFIG_TESTDIR([t])
a0150d8d
MW
133
134AC_CONFIG_FILES(
18c831dc
MW
135 [Makefile]
136 [buf/Makefile]
137 [codec/Makefile]
138 [hash/Makefile]
139 [mem/Makefile]
140 [sel/Makefile]
141 [struct/Makefile]
142 [sys/Makefile]
143 [test/Makefile]
144 [trace/Makefile]
145 [ui/Makefile]
7cf5c72a
MW
146 [utils/Makefile]
147 [t/Makefile t/atlocal])
a0150d8d
MW
148AC_OUTPUT
149
51c4088b 150dnl------ That's all, folks -------------------------------------------------