chiark / gitweb /
Infrastructure: Split the files into subdirectories.
[mLib] / configure.ac
CommitLineData
a0150d8d
MW
1dnl -*-autoconf-*-
2dnl
3dnl Configuration script for mLib
4dnl
5dnl (c) 2008 Straylight/Edgeware
6dnl
7
8dnl ----- Licensing notice --------------------------------------------------
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])
34AM_INIT_AUTOMAKE([foreign])
35
36AC_PROG_CC
37AM_PROG_CC_C_O
38AM_PROG_LIBTOOL
39AX_CFLAGS_WARN_ALL
40mdw_LIBTOOL_VERSION_INFO
41
42mdw_MANEXT
43
44AC_DEFINE_UNQUOTED([SRCDIR], ["$(cd $srcdir && pwd)"],
45 [absolute pathname for the source directory.])
46
47dnl--------------------------------------------------------------------------
48dnl C programming environment.
49
50dnl Headers.
51AC_CHECK_HEADERS([float.h])
52
53dnl Libraries.
54AC_SEARCH_LIBS([socket], [socket])
55AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
56
57dnl Which version of struct msghdr do we have?
58AC_CHECK_MEMBERS([struct msgdr.msg_control],,, [
59#include <sys/types.h>
60#include <sys/socket.h>
61])
62
63dnl--------------------------------------------------------------------------
64dnl Name resolution.
65
66AC_ARG_WITH([adns],
67 AS_HELP_STRING([--with-adns],
68 [use ADNS library for background name resolution]),
69 [want_adns=$withval],
70 [want_adns=auto])
71
72case $want_adns in
73 no) ;;
74 *) AC_SEARCH_LIBS([adns_init], [adns], [have_adns=yes], [have_adns=no]) ;;
75esac
76case $want_adns,$have_adns in
77 yes,no)
78 AC_MSG_ERROR([ADNS library not found but explicitly requested])
79 ;;
80 yes,yes | auto,yes)
81 use_adns=yes
82 AC_DEFINE([HAVE_ADNS], [1],
83 [define if you have (and want to use) the ADNS library.])
84 ;;
85 no,* | auto,no)
86 use_adns=no
87 mdw_DEFINE_PATHS([
88 AC_DEFINE_UNQUOTED([BRES_SERVER],
89 ["mdw_PATH($libexecdir)/$PACKAGE/mdw_PROG(bres)"],
90 [pathname to the standalone `bres' binary.'])
91 ])
92 ;;
93esac
94AM_CONDITIONAL([WITH_ADNS], [test "$use_adns" = yes])
95
96dnl--------------------------------------------------------------------------
97dnl Output.
98
99AC_CONFIG_HEADER([config/config.h])
100
101AC_CONFIG_FILES(
18c831dc
MW
102 [Makefile]
103 [buf/Makefile]
104 [codec/Makefile]
105 [hash/Makefile]
106 [mem/Makefile]
107 [sel/Makefile]
108 [struct/Makefile]
109 [sys/Makefile]
110 [test/Makefile]
111 [trace/Makefile]
112 [ui/Makefile]
113 [utils/Makefile])
a0150d8d
MW
114AC_OUTPUT
115
116dnl ----- That's all, folks -------------------------------------------------