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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
# Copyright (C) 2012-2014 Daiki Ueno <ueno@gnu.org>
# Copyright (C) 2012-2014 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([libkkc], [0.3.5], [ueno@gnu.org])
KKC_API_VERSION=1.0
KKC_API_MAJOR_VERSION=1
KKC_API_MINOR_VERSION=0
KKC_API_PC_VERSION=1.0
KKC_LIBRARY_SUFFIX="-$KKC_API_VERSION"
AC_SUBST([KKC_API_VERSION])
AC_SUBST([KKC_API_MAJOR_VERSION])
AC_SUBST([KKC_API_MINOR_VERSION])
AC_SUBST([KKC_API_PC_VERSION])
AC_SUBST([KKC_LIBRARY_SUFFIX])
AC_SUBST([KKC_LIBRARY_SUFFIX_U],[AS_TR_SH([$KKC_LIBRARY_SUFFIX])])
dnl Init automake
AM_INIT_AUTOMAKE([1.11.1 parallel-tests])
AM_SILENT_RULES([yes])
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_CXX
AC_PROG_INSTALL
IT_PROG_INTLTOOL
dnl Check python for tests
AM_PATH_PYTHON([3])
# 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([libkkc_lt_current], [2])
m4_define([libkkc_lt_revision], [0])
m4_define([libkkc_lt_age], [0])
LT_CURRENT=libkkc_lt_current
LT_REVISION=libkkc_lt_revision
LT_AGE=libkkc_lt_age
AC_SUBST([LT_CURRENT])
AC_SUBST([LT_REVISION])
AC_SUBST([LT_AGE])
# check gio
PKG_CHECK_MODULES([GIO], [gio-2.0], ,
[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 marisa
PKG_CHECK_MODULES([MARISA], [marisa], ,
[AC_MSG_ERROR([can't find marisa])])
# libstdc++ needs to be linked with libmarisa-glib.a
MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
AC_SUBST(MARISA_GLIB_STATIC_DEPENDENCIES)
LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
AC_SUBST(LIBKKC_CFLAGS)
LIBKKC_LIBS="$GIO_LIBS $GEE_LIBS $JSON_GLIB_LIBS"
AC_SUBST(LIBKKC_LIBS)
GOBJECT_INTROSPECTION_CHECK([0.9.0])
# check vapigen
VAPIGEN_CHECK
# check valac
AM_PROG_VALAC([0.16.0])
AC_SUBST(VALAC)
# check glib
GLIB_REQUIRED=2.24
VALAFLAGS="${VALAFLAGS:+$VALAFLAGS }--target-glib=$GLIB_REQUIRED"
AC_SUBST(VALAFLAGS)
# define GETTEXT_* variables
GETTEXT_PACKAGE=libkkc
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])
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])
VALADOC_REQUIRED=0.3.1
have_valadoc=no
if test x$enable_docs = xyes; then
# make sure the library is new enough and the program exists
PKG_CHECK_MODULES([VALADOC], [valadoc-1.0 >= $VALADOC_REQUIRED])
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
# check vapigen
AC_ARG_ENABLE([vapigen],
AS_HELP_STRING([--enable-vapigen], [Enable vapi generation]),
[enable_vapigen=$enableval], [enable_vapigen=auto])
if test "x$found_introspection" = "xyes" -a "x$enable_vapigen" != "xno"; then
AC_PATH_PROG([VAPIGEN], [vapigen], [false])
if test "x$VAPIGEN" != "xfalse"; then
enable_vapigen=yes
fi
AC_SUBST(VAPIGEN)
fi
AM_CONDITIONAL(ENABLE_VAPIGEN, [test "x$enable_vapigen" = "xyes"])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
marisa-glib/Makefile
libkkc/Makefile
libkkc/kkc-1.0.pc
tools/Makefile
tests/Makefile
tests/lib/Makefile
data/Makefile
data/rules/Makefile
data/rules/default/Makefile
data/rules/act/Makefile
data/rules/azik/Makefile
data/rules/azik-jp106/Makefile
data/rules/kzik/Makefile
data/rules/tutcode/Makefile
data/rules/tutcode-touch16x/Makefile
data/rules/nicola/Makefile
data/rules/tcode/Makefile
data/rules/trycode/Makefile
data/rules/kana/Makefile
data/templates/Makefile
docs/Makefile
po/Makefile.in])
AC_CONFIG_FILES([tools/kkc-package-data], [chmod a+x tools/kkc-package-data])
AC_OUTPUT
|