chiark / gitweb /
Use autoconf to find -linnstorage etc., and link statically
[innduct.git] / configure.ac
1 #  innduct
2 #  tailing reliable realtime streaming feeder for inn
3 #  configure.in
4 #
5 #  Copyright (C) 2010 Ian Jackson <ijackson@chiark.greenend.org.uk>
6
7 #  This program is free software: you can redistribute it and/or modify
8 #  it under the terms of the GNU General Public License as published by
9 #  the Free Software Foundation, either version 3 of the License, or
10 #  (at your option) any later version.
11
12 #  This program is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #  GNU General Public License for more details.
16
17 #  You should have received a copy of the GNU General Public License
18 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 #
20 #  (I believe that when you compile and link this as part of the inn2
21 #  build, with the Makefile runes I have provided, all the libraries
22 #  and files which end up included in innduct are licence-compatible
23 #  with GPLv3.  If not then please let me know.  -Ian Jackson.)
24
25 AC_INIT([innduct],[1.0],[duct.c])
26 AC_CONFIG_AUX_DIR(autoconf-aux)
27 AM_INIT_AUTOMAKE([])
28
29 AC_PROG_CC
30
31 LDFLAGS="$LDFLAGS -L/usr/lib/news"
32 AC_CHECK_HEADERS(sys/inotify.h)
33
34 LIBS="-Wl,-Bdynamic $LIBS"
35
36 AC_SEARCH_LIBS(NNTPconnect, [inn], [],[
37   AC_MSG_ERROR([failed to find libinn])
38 ])
39 AC_SEARCH_LIBS(SMinit, [innstorage storage], [],[
40   AC_MSG_ERROR([Failed to find INN storage library (-linnstorage, -lstorage)])
41 ])
42
43 # Possibly, we could link dynamically.  But the ABI stability of
44 # the inn libraries is questionable.  On Debian only the .a files
45 # are in inn2-dev.  The .so's are in inn2.deb, which isn't depended on
46 # by inn2-dev, and which doesn't have a # shlibs file for them.
47 # So right now we can't sensibly link dynamically.
48 #
49 # So we pass -Bstatic.  (Recall that LIBS is generally *prepended* to,
50 # and that it is automatically included in link lines by automake
51 # so nothing is needed in Makefile.am.)
52 LIBS="-Wl,-Bstatic $LIBS"
53
54 AM_CONFIG_HEADER(config.h)
55 AC_CONFIG_FILES([Makefile])
56 AC_OUTPUT