Commit | Line | Data |
---|---|---|
a0150d8d MW |
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 | |
b3a0ac5e | 31 | AC_INIT([mLib], AUTO_VERSION, [mdw@distorted.org.uk], [mLib]) |
a0150d8d MW |
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 | ||
7cf5c72a MW |
42 | AC_CHECK_PROGS([AUTOM4TE], [autom4te]) |
43 | ||
a0150d8d MW |
44 | mdw_MANEXT |
45 | ||
46 | AC_DEFINE_UNQUOTED([SRCDIR], ["$(cd $srcdir && pwd)"], | |
47 | [absolute pathname for the source directory.]) | |
48 | ||
49 | dnl-------------------------------------------------------------------------- | |
50 | dnl C programming environment. | |
51 | ||
52 | dnl Headers. | |
53 | AC_CHECK_HEADERS([float.h]) | |
54 | ||
55 | dnl Libraries. | |
56 | AC_SEARCH_LIBS([socket], [socket]) | |
57 | AC_SEARCH_LIBS([gethostbyname], [nsl resolv]) | |
58 | ||
59 | dnl Which version of struct msghdr do we have? | |
60 | AC_CHECK_MEMBERS([struct msgdr.msg_control],,, [ | |
61 | #include <sys/types.h> | |
62 | #include <sys/socket.h> | |
63 | ]) | |
64 | ||
173ff44a MW |
65 | dnl Find out whether we're cross-compiling. |
66 | AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes ]) | |
67 | ||
a0150d8d MW |
68 | dnl-------------------------------------------------------------------------- |
69 | dnl Name resolution. | |
70 | ||
71 | AC_ARG_WITH([adns], | |
72 | AS_HELP_STRING([--with-adns], | |
73 | [use ADNS library for background name resolution]), | |
74 | [want_adns=$withval], | |
75 | [want_adns=auto]) | |
76 | ||
77 | case $want_adns in | |
78 | no) ;; | |
79 | *) AC_SEARCH_LIBS([adns_init], [adns], [have_adns=yes], [have_adns=no]) ;; | |
80 | esac | |
81 | case $want_adns,$have_adns in | |
82 | yes,no) | |
83 | AC_MSG_ERROR([ADNS library not found but explicitly requested]) | |
84 | ;; | |
85 | yes,yes | auto,yes) | |
86 | use_adns=yes | |
87 | AC_DEFINE([HAVE_ADNS], [1], | |
88 | [define if you have (and want to use) the ADNS library.]) | |
89 | ;; | |
90 | no,* | auto,no) | |
91 | use_adns=no | |
92 | mdw_DEFINE_PATHS([ | |
93 | AC_DEFINE_UNQUOTED([BRES_SERVER], | |
94 | ["mdw_PATH($libexecdir)/$PACKAGE/mdw_PROG(bres)"], | |
95 | [pathname to the standalone `bres' binary.']) | |
96 | ]) | |
97 | ;; | |
98 | esac | |
99 | AM_CONDITIONAL([WITH_ADNS], [test "$use_adns" = yes]) | |
100 | ||
101 | dnl-------------------------------------------------------------------------- | |
7cf5c72a MW |
102 | dnl Python (used for testing). |
103 | ||
104 | AM_PATH_PYTHON([2.4],, [:]) | |
105 | ||
106 | dnl-------------------------------------------------------------------------- | |
a0150d8d MW |
107 | dnl Output. |
108 | ||
109 | AC_CONFIG_HEADER([config/config.h]) | |
7cf5c72a | 110 | AC_CONFIG_TESTDIR([t]) |
a0150d8d MW |
111 | |
112 | AC_CONFIG_FILES( | |
18c831dc MW |
113 | [Makefile] |
114 | [buf/Makefile] | |
115 | [codec/Makefile] | |
116 | [hash/Makefile] | |
117 | [mem/Makefile] | |
118 | [sel/Makefile] | |
119 | [struct/Makefile] | |
120 | [sys/Makefile] | |
121 | [test/Makefile] | |
122 | [trace/Makefile] | |
123 | [ui/Makefile] | |
7cf5c72a MW |
124 | [utils/Makefile] |
125 | [t/Makefile t/atlocal]) | |
a0150d8d MW |
126 | AC_OUTPUT |
127 | ||
128 | dnl ----- That's all, folks ------------------------------------------------- |