configure.ac 8.68 KB
Newer Older
Daiki Ueno's avatar
Daiki Ueno committed
1 2
# Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
# Copyright (C) 2010-2011 Red Hat, Inc.
Daiki Ueno's avatar
Daiki Ueno committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.

# This library 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
# Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA

AC_PREREQ(2.63)
20
dnl AC_CONFIG_SRCDIR([configure.ac])
Daiki Ueno's avatar
Daiki Ueno committed
21
AC_CONFIG_MACRO_DIR([m4])
22

Daiki Ueno's avatar
Daiki Ueno committed
23
AC_INIT([eekboard], [0.90.4], [ueno@unixuser.org])
24 25 26 27 28 29 30

dnl Init automake
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE([enable])
AC_GNU_SOURCE

dnl Support silent build
Daiki Ueno's avatar
Daiki Ueno committed
31
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
32 33 34 35 36 37 38 39 40 41 42 43

dnl Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_CXX

# define PACKAGE_VERSION_* variables
AM_DISABLE_STATIC
AC_ISC_POSIX
AC_HEADER_STDC
Daiki Ueno's avatar
Daiki Ueno committed
44
LT_INIT
Daiki Ueno's avatar
Daiki Ueno committed
45
IT_PROG_INTLTOOL([0.35.0])
Daiki Ueno's avatar
Daiki Ueno committed
46

47 48 49 50 51 52 53 54 55 56 57 58 59
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
  [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
  [case "$with_gtk" in
     2.0|3.0) ;;
     *) AC_MSG_ERROR([invalid gtk version specified]) ;;
   esac],
  [with_gtk=2.0])
AC_MSG_RESULT([$with_gtk])

case "$with_gtk" in
  2.0) GTK_API_VERSION=2.0
       GTK_REQUIRED=2.14.0
60
       EEK_API_VERSION=0.90
61
       EEK_API_MAJOR_VERSION=0
62 63
       EEK_API_MINOR_VERSION=90
       EEK_API_PC_VERSION=0.90
64 65 66 67
       EEK_LIBRARY_SUFFIX="-$EEK_API_VERSION"
       ;;
  3.0) GTK_API_VERSION=3.0
       GTK_REQUIRED=2.91.0
68
       EEK_API_VERSION=0.90
69
       EEK_API_MAJOR_VERSION=0
70 71
       EEK_API_MINOR_VERSION=90
       EEK_API_PC_VERSION=0.90
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
       EEK_LIBRARY_SUFFIX="-$EEK_API_VERSION"
       ;;
esac

AC_SUBST([GTK_API_VERSION])
AC_SUBST([EEK_API_VERSION])
AC_SUBST([EEK_API_MAJOR_VERSION])
AC_SUBST([EEK_API_MINOR_VERSION])
AC_SUBST([EEK_API_PC_VERSION])
AC_SUBST([EEK_LIBRARY_SUFFIX])
AC_SUBST([EEK_LIBRARY_SUFFIX_U],[AS_TR_SH([$EEK_LIBRARY_SUFFIX])])

AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])

87
AM_PATH_GLIB_2_0
88
PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= 2.25.4], ,
Daiki Ueno's avatar
Daiki Ueno committed
89
  [AC_MSG_ERROR([GLib2 not found])])
90 91
PKG_CHECK_MODULES([GIO2], [gio-2.0], ,
  [AC_MSG_ERROR([Gio2 not found])])
92 93
PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo], ,
  [AC_MSG_ERROR([PangoCairo not found])])
94 95 96 97
PKG_CHECK_MODULES([GTK], [
  gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
  gdk-$GTK_API_VERSION >= $GTK_REQUIRED], ,
  [AC_MSG_ERROR([GTK not found])])
98 99
PKG_CHECK_MODULES([GCONF2], [gconf-2.0], ,
  [AC_MSG_ERROR([GConf not found])])
100
PKG_CHECK_MODULES([XKB], [x11], ,
Daiki Ueno's avatar
Daiki Ueno committed
101
  [AC_MSG_ERROR([XKB support not found])])
