-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfigure.ac
154 lines (128 loc) · 4.15 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([prpltwtr], [0.14.0], [https://github.com/mikeage/prpltwtr/issues])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE([1.9.5])
REQUIRED_PKG_CONFIG="0.15.0"
AC_SUBST(REQUIRED_PKG_CONFIG)
AC_ARG_WITH([pidgin],
[AS_HELP_STRING([--without-pidgin],
[disable support for pidgin])],
[],
[with_pidgin=yes])
AC_CONFIG_SRCDIR([src/Makefile.mingw])
AC_CONFIG_HEADER([config.h])
AC_DEFINE(PURPLE_PLUGINS, 1, [Define if plugins are enabled.])
# Checks for programs.
AC_PROG_CC
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
AC_PROG_INSTALL
AC_PATH_PROG(PKG_CONFIG, [pkg-config], [no])
LIBPURPLE_DATADIR=`pkg-config --variable=datadir purple`
AC_SUBST(LIBPURPLE_DATADIR)
#
# Setup gettext
#
AC_PROG_INTLTOOL
GETTEXT_PACKAGE=prpltwtr
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
ALL_LINGUAS="es ja"
AM_GLIB_GNU_GETTEXT
if test x$PKG_CONFIG = xno ; then
AC_MSG_ERROR([*** pkg-config not found])
fi
# Checks for libraries.
PKG_PROG_PKG_CONFIG([$REQUIRED_PKG_CONFIG])
AS_IF([test "x$with_pidgin" != xno],
[PKG_CHECK_MODULES([PIDGIN], [pidgin >= 2.6 pidgin < 3.0],
[
AC_SUBST(PIDGIN_CFLAGS)
AC_SUBST(PIDGIN_LIBS)
]
)
AC_ARG_VAR([PIDGIN_DATADIR], [datadir of PIDGIN, overriding pkg-config])dnl
AC_ARG_VAR([PIDGIN_PLUGINDIR], [plugindir of PIDGIN, overriding pkg-config])dnl
AC_CACHE_CHECK([for PIDGIN][_DATADIR], [pkg_cv_][PIDGIN][_DATADIR],
[_PKG_CONFIG([PIDGIN][_DATADIR], [variable=datadir], [pidgin])])
AC_CACHE_CHECK([for PIDGIN][_PLUGINDIR], [pkg_cv_][PIDGIN][_PLUGINDIR],
[_PKG_CONFIG([PIDGIN][_PLUGINDIR], [variable=plugindir], [pidgin])])
PIDGIN[]_DATADIR=$pkg_cv_[]PIDGIN[]_DATADIR
PIDGIN[]_PLUGINDIR=$pkg_cv_[]PIDGIN[]_PLUGINDIR
AC_SUBST(PIDGIN_DATADIR)
AC_SUBST(PIDGIN_PLUGINDIR)
],[]
)
AM_CONDITIONAL([WITH_PIDGIN], [test "x$with_pidgin" != xno])
PKG_CHECK_MODULES([GLIB], [glib-2.0])
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
PKG_CHECK_MODULES([PURPLE], [purple],
[
AC_SUBST(PURPLE_CFLAGS)
AC_SUBST(PURPLE_LIBS)
]
)
AC_ARG_VAR([PURPLE_PLUGINDIR], [plugindir of PURPLE, overriding pkg-config])dnl
AC_CACHE_CHECK([for PURPLE][_DATADIR], [pkg_cv_][PURPLE][_DATADIR],
[_PKG_CONFIG([PURPLE][_DATADIR], [variable=datadir], [purple])])
AC_CACHE_CHECK([for PURPLE][_PLUGINDIR], [pkg_cv_][PURPLE][_PLUGINDIR],
[_PKG_CONFIG([PURPLE][_PLUGINDIR], [variable=plugindir], [purple])])
PURPLE[]_DATADIR=$pkg_cv_[]PURPLE[]_DATADIR
PURPLE[]_PLUGINDIR=$pkg_cv_[]PURPLE[]_PLUGINDIR
AC_SUBST(PURPLE_PLUGINDIR)
PKG_CHECK_MODULES([JSON], [json-glib-1.0 >= 0.6.2], ,
[
AC_SUBST(JSON_CFLAGS)
AC_SUBST(JSON_LIBS)
AC_MSG_RESULT(no)
AC_MSG_ERROR([You must have JSON-GLib >= 0.6.2 development headers installed to build])
]
)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
# AM_CONFIG_HEADER
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_CHECK_FUNCS([gethostname inet_ntoa memmove strcasecmp strchr strdup strerror strpbrk strrchr strstr strtoul])
case "$host" in
*-*-mingw*)
CFLAGS="$CFLAGS -O2 -Wall -mno-cygwin -mms-bitfields"
LIBS="$LIBS -no-undefined -Wl,--enable-auto-image-base -lws2_32"
;;
*)
;;
esac
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall -g3"
fi
AC_SUBST(CFLAGS)
AM_MAINTAINER_MODE
# Creating files.
AC_CONFIG_FILES([Makefile
po/Makefile.in
data/Makefile
src/Makefile
src/prpltwtr/Makefile
src/gtkprpltwtr/Makefile])
AC_OUTPUT
echo
echo $PACKAGE $VERSION
echo
AS_IF([test "x$with_pidgin" != xno],
[
echo Pidgin plugin directory: $PIDGIN_PLUGINDIR . Override by setting PIDGIN_PLUGINDIR
echo Pidgin data directory: $PIDGIN_DATADIR . Override by setting PIDGIN_DATADIR
],[])
echo libpurple plugin directory: $PURPLE_PLUGINDIR . Override by setting PURPLE_PLUGINDIR
echo
echo next steps:
echo make
echo sudo make install
echo