File: configure.ac

package info (click to toggle)
input-pad 1.0.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,220 kB
  • sloc: sh: 11,468; ansic: 8,465; python: 860; makefile: 461
file content (278 lines) | stat: -rw-r--r-- 8,164 bytes parent folder | download | duplicates (3)
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# vim:set et ts=4:
#
# input-pad - The input pad
#
# Copyright (c) 2010-2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2010-2013 Red Hat, Inc.
#
# 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

dnl - if not 1, append datestamp to the version number.
m4_define([pad_released], [1])
m4_define([pad_major_version], [1])
m4_define([pad_minor_version], [0])
m4_define([pad_micro_version], [3])
m4_define(pad_maybe_datestamp,
    m4_esyscmd([if test x]pad_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))

m4_define([pad_version],
    pad_major_version.pad_minor_version.pad_micro_version[]pad_maybe_datestamp)

AC_INIT([input-pad], [pad_version], [http://code.google.com/p/input-pad/issues/entry],[input-pad])
AM_INIT_AUTOMAKE([1.10])
AC_GNU_SOURCE

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

dnl - VERSION
libinput_pad_VERSION="pad_major_version.pad_minor_version"
AC_SUBST(libinput_pad_VERSION)
AC_MSG_NOTICE([$PACKAGE sub version $libinput_pad_VERSION])

dnl If only source code changed, lt_revision + 1
dnl If any interface added, lt_age + 1
dnl If any interfaces changed or removed, lt_current + 1, lt_revision = 0, lt_age = 0
dnl libtool versionstring == [lt_current - lt_age].[lt_age].[lt_revision]
m4_define([lt_current], [pad_major_version])
m4_define([lt_revision], [pad_minor_version])
m4_define([lt_age], [0])
LT_VERSION_INFO="lt_current:lt_revision:lt_age"
AC_SUBST(LT_VERSION_INFO)
AC_MSG_NOTICE([library version $LT_VERSION_INFO])

dnl - define PACKAGE_VERSION_* variables
AM_SANITY_CHECK
AM_MAINTAINER_MODE(enable)
AC_DISABLE_STATIC
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_HEADER_STDC
AC_PROG_LIBTOOL
IT_PROG_INTLTOOL([0.35.0])

dnl - For dislpay Date
m4_define(pad_datedisplay,
    m4_esyscmd(date '+%a %b %d %Y' | tr -d '\n\r'))
DATE_DISPLAY="pad_datedisplay"
AC_SUBST(DATE_DISPLAY)

dnl - pkgconfig
AM_PATH_GLIB_2_0
PKG_CHECK_MODULES(GLIB2, [
    glib-2.0 >= 2.8
])

PKG_CHECK_MODULES(GMODULE2,
    [gmodule-2.0],
    [],
    [AC_MSG_NOTICE([gmodule-2.0 is required by glib-2.0 >= 2.30])]
)

dnl - check gtk
AC_ARG_WITH([gtk],
    [AS_HELP_STRING([--with-gtk=2.0|3.0],
                    [Select GTK+ version. The default is 3.0])],
    [case "$with_gtk" in
        2.0|3.0) ;;
        *) AC_MSG_ERROR([invalid gtk version specified]) ;;
     esac],
    [with_gtk=3.0]
)

case "$with_gtk" in
    2.0)
        PKG_CHECK_MODULES(GTK2, [
            gtk+-2.0
        ])
        AM_CONDITIONAL(HAVE_GTK3, false)
        AM_CONDITIONAL(HAVE_GTK2, true)
        GTK_API_VERSION=2.0
        ;;
    3.0)
        PKG_CHECK_MODULES(GTK3, [
            gtk+-3.0
        ])
        AM_CONDITIONAL(HAVE_GTK3, true)
        AM_CONDITIONAL(HAVE_GTK2, false)
        GTK_API_VERSION=3.0
    ;;
esac
AC_SUBST(GTK_API_VERSION)

PKG_CHECK_MODULES(LIBXML2, [
    libxml-2.0 >= 2.0
])

PKG_CHECK_MODULES(X11, [
    x11
])

PKG_CHECK_MODULES(XKB, [
    xkbfile
])

PKG_CHECK_MODULES(LIBXKLAVIER,
    libxklavier >= 4.0,
    have_libxklavier=yes,
    have_libxklavier=no
)
if test "x$have_libxklavier" = "xyes" ; then
    AC_DEFINE(HAVE_LIBXKLAVIER, [1], [Define if we have libxklavier])
fi

dnl - check eek
AC_MSG_CHECKING([whether you enable libeek])
AC_ARG_ENABLE(eek,
              AS_HELP_STRING([--enable-eek=no/yes],
                             [Draw keyboard using libeek default=no]),
              [],
              enable_eek=no)
AC_MSG_RESULT($enable_eek)

if test x"$enable_eek" = xyes; then
    dnl - check eek is available
    PKG_CHECK_MODULES(EEK, [
        eek-gtk-0.90 >= 1.0.6, eek-xkl-0.90 >= 1.0.6
	],, AC_MSG_ERROR([libeek not found]))
    AM_CONDITIONAL(HAVE_EEK, true)
else
    AM_CONDITIONAL(HAVE_EEK, false)
fi

dnl - check file path of glib-genmarshal
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)

dnl - GObject introspection
GOBJECT_INTROSPECTION_CHECK([0.6.8])

INPUT_PAD_GIR_SCANNERFLAGS=
if test x"$found_introspection" = x"yes" ; then
    INPUT_PAD_GIR_SCANNERFLAGS="--identifier-prefix=InputPad --symbol-prefix=input_pad"
    PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6],
                     [gir_symbol_prefix=yes],
                     [gir_symbol_prefix=no])
    if test x"$gir_symbol_prefix" = x"no" ; then
        INPUT_PAD_GIR_SCANNERFLAGS="--strip-prefix=InputPad"
    fi
fi
AC_SUBST(IBUS_GIR_SCANNERFLAGS)

dnl - check pygobject2
AC_MSG_CHECKING([where you enable pygobject2])
AC_ARG_ENABLE(pygobject2,
              AS_HELP_STRING([--enable-pygobject2=no/yes],
                             [Enable PyGObject2 default=no]),
              [],
              enable_pygobject2=no)
AC_MSG_RESULT($enable_pygobject2)

if test x"$enable_pygobject2" = xyes; then
    AM_CONDITIONAL(HAVE_PYTHON, true)
    AM_CONDITIONAL(HAVE_PYGOBJECT2, true)
    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-$PYTHON_VERSION)
    fi
    if test x"$PYTHON_CONFIG" != x""; then
        PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
        PYTHON_LIBS=`$PYTHON_CONFIG --libs`
    fi
    AC_MSG_NOTICE([PYTHON_CFLAGS=\"$PYTHON_CFLAGS\"])
    AC_MSG_NOTICE([PYTHON_LIBS=\"$PYTHON_LIBS\"])
    if test x"$PYTHON_CFLAGS" = x -o x"$PYTHON_LIBS" = x ; then
        AC_MSG_ERROR([Could not find PYTHON_CFLAGS or PYTHON_LIBS])
    fi

    AC_PATH_PROG(SWIG, swig)
    if test x"$SWIG" = x""; then
        AC_MSG_ERROR([Could not find swig])
    fi

    AC_SUBST(PYTHON_CFLAGS)
    AC_SUBST(PYTHON_LIBS)
    AC_SUBST(SWIG)
else
    if test x"$found_introspection" = x"yes" ; then
        AM_CONDITIONAL(HAVE_PYTHON, true)
    else
        AM_CONDITIONAL(HAVE_PYTHON, false)
    fi
    AM_CONDITIONAL(HAVE_PYGOBJECT2, false)
fi

dnl - check XTest module
AC_MSG_CHECKING([whether you enable xtest module])
AC_ARG_ENABLE(xtest,
              AS_HELP_STRING([--enable-xtest=no/yes],
                             [Send keyboard event with xtest. default=yes]),
              [],
              enable_xtest=yes)
AC_MSG_RESULT($enable_xtest)
AM_CONDITIONAL(HAVE_XTEST, false)

if test x"$enable_xtest" = xyes; then
    backup_LIBS=$LIBS
    if test "x$XTEST_LIBS" = "x"  ; then
        XTEST_LIBS="-lXtst"
    fi
    LIBS="$LIBS $XTEST_LIBS"
    AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
                 dnl - Do not put NULL string here so that LIBS is not overrided.
                [AC_MSG_NOTICE([use $XTEST_LIBS for XTEST module])
                 AM_CONDITIONAL(HAVE_XTEST, true)],
                [AC_MSG_NOTICE([if you want to enable X11 XTEST module, install libXtst-devel package])])
    LIBS=$backup_LIBS
fi
AC_SUBST(XTEST_LIBS)

dnl - define GETTEXT_* variables
GETTEXT_PACKAGE=input-pad
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])

AM_GLIB_GNU_GETTEXT
AM_GLIB_DEFINE_LOCALEDIR(INPUT_PAD_LOCALEDIR)

dnl - OUTPUT files
AC_CONFIG_FILES([ po/Makefile.in
Makefile
input-pad.pc
input-pad.spec
data/Makefile
input-pad/Makefile
pyinput-pad/Makefile
pyinput-pad/pyinput_pad.pth
])

AC_OUTPUT
echo "
                input-pad version pad_version


libinput_pad version:    $libinput_pad_VERSION
GTK+ version:            $GTK_API_VERSION
Have libxklavier:        $have_libxklavier
Enable EEK               $enable_eek
Enable PyGObject2        $enable_pygobject2
Enable PyGObject3        $found_introspection
GIR scannerflags         "$INPUT_PAD_GIR_SCANNERFLAGS"
Enable XTEST             $enable_xtest
lt version info          $LT_VERSION_INFO
"