Daiki Ueno's avatar
Daiki Ueno committed
102 103
PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier x11], ,
  [AC_MSG_ERROR([Libxklavier not found])])
104 105
PKG_CHECK_MODULES([LIBCROCO], [libcroco-0.6], ,
  [AC_MSG_ERROR([libcroco not found])])
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

dnl use libfakekey to generate key events
AC_MSG_CHECKING([whether you enable fakekey])
AC_ARG_ENABLE(fakekey,
              AS_HELP_STRING([--enable-fakekey=no/yes],
                             [Enable fakekey default=yes]),,
              enable_fakekey=yes)

if test x$enable_fakekey = xyes; then
  PKG_CHECK_MODULES([FAKEKEY], [libfakekey], ,
    [AC_MSG_ERROR([fakekey not found])])
  AC_DEFINE([HAVE_FAKEKEY], [1], [Define if fakekey is found])
fi
AM_CONDITIONAL(ENABLE_FAKEKEY, [test x$enable_fakekey = xyes])
AC_MSG_RESULT($enable_fakekey)

dnl use AT-SPI to capture focus/keystroke events
AC_MSG_CHECKING([whether you enable AT-SPI event handling])
AC_ARG_ENABLE(cspi,
              AS_HELP_STRING([--enable-cspi=no/yes],
                             [Enable AT-SPI event handling default=yes]),,
              enable_cspi=yes)

if test x$enable_cspi = xyes; then
  PKG_CHECK_MODULES([CSPI], [cspi-1.0], ,
    [AC_MSG_ERROR([AT-SPI C not found])])
  AC_DEFINE([HAVE_CSPI], [1], [Define if CSPI is found])
fi
AC_MSG_RESULT($enable_cspi)
AM_CONDITIONAL(ENABLE_CSPI, [test x$enable_cspi = xyes])
136

Daiki Ueno's avatar
Daiki Ueno committed
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
dnl Python language binding
AC_MSG_CHECKING([whether you enable Python language support])
AC_ARG_ENABLE(python,
              AS_HELP_STRING([--enable-python=no/yes],
                             [Enable Python language binding default=yes]),,
              enable_python=yes)
AC_MSG_RESULT($enable_python)
AM_CONDITIONAL(ENABLE_PYTHON, [test x$enable_python = xyes])

if test x"$enable_python" = x"yes"; then
    # check python
    AM_PATH_PYTHON([2.5])
    AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
    if test x"$PYTHON_CONFIG" = x""; then
        AC_PATH_PROG(PYTHON_CONFIG, python-config)
    fi
    if test x"$PYTHON_CONFIG" != x""; then
        PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
        PYTHON_LIBS=`$PYTHON_CONFIG --libs`
    else
        PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
        PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
    fi
    PYTHON_INCLUDES="$PYTHON_CFLAGS"
    AC_SUBST(PYTHON_CFLAGS)
    AC_SUBST(PYTHON_INCLUDES)
    AC_SUBST(PYTHON_LIBS)
else
    enable_python="no (disabled, use --enable-python to enable)"
fi

168
dnl Vala langauge binding
Daiki Ueno's avatar
Daiki Ueno committed
169 170 171 172 173 174 175 176
AC_MSG_CHECKING([whether you enable Vala language support])
AC_ARG_ENABLE(vala,
              AS_HELP_STRING([--enable-vala=no/yes],
                             [Enable Vala language binding default=yes]),,
              enable_vala=yes)
AC_MSG_RESULT($enable_vala)
AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])

177
dnl standalone application
178 179 180 181 182 183 184
AC_MSG_CHECKING([whether you enable eekboard])
AC_ARG_ENABLE(eekboard,
              AS_HELP_STRING([--enable-eekboard=no/yes],
                             [Build standalone application "ekboard" default=yes]),,
              enable_eekboard=yes)
AC_MSG_RESULT($enable_eekboard)
AM_CONDITIONAL(ENABLE_EEKBOARD, [test x$enable_eekboard = xyes])
Daiki Ueno's avatar
Daiki Ueno committed
185

186
dnl Clutter
187 188 189 190
AC_MSG_CHECKING([whether you enable Clutter])
AC_ARG_ENABLE(clutter,
              AS_HELP_STRING([--enable-clutter=no/yes],
                             [Enable Clutter user interface default=yes]),,
Daiki Ueno's avatar
Daiki Ueno committed
191
              enable_clutter=no)
192 193 194 195
AC_MSG_RESULT($enable_clutter)

if test x$enable_clutter = xyes; then
  PKG_CHECK_MODULES([CLUTTER], [clutter-1.0], ,
196
    [AC_MSG_ERROR([Clutter not found -- install it or add --disable-clutter])])
197
  AC_DEFINE([HAVE_CLUTTER], [1], [Define if Clutter is found])
198 199 200
  have_clutter_gtk=0
  need_swap_event_workaround=0
  PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0], [have_clutter_gtk=1],
201
    [PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-0.10 clutter-x11-1.0],
202 203 204 205
      [have_clutter_gtk=1; need_swap_event_workaround=1])])
  AC_DEFINE_UNQUOTED([HAVE_CLUTTER_GTK], $have_clutter_gtk,
    [Define if Clutter-Gtk is found])
  AC_DEFINE_UNQUOTED([NEED_SWAP_EVENT_WORKAROUND], $need_swap_event_workaround,
206
    [Define if GLX_INTEL_swap_event work around is needed])
207
fi
208
AM_CONDITIONAL(ENABLE_CLUTTER, [test x$enable_clutter = xyes])
209

Daiki Ueno's avatar
Daiki Ueno committed
210 211
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])

Daiki Ueno's avatar
Daiki Ueno committed
212
dnl to re-generate eek/*-keysym-labels.txt
Daiki Ueno's avatar
Daiki Ueno committed
213 214
AC_CHECK_PROGS([PYTHON], [python])

Daiki Ueno's avatar
Daiki Ueno committed
215 216 217 218 219
dnl define GETTEXT_* variables
GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])
AM_GLIB_GNU_GETTEXT
Daiki Ueno's avatar
Daiki Ueno committed
220
AM_GLIB_DEFINE_LOCALEDIR(EEKBOARD_LOCALEDIR)
Daiki Ueno's avatar
Daiki Ueno committed
221

222
GOBJECT_INTROSPECTION_CHECK([0.9.0])
223

224
AC_CONFIG_HEADERS([config.h])
Daiki Ueno's avatar
Daiki Ueno committed
225 226
AC_CONFIG_FILES([Makefile
eek/Makefile
227
eekboard/Makefile
228
src/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
229
tests/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
230
bindings/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
231 232
bindings/python/Makefile
bindings/python/eekboard/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
233
bindings/vala/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
234 235
docs/Makefile
docs/reference/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
236
docs/reference/eek/Makefile
237
docs/reference/eekboard/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
238
po/Makefile.in
Daiki Ueno's avatar
Daiki Ueno committed
239 240 241 242 243 244 245 246
data/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/scalable/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
247
data/themes/Makefile
248
data/keyboards/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
249
examples/Makefile
250
examples/eekboard-inscript/Makefile
251
examples/simple-client/Makefile
Daiki Ueno's avatar
Daiki Ueno committed
252 253 254 255
eek/eek-${EEK_API_VERSION}.pc
eek/eek-clutter-${EEK_API_VERSION}.pc
eek/eek-gtk-${EEK_API_VERSION}.pc
eek/eek-xkb-${EEK_API_VERSION}.pc
256 257
eek/eek-xkl-${EEK_API_VERSION}.pc
eekboard/eekboard-${EEK_API_VERSION}.pc])
Daiki Ueno's avatar
Daiki Ueno committed
258
AC_OUTPUT
259 260 261 262 263 264 265 266 267 268
AC_MSG_RESULT([
Build options:
  Version                   $VERSION
  Install prefix            $prefix
  Build shared libs         $enable_shared
  Build static libs         $enable_static
  CFLAGS                    $CFLAGS
  Build vala binding        $enable_vala
  Build document            $enable_gtk_doc
])