1
AC_INIT([irssi-otr],[1.0.0-alpha2],[dgoulet@ev0ke.net],[],[https://github.com/dgoulet/irssi-otr])
2
AC_CONFIG_AUX_DIR([config])
5
AC_CONFIG_MACRO_DIR([config])
6
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
7
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
12
# We do not want to create a .a for the module, so disable by default.
17
AC_CHECK_LIB([pthread], [pthread_create], [],
18
[AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
21
AC_ARG_WITH([irssi-headers],
22
AS_HELP_STRING([--with-irssi-headers],
23
[Directory containing the Irssi header files]),
24
[IRSSI_HEADER_DIR="$withval"],
25
[IRSSI_HEADER_DIR="\"\""])
27
# Check for Glib. It needs to be installed anyway or this macro will not be defined.
28
AM_PATH_GLIB_2_0([2.22.0], [],
29
[AC_MSG_ERROR([Glib 2.22 is required in order to compile.
30
Please install the Glib development files.])], [gmodule])
32
AM_PATH_LIBGCRYPT(1:1.2.0,,AC_MSG_ERROR(libgcrypt 1.2.0 or newer is required.))
34
AM_PATH_LIBOTR(4.0.0, [], [AC_MSG_ERROR([libotr 4.0.0 or newer is required.])])
36
pkg_modules="gmodule-2.0 >= 2.0.0"
37
PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
39
LIBS="$LIBS $GMODULE_LIBS"
41
PACKAGE_CFLAGS="$GMODULE_CFLAGS -Wall -Werror=format-security"
42
AC_SUBST(PACKAGE_CFLAGS)
44
# Checking only a few Irssi headers is enough to tell that everything is
45
# available. This is broken I know but tell that to the irssi guys to NOT use
46
# cluster fu*** of headers and local inclusion system wide...
47
CPPFLAGS="$CPPFLAGS $PACKAGE_CFLAGS -I$IRSSI_HEADER_DIR"
50
irssi/src/core/commands.h \
51
irssi/src/core/modules.h \
52
irssi/src/core/servers.h \
53
irssi/src/core/signals.h \
54
irssi/src/core/levels.h \
55
irssi/src/core/queries.h \
56
irssi/src/core/settings.h \
57
], [], [AC_MSG_ERROR([Irssi Header files are needed])],
59
#include <irssi/irssi-config.h>
60
#ifdef HAVE_IRSSI_SRC_COMMON_H
61
#include <irssi/src/common.h>
67
CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing -fstack-protector-all -D_FORTIFY_SOURCE=2 -O1 -Wl,-z,relro,-z,now -fPIE -pie $PACKAGE_CFLAGS"
69
DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include"
70
AC_SUBST(DEFAULT_INCLUDES)
72
# Hardcoded here since irssi only searches in $HOME/.irssi/modules or this path
73
# which is unfortunate...
74
IRSSI_MODULE_DIR="/usr/lib/irssi/modules"
75
AC_SUBST(IRSSI_MODULE_DIR)
86
# Mini-report on what will be built
90
# Target architecture we're building for
94
if test $f = "-m32"; then
96
elif test $f = "-m64"; then
101
AS_ECHO_N("Target architecture: ")
102
AS_ECHO($target_arch)
104
# Print the bindir and libdir this `make install' will install into.
106
AS_ECHO_N("Module will be installed in: ")
107
AS_ECHO("`eval eval echo $IRSSI_MODULE_DIR`")