-
Notifications
You must be signed in to change notification settings - Fork 27
/
configure.ac
166 lines (136 loc) · 5.12 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
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright (C) 2011-2018 Daiki Ueno <[email protected]>
# Copyright (C) 2011-2018 Red Hat, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.63)
AC_CONFIG_MACRO_DIR([m4])
AC_INIT([libskk], [1.0.5], [[email protected]])
SKK_API_VERSION=1.0
SKK_API_MAJOR_VERSION=1
SKK_API_MINOR_VERSION=0
SKK_API_PC_VERSION=1.0
SKK_LIBRARY_SUFFIX="-$SKK_API_VERSION"
AC_SUBST([SKK_API_VERSION])
AC_SUBST([SKK_API_MAJOR_VERSION])
AC_SUBST([SKK_API_MINOR_VERSION])
AC_SUBST([SKK_API_PC_VERSION])
AC_SUBST([SKK_LIBRARY_SUFFIX])
AC_SUBST([SKK_LIBRARY_SUFFIX_U],[AS_TR_SH([$SKK_LIBRARY_SUFFIX])])
dnl Init automake
AM_INIT_AUTOMAKE([1.11.1 dist-xz no-dist-gzip])
AM_MAINTAINER_MODE([enable])
AC_GNU_SOURCE
dnl Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_STDC
AC_PROG_INSTALL
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.8])
# define PACKAGE_VERSION_* variables
AM_DISABLE_STATIC
AC_ISC_POSIX
AC_HEADER_STDC
LT_INIT
# If library source has changed since last release, increment revision
# If public symbols have been added, removed or changed since last release,
# increment current and set revision to 0
# If public symbols have been added since last release, increment age
# If public symbols have been removed since last release, set age to 0
m4_define([libskk_lt_current], [0])
m4_define([libskk_lt_revision], [0])
m4_define([libskk_lt_age], [0])
LT_CURRENT=libskk_lt_current
LT_REVISION=libskk_lt_revision
LT_AGE=libskk_lt_age
AC_SUBST([LT_CURRENT])
AC_SUBST([LT_REVISION])
AC_SUBST([LT_AGE])
# check gio
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.36], ,
[AC_MSG_ERROR([can't find gio-2.0])])
# check gee
PKG_CHECK_MODULES([GEE], [gee-0.8], ,
[AC_MSG_ERROR([can't find gee-0.8])])
# check json-glib
PKG_CHECK_MODULES([JSON_GLIB], [json-glib-1.0], ,
[AC_MSG_ERROR([can't find json-glib-1.0])])
# check xkbcommon
PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], ,
[AC_MSG_ERROR([can't find xkbcommon])])
LIBSKK_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS $XKBCOMMON_CFLAGS"
AC_SUBST(LIBSKK_CFLAGS)
LIBSKK_LIBS="$GIO_LIBS $GEE_LIBS $JSON_GLIB_LIBS $XKBCOMMON_LIBS"
AC_SUBST(LIBSKK_LIBS)
GOBJECT_INTROSPECTION_CHECK([0.9.0])
AM_PROG_VALAC([0.14.0])
AC_SUBST(VALAC)
AC_SUBST(VALAFLAGS)
# define GETTEXT_* variables
GETTEXT_PACKAGE=libskk
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])
AC_ARG_ENABLE([fep],
AS_HELP_STRING([--enable-fep],
[compile with libfep]),
[enable_fep=$enableval], [enable_fep=no])
if test x$enable_fep = xyes; then
PKG_CHECK_MODULES([LIBFEP], [libfep-glib >= 0.0.7], , enable_fep=no)
VALA_CHECK_PACKAGES([libfep-glib], , enable_fep=no)
AC_PATH_PROG([FEP], [fep])
fi
AM_CONDITIONAL([ENABLE_FEP], [test x$enable_fep = xyes])
AC_ARG_ENABLE([docs],
AS_HELP_STRING([--enable-docs],[Enable documentation generation]),
[enable_docs=$enableval], [enable_docs=no])
AM_CONDITIONAL([ENABLE_DOCS], [test x$enable_docs = xyes])
have_valadoc=no
if test x$enable_docs = xyes; then
AC_PATH_PROG([VALADOC], [valadoc], [:])
AS_IF([test "$VALADOC" != :], have_valadoc=yes)
fi
AM_CONDITIONAL([HAVE_VALADOC], [test x$have_valadoc = xyes])
if test "x$enable_docs" = "xyes" -a "x$have_valadoc" != "xyes"; then
AC_MSG_ERROR([Doc building requested but valadoc not installed.])
fi
AC_ARG_ENABLE([code-coverage],
AS_HELP_STRING([--enable-code-coverage],
[compile with code coverage code]),
[enable_code_coverage=$enableval], [enable_code_coverage=no])
# Only enable code coverage if this isn't a release.
if test "x$enable_code_coverage" = "xyes"; then
CODE_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage -O0 -ggdb"
CODE_COVERAGE_LDFLAGS="-lgcov"
fi
AC_SUBST([CODE_COVERAGE_CFLAGS])
AC_SUBST([CODE_COVERAGE_LDFLAGS])
AC_ARG_ENABLE([valgrind-tests],
AS_HELP_STRING([--enable-valgrind-tests],
[run self tests under valgrind]),
[enable_valgrind_tests=$enableval], [enable_valgrind_tests=no])
# Run self-tests under valgrind?
if test "x$enable_valgrind_tests" = "xyes"; then
AC_CHECK_PROGS(VALGRIND, valgrind)
fi
if test -n "$VALGRIND"; then
VALGRIND_OPTS="--leak-check=full --show-reachable=no --gen-suppressions=all --num-callers=20 --error-exitcode=0 --log-file=valgrind.log.%p"
AC_SUBST(VALGRIND_OPTS)
fi
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
libskk/Makefile
libskk/libskk.pc
rules/Makefile
tools/Makefile
tests/Makefile
docs/Makefile
po/Makefile.in])
AC_OUTPUT