1# Copyright 2016 Artem Savkov <artem.savkov@gmail.com>
2# Copyright 2017-2019 Alex Schroeder <alex@gnu.org>
3#
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17AC_INIT(
18  [bitlbee-mastodon],
19  [1.4.5],
20  [https://github.com/kensanata/bitlbee-mastodon/issues],
21  [bitlbee-mastodon],
22  [https://alexschroeder.ch/cgit/bitlbee-mastodon/about/],
23)
24
25AC_CONFIG_AUX_DIR([build-aux])
26AC_CONFIG_MACRO_DIR([m4])
27AM_INIT_AUTOMAKE([no-define])
28
29AC_PROG_CC
30AM_PROG_CC_C_O
31
32AC_DISABLE_STATIC
33AC_PROG_LIBTOOL
34
35m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
36m4_ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99])
37
38# Define PKG_CHECK_VAR() for pkg-config < 0.28
39m4_define_default(
40    [PKG_CHECK_VAR],
41    [AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
42     AS_IF([test -z "$$1"], [$1=`$PKG_CONFIG --variable="$3" "$2"`])
43     AS_IF([test -n "$$1"], [$4], [$5])]
44)
45
46# Checks for libraries.
47PKG_CHECK_MODULES([BITLBEE], [bitlbee >= 3.5])
48PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32])
49
50AC_CONFIG_HEADERS([config.h])
51
52# Checks for typedefs, structures, and compiler characteristics.
53AC_TYPE_SIZE_T
54
55# Checks for library functions.
56AC_CHECK_FUNCS([memset])
57
58# bitlbee-specific stuff
59AC_ARG_WITH([plugindir],
60    [AS_HELP_STRING([--with-plugindir], [BitlBee plugin directory])],
61    [plugindir="$with_plugindir"]
62)
63
64AS_IF(
65    [test -z "$plugindir"],
66    [PKG_CHECK_VAR(
67        [BITLBEE_PLUGINDIR],
68        [bitlbee],
69        [plugindir],
70        [plugindir="$BITLBEE_PLUGINDIR"],
71        [plugindir="$libdir/bitlbee"]
72    )]
73)
74
75AC_SUBST([plugindir])
76
77AC_ARG_WITH([bdatadir],
78    [AS_HELP_STRING([--with-bdatadir], [BitlBee data directory])],
79    [bdatadir="$with_bdatadir"]
80)
81
82AS_IF(
83    [test -z "$bdatadir"],
84    [PKG_CHECK_VAR(
85        [BITLBEE_DATADIR],
86        [bitlbee],
87        [datadir],
88        [datadir="$BITLBEE_DATADIR"],
89        [datadir="$datarootdir/bitlbee"]
90    )],
91    [datadir="$bdatadir"]
92)
93
94AC_SUBST([datadir])
95AC_SUBST([ac_cv_path_SED])
96
97AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
98AC_OUTPUT
99