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