chiark / gitweb /
changelog: Finalise 2.2
[innduct.git] / configure.ac
1 #  innduct
2 #  tailing reliable realtime streaming feeder for inn
3 #  configure.ac
4 #
5 #  Copyright Ian Jackson <ijackson@chiark.greenend.org.uk>
6 #  and contributors; see LICENCE.txt.
7 #  SPDX-License-Identifier: GPL-3.0-or-later
8
9 AC_INIT([innduct],[1.0],[ijackson@chiark.greenend.org.uk])
10 AC_CONFIG_AUX_DIR(autoconf-aux)
11 AM_INIT_AUTOMAKE([])
12
13 AC_PROG_CC
14
15 LDFLAGS="$LDFLAGS -L/usr/lib/news"
16 AC_CHECK_HEADERS(sys/inotify.h)
17
18 LIBS="-Wl,-Bdynamic $LIBS"
19
20 # Possibly, we could link dynamically.  But the ABI stability of
21 # the inn libraries is questionable.  On Debian only the .a files
22 # are in inn2-dev.  The .so's are in inn2.deb, which isn't depended on
23 # by inn2-dev, and which doesn't have a # shlibs file for them.
24 # So right now we can't sensibly link dynamically.
25 #
26 # So we pass -Bstatic.
27 #
28 # Recall that LIBS is generally *prepended* to.  So we need to
29 # temporarily put -Bstatic in LDFLAGS so that it ends up before
30 # the actual libraries in the following tests.
31 LDFLAGS="$LDFLAGS -Wl,-Bstatic"
32
33 AC_SEARCH_LIBS(NNTPconnect, [inn], [],[
34   AC_MSG_ERROR([failed to find libinn])
35 ])
36 AC_SEARCH_LIBS(SMinit, [innstorage storage], [],[
37   AC_MSG_ERROR([Failed to find INN storage library (-linnstorage, -lstorage)])
38 ])
39
40 # Now move the -Bstatic to LIBS where it belongs.
41 # LDFLAGS and LIBS are automatically included in link lines by automake
42 # so nothing is needed in Makefile.am.)
43 LDFLAGS="${LDFLAGS% -Wl,-Bstatic}"
44 LIBS="-Wl,-Bstatic $LIBS"
45
46 AM_CONFIG_HEADER(config.h)
47 AC_CONFIG_FILES([Makefile])
48 AC_OUTPUT