File: configure.ac

package info (click to toggle)
keybinder 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,488 kB
  • ctags: 158
  • sloc: sh: 10,224; ansic: 520; makefile: 105; python: 10
file content (201 lines) | stat: -rw-r--r-- 5,953 bytes parent folder | download | duplicates (2)
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
AC_INIT(keybinder, 0.2.2,
    [])
AC_CONFIG_SRCDIR(libkeybinder/bind.c)
AC_CONFIG_MACRO_DIR([m4])

# Libtool version
# When library changes: increment current, reset revision
# If library changed but is backwards-compatible: increment age
# Only internal changes: increment revision
m4_define([keybinder_lt_current],  [0])
m4_define([keybinder_lt_revision], [1])
m4_define([keybinder_lt_age],      [0])
LT_CURRENT=keybinder_lt_current
LT_REVISION=keybinder_lt_revision
LT_AGE=keybinder_lt_age
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

AM_INIT_AUTOMAKE
GNOME_COMMON_INIT

AM_MAINTAINER_MODE
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
AC_PROG_CC

dnl ****************************************************************************
dnl * Enable Automake 1.11 silent rules
dnl ****************************************************************************
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

dnl ****************************************************************************
dnl * Pkg-Config
dnl ****************************************************************************
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
if test "x$HAVE_PKGCONFIG" = "xno"; then
  AC_MSG_ERROR(you need to have pkgconfig installed !)
fi

dnl ****************************************************************************
dnl * Write the values of various paths in defs.py
dnl ****************************************************************************
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)

AS_AC_EXPAND(DATADIR, $datarootdir)
AC_SUBST(DATADIR)

AS_AC_EXPAND(LIBDIR, $libdir)
AC_SUBST(LIBDIR)

dnl ****************************************************************************
dnl * GTK
dnl ****************************************************************************
PKG_CHECK_MODULES(GTK,
	gtk+-2.0				>= 2.20
)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

dnl ***********************************
dnl * Require XKB
dnl ***********************************
X_LIBS="`$PKG_CONFIG --libs x11 xext xrender`"
X_CFLAGS="`$PKG_CONFIG --cflags x11 xext xrender`"
old_cflags="$CFLAGS"
CFLAGS="$CFLAGS $X_CFLAGS"
LIBS="$X_LIBS $LIBS"

AC_CHECK_FUNC(XkbQueryExtension, [], AC_MSG_ERROR(Could not find XKB))

CFLAGS="$old_cflags"

X_LDFLAGS="$X_LIBS"

AC_SUBST(X_CFLAGS)
AC_SUBST(X_LDFLAGS)

dnl ****************************************************************************
dnl * Python
dnl ****************************************************************************
AC_ARG_ENABLE(python,
             AS_HELP_STRING([--disable-python],
                            [disable python bindings [default=yes]]),
			    ,
                            [enable_python=yes])

AC_ARG_ENABLE(lua,
             AS_HELP_STRING([--disable-lua],
                            [disable lua bindings [default=if found]]),
			    [enable_lua=no],
                            [enable_lua=yes])

if test "x$enable_python" != "xno"; then
	dnl ****************************************************************************
	dnl * Python 2.5
	dnl ****************************************************************************
	have_python="yes"
	AM_PATH_PYTHON(2.5)
	AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])

	PKG_CHECK_MODULES(PYGTK,
		pygtk-2.0				>= 2.12
		pygobject-2.0			>= 2.15.3
	)
	AC_SUBST(PYGTK_CFLAGS)
	AC_SUBST(PYGTK_LIBS)

	dnl ******************
	dnl * Python modules
	dnl ******************
	AM_CHECK_PYMOD(glib)
	AM_CHECK_PYMOD(gobject)
	AM_CHECK_PYMOD(gtk)
	AM_CHECK_PYMOD(gtk.gdk)

	dnl Python violates C99 rules, by casting between incompatible
	dnl pointer types. GCC may generate bad code as a result of that,
	dnl so use -fno-strict-aliasing if supported.
	AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
	ac_save_cc="$CC"
	CC="$CC -fno-strict-aliasing"
	AC_CACHE_VAL(ac_cv_no_strict_aliasing_ok,
	  AC_TRY_COMPILE([],[int main() { return 0; }],
	  ac_cv_no_strict_aliasing_ok=yes,
	  ac_cv_no_strict_aliasing_ok=no))
	CC="$ac_save_cc"
	AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
	if test $ac_cv_no_strict_aliasing_ok = yes
	then
	  PYEXTRAFLAGS="-fno-strict-aliasing"
	fi

	AC_SUBST(PYEXTRAFLAGS)


	dnl ****************************************************************************
	dnl * PyGTK Codegen and defs files
	dnl ****************************************************************************
	AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
	if test "x$PYGTK_CODEGEN" = xno; then
	  AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
	fi

	AC_MSG_CHECKING(for pygtk defs)
	PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
	AC_SUBST(PYGTK_DEFSDIR)
	AC_MSG_RESULT($PYGTK_DEFSDIR)
else
	have_python="no"
fi

AM_CONDITIONAL(HAVE_PYTHON, test "x$enable_python" != "xno")

dnl ****************************************************************************
dnl  Check for Lua 5.1
dnl ****************************************************************************

if test "x$enable_lua" != "xno"; then
  AX_LUA_HEADERS
  if test "x$ac_cv_header_lua_h" = "xyes" ; then
    AX_LUA_LIB_VERSION([501], [502])
    LUA_VERSION=[5.1]
    AC_SUBST(LUA_VERSION)
    AC_SUBST(LUA_INCLUDE)
    have_lua="yes"
  else
    have_lua="no"
  fi
else
  have_lua="no"
fi
AM_CONDITIONAL(HAVE_LUA, test "x$have_lua" = "xyes")

dnl ****************************************************************************
dnl * --------------------------------------------------------------------------
dnl ****************************************************************************
AC_OUTPUT([
Makefile
libkeybinder/Makefile
libkeybinder/keybinder.pc
lua-keybinder/Makefile
python-keybinder/__init__.py
python-keybinder/Makefile
])

echo
echo $PACKAGE v$VERSION
echo

echo Prefix............... : $prefix
echo libkeybinder ........ : yes
echo python-keybinder .... : $have_python
echo lua-keybinder ....... : $have_lua
echo 

echo "Now type make to compile"
echo "Then su to root and type: make install"
echo