Skip to content
Newer
Older
100644 217 lines (183 sloc) 6.17 KB
12cc644 @engla Update NEWS and README for 0.2.2
authored May 30, 2010
1 AC_INIT(keybinder, 0.2.2,
6f5dd0b @engla adapt buildsystem to build keybinder module
authored Jul 2, 2009
2 [])
e64c612 @engla Split into libkeybinder.so library and python-keybinder
authored Apr 23, 2010
3 AC_CONFIG_SRCDIR(libkeybinder/bind.c)
ae4331a @engla add some buildsystem
authored Jul 2, 2009
4 AC_CONFIG_MACRO_DIR([m4])
5
aac9446 @engla Update NEWS and library version for keybinder 0.2.1
authored Apr 26, 2010
6 # Libtool version
7 # When library changes: increment current, reset revision
8 # If library changed but is backwards-compatible: increment age
9 # Only internal changes: increment revision
10 m4_define([keybinder_lt_current], [0])
11 m4_define([keybinder_lt_revision], [1])
12 m4_define([keybinder_lt_age], [0])
13 LT_CURRENT=keybinder_lt_current
14 LT_REVISION=keybinder_lt_revision
15 LT_AGE=keybinder_lt_age
16 AC_SUBST(LT_CURRENT)
17 AC_SUBST(LT_REVISION)
18 AC_SUBST(LT_AGE)
19
ae4331a @engla add some buildsystem
authored Jul 2, 2009
20 AM_INIT_AUTOMAKE
21 GNOME_COMMON_INIT
22
23 AM_MAINTAINER_MODE
24 AM_DISABLE_STATIC
25 AM_PROG_LIBTOOL
26 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
27 AC_PROG_CC
28
29 dnl ****************************************************************************
a28d388 @engla configure.ac: Enable nicer output with silent rules
authored Nov 3, 2009
30 dnl * Enable Automake 1.11 silent rules
31 dnl ****************************************************************************
32 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
33
34 dnl ****************************************************************************
ae4331a @engla add some buildsystem
authored Jul 2, 2009
35 dnl * Pkg-Config
36 dnl ****************************************************************************
37 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
38 if test "x$HAVE_PKGCONFIG" = "xno"; then
39 AC_MSG_ERROR(you need to have pkgconfig installed !)
40 fi
41
42 dnl ****************************************************************************
43 dnl * Write the values of various paths in defs.py
44 dnl ****************************************************************************
45 AC_SUBST(VERSION)
46 AC_SUBST(PACKAGE)
47
48 AS_AC_EXPAND(DATADIR, $datarootdir)
49 AC_SUBST(DATADIR)
50
51 AS_AC_EXPAND(LIBDIR, $libdir)
52 AC_SUBST(LIBDIR)
53
54 dnl ****************************************************************************
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
55 dnl * GTK
ae4331a @engla add some buildsystem
authored Jul 2, 2009
56 dnl ****************************************************************************
ee229a8 @engla Allow building libkeybinder against GTK+ 3.0 using --enable-gtk=gtk3
authored May 8, 2011
57 AC_ARG_ENABLE(gtk,
58 [ --enable-gtk[=GTKVER] Supports gtk2 (default) or gtk3],
59 [ if test "x$enableval" = "xgtk3" ; then
60 enable_gtk3="yes"
61 else
62 enable_gtk3="no"
63 fi
64 ])
65
66 AS_IF([test "x$enable_gtk3" = "xyes"], [
67 gtk_version="gtk3"
68 PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0])
69 ], [
70 gtk_version="gtk2"
71 PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.20])
72 ])
73
e64c612 @engla Split into libkeybinder.so library and python-keybinder
authored Apr 23, 2010
74 AC_SUBST(GTK_CFLAGS)
75 AC_SUBST(GTK_LIBS)
76
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
77 dnl ***********************************
78 dnl * Require XKB
79 dnl ***********************************
2213773 @engla Use GTK+, Understand Consumed Modifiers
authored Mar 31, 2010
80 X_LIBS="`$PKG_CONFIG --libs x11 xext xrender`"
81 X_CFLAGS="`$PKG_CONFIG --cflags x11 xext xrender`"
acf61c1 @engla Use -fno-strict-aliasing for Python code
authored Apr 23, 2010
82 old_cflags="$CFLAGS"
2213773 @engla Use GTK+, Understand Consumed Modifiers
authored Mar 31, 2010
83 CFLAGS="$CFLAGS $X_CFLAGS"
84 LIBS="$X_LIBS $LIBS"
85
3400106 @engla Mark as version 0.0.9
authored Apr 6, 2010
86 AC_CHECK_FUNC(XkbQueryExtension, [], AC_MSG_ERROR(Could not find XKB))
2213773 @engla Use GTK+, Understand Consumed Modifiers
authored Mar 31, 2010
87
acf61c1 @engla Use -fno-strict-aliasing for Python code
authored Apr 22, 2010
88 CFLAGS="$old_cflags"
2213773 @engla Use GTK+, Understand Consumed Modifiers
authored Mar 31, 2010
89
e64c612 @engla Split into libkeybinder.so library and python-keybinder
authored Apr 23, 2010
90 X_LDFLAGS="$X_LIBS"
acf61c1 @engla Use -fno-strict-aliasing for Python code
authored Apr 22, 2010
91
92 AC_SUBST(X_CFLAGS)
93 AC_SUBST(X_LDFLAGS)
2213773 @engla Use GTK+, Understand Consumed Modifiers
authored Mar 31, 2010
94
ae4331a @engla add some buildsystem
authored Jul 2, 2009
95 dnl ****************************************************************************
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
96 dnl * Python
ae4331a @engla add some buildsystem
authored Jul 2, 2009
97 dnl ****************************************************************************
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
98 AC_ARG_ENABLE(python,
99 AS_HELP_STRING([--disable-python],
8094e94 @engla Configure to link against lua libraries
authored Apr 29, 2010
100 [disable python bindings [default=yes]]),
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
101 ,
102 [enable_python=yes])
103
8094e94 @engla Configure to link against lua libraries
authored Apr 29, 2010
104 AC_ARG_ENABLE(lua,
105 AS_HELP_STRING([--disable-lua],
106 [disable lua bindings [default=if found]]),
107 [enable_lua=no],
108 [enable_lua=yes])
109
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
110 if test "x$enable_python" != "xno"; then
111 dnl ****************************************************************************
112 dnl * Python 2.5
113 dnl ****************************************************************************
114 have_python="yes"
115 AM_PATH_PYTHON(2.5)
116 AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
117
118 PKG_CHECK_MODULES(PYGTK,
119 pygtk-2.0 >= 2.12
120 pygobject-2.0 >= 2.15.3
121 )
122 AC_SUBST(PYGTK_CFLAGS)
123 AC_SUBST(PYGTK_LIBS)
124
125 dnl ******************
126 dnl * Python modules
127 dnl ******************
128 AM_CHECK_PYMOD(glib)
129 AM_CHECK_PYMOD(gobject)
130 AM_CHECK_PYMOD(gtk)
131 AM_CHECK_PYMOD(gtk.gdk)
132
133 dnl Python violates C99 rules, by casting between incompatible
134 dnl pointer types. GCC may generate bad code as a result of that,
135 dnl so use -fno-strict-aliasing if supported.
136 AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
137 ac_save_cc="$CC"
138 CC="$CC -fno-strict-aliasing"
139 AC_CACHE_VAL(ac_cv_no_strict_aliasing_ok,
140 AC_TRY_COMPILE([],[int main() { return 0; }],
141 ac_cv_no_strict_aliasing_ok=yes,
142 ac_cv_no_strict_aliasing_ok=no))
143 CC="$ac_save_cc"
144 AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
145 if test $ac_cv_no_strict_aliasing_ok = yes
146 then
147 PYEXTRAFLAGS="-fno-strict-aliasing"
148 fi
149
150 AC_SUBST(PYEXTRAFLAGS)
151
152
153 dnl ****************************************************************************
154 dnl * PyGTK Codegen and defs files
155 dnl ****************************************************************************
156 AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
157 if test "x$PYGTK_CODEGEN" = xno; then
158 AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
159 fi
160
161 AC_MSG_CHECKING(for pygtk defs)
162 PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
163 AC_SUBST(PYGTK_DEFSDIR)
164 AC_MSG_RESULT($PYGTK_DEFSDIR)
165 else
166 have_python="no"
ae4331a @engla add some buildsystem
authored Jul 2, 2009
167 fi
168
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
169 AM_CONDITIONAL(HAVE_PYTHON, test "x$enable_python" != "xno")
ae4331a @engla add some buildsystem
authored Jul 2, 2009
170
171 dnl ****************************************************************************
17bdfad @engla Add lua bindings as a buildable module.
authored Apr 29, 2010
172 dnl Check for Lua 5.1
173 dnl ****************************************************************************
174
8094e94 @engla Configure to link against lua libraries
authored Apr 29, 2010
175 if test "x$enable_lua" != "xno"; then
176 AX_LUA_HEADERS
177 if test "x$ac_cv_header_lua_h" = "xyes" ; then
178 AX_LUA_LIB_VERSION([501], [502])
179 LUA_VERSION=[5.1]
180 AC_SUBST(LUA_VERSION)
181 AC_SUBST(LUA_INCLUDE)
182 have_lua="yes"
183 else
184 have_lua="no"
185 fi
17bdfad @engla Add lua bindings as a buildable module.
authored Apr 29, 2010
186 else
8094e94 @engla Configure to link against lua libraries
authored Apr 29, 2010
187 have_lua="no"
17bdfad @engla Add lua bindings as a buildable module.
authored Apr 29, 2010
188 fi
8094e94 @engla Configure to link against lua libraries
authored Apr 29, 2010
189 AM_CONDITIONAL(HAVE_LUA, test "x$have_lua" = "xyes")
17bdfad @engla Add lua bindings as a buildable module.
authored Apr 29, 2010
190
191 dnl ****************************************************************************
ae4331a @engla add some buildsystem
authored Jul 2, 2009
192 dnl * --------------------------------------------------------------------------
193 dnl ****************************************************************************
194 AC_OUTPUT([
195 Makefile
e64c612 @engla Split into libkeybinder.so library and python-keybinder
authored Apr 23, 2010
196 libkeybinder/Makefile
1b8fd11 Add a .pc file for the library.
Jérôme Guelfucci authored May 23, 2010
197 libkeybinder/keybinder.pc
17bdfad @engla Add lua bindings as a buildable module.
authored Apr 29, 2010
198 lua-keybinder/Makefile
e64c612 @engla Split into libkeybinder.so library and python-keybinder
authored Apr 23, 2010
199 python-keybinder/__init__.py
200 python-keybinder/Makefile
ae4331a @engla add some buildsystem
authored Jul 2, 2009
201 ])
202
203 echo
204 echo $PACKAGE v$VERSION
205 echo
206
207 echo Prefix............... : $prefix
ee229a8 @engla Allow building libkeybinder against GTK+ 3.0 using --enable-gtk=gtk3
authored May 8, 2011
208 echo GTK version ......... : $gtk_version
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
209 echo libkeybinder ........ : yes
210 echo python-keybinder .... : $have_python
17bdfad @engla Add lua bindings as a buildable module.
authored Apr 29, 2010
211 echo lua-keybinder ....... : $have_lua
f7b5d8a @engla Add option to --disable-python
authored Apr 23, 2010
212 echo
ae4331a @engla add some buildsystem
authored Jul 2, 2009
213
214 echo "Now type make to compile"
215 echo "Then su to root and type: make install"
216 echo
Something went wrong with that request. Please try again.