forked from abstrakraft/cwiid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
126 lines (115 loc) · 3.23 KB
/
configure.ac
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
AC_INIT(CWiid,0.6.00,[email protected])
AC_CONFIG_HEADER(common/include/config.h)
AC_PROG_CC
AC_PROG_AWK
AC_PROG_LEX
if test "$LEX" != "flex"; then
AC_MSG_ERROR([flex not found])
fi
if test -z "`echo %%|$LEX -t|grep yypop_buffer_state`"; then
AC_MSG_ERROR([flex missing yypop_buffer_state - upgrade to version 2.5.33 or later])
fi
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
AC_MSG_ERROR([bison not found])
fi
AC_ARG_WITH(
[python],
[AS_HELP_STRING([--without-python],[compile without python support])],
[case $withval in
yes)
REQUIRE_PYTHON=1
PYTHON_NAME=python
;;
no)
REQUIRE_PYTHON=
PYTHON_NAME=
;;
*)
REQUIRE_PYTHON=1
PYTHON_NAME=$withval
;;
esac],
[REQUIRE_PYTHON=1; PYTHON_NAME=python])
if test $REQUIRE_PYTHON; then
AC_CHECK_PROGS([PYTHON],$PYTHON_NAME)
if test $REQUIRE_PYTHON -a ! $PYTHON; then
AC_MSG_ERROR([$PYTHON_NAME not found])
fi
fi
AC_SUBST(PYTHON)
if test $PYTHON; then
PYTHON_VERSION=[`$PYTHON -c 'import sys; print sys.version[:3]'`]
AC_SUBST(PYTHON_VERSION)
AC_DEFINE([HAVE_PYTHON],1,[Define to 1 if python support is enabled])
fi
AC_CHECK_LIB([pthread], [pthread_create],,
AC_MSG_ERROR([pthread library not found]))
AC_CHECK_LIB([bluetooth], [hci_devid],,
AC_MSG_ERROR([bluetooth library not found]))
AC_CHECK_LIB([dl], [dlopen],,
AC_MSG_ERROR([dl lib not found]))
#AC_CHECK_LIB([rt], [clock_gettime],,
# AC_MSG_ERROR([rt lib not found]))
AC_HEADER_STDC
AC_CHECK_HEADER([stdint.h],,
AC_MSG_ERROR([stdint.h not found]))
AC_CHECK_HEADER([bluetooth/bluetooth.h],,
AC_MSG_ERROR([bluetooth/bluetooth.h not found]))
AC_CHECK_HEADERS([bluetooth/l2cap.h bluetooth/hci.h],,
AC_MSG_ERROR([bluetooth headers not found]),
[#include <bluetooth/bluetooth.h>])
AC_CHECK_HEADER([linux/input.h],,
AC_MSG_ERROR([linux/input.h not found]))
AC_CHECK_HEADER([linux/uinput.h],,
AC_MSG_ERROR([linux/uinput.h]),
[#include <linux/input.h>])
AC_ISC_POSIX
AC_ARG_WITH(cwiid-config-dir,AC_HELP_STRING([--with-cwiid-config-dir],
[CWiid configuration directory, default to $(sysconfdir)/cwiid]))
if test -z $with_cwiid_config_dir; then
CWIID_CONFIG_DIR='${sysconfdir}/cwiid'
else
CWIID_CONFIG_DIR=$with_cwiid_config_dir
fi
AC_SUBST(CWIID_CONFIG_DIR)
AC_ARG_WITH(cwiid-plugins-dir,AC_HELP_STRING([--with-cwiid-plugins-dir],
[CWiid plugins directory, default to $(libdir)/cwiid/plugins]))
if test -n $with_cwiid_plugins_dir; then
CWIID_PLUGINS_DIR='${libdir}/cwiid/plugins'
else
CWIID_PLUGINS_DIR=$with_cwiid_plugins_dir
fi
AC_SUBST(CWIID_PLUGINS_DIR)
AC_ARG_WITH(ldconfig,AC_HELP_STRING([--disable-ldconfig],
[don't execute ldconfig after install]))
if test "$enable_ldconfig" = "no"; then
LDCONFIG="#ldconfig"
else
LDCONFIG="ldconfig"
fi
AC_SUBST(LDCONFIG)
pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0"
PKG_CHECK_MODULES([GTK], [$pkg_modules])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_OUTPUT(
[Makefile]
[defs.mak]
[common/include/lib.mak]
[doc/Makefile]
[man/Makefile]
[libcwiid/Makefile]
[libcwiid/cwiid.pc]
[wmdemo/Makefile]
[wmgui/Makefile]
[wminput/Makefile]
[wminput/plugins/Makefile]
[wminput/plugins/ir_ptr/Makefile]
[wminput/plugins/acc/Makefile]
[wminput/plugins/nunchuk_acc/Makefile]
[wminput/plugins/led/Makefile]
[wminput/plugins/nunchuk_stick2btn/Makefile]
[lswm/Makefile]
[python/Makefile]
)