| 1 | AC_INIT(CWiid,0.6.00,donnie.smith@gatech.edu) |
|---|
| 2 | AC_CONFIG_HEADER(common/include/config.h) |
|---|
| 3 | |
|---|
| 4 | AC_PROG_CC |
|---|
| 5 | AC_PROG_AWK |
|---|
| 6 | AC_PROG_LEX |
|---|
| 7 | if test "$LEX" != "flex"; then |
|---|
| 8 | AC_MSG_ERROR([flex not found]) |
|---|
| 9 | fi |
|---|
| 10 | if test -z "`echo %%|$LEX -t|grep yypop_buffer_state`"; then |
|---|
| 11 | AC_MSG_ERROR([flex missing yypop_buffer_state - upgrade to version 2.5.33 or later]) |
|---|
| 12 | fi |
|---|
| 13 | AC_PROG_YACC |
|---|
| 14 | if test "$YACC" != "bison -y"; then |
|---|
| 15 | AC_MSG_ERROR([bison not found]) |
|---|
| 16 | fi |
|---|
| 17 | |
|---|
| 18 | AC_ARG_WITH( |
|---|
| 19 | [python], |
|---|
| 20 | [AS_HELP_STRING([--without-python],[compile without python support])], |
|---|
| 21 | [case $withval in |
|---|
| 22 | yes) |
|---|
| 23 | REQUIRE_PYTHON=1 |
|---|
| 24 | PYTHON_NAME=python |
|---|
| 25 | ;; |
|---|
| 26 | no) |
|---|
| 27 | REQUIRE_PYTHON= |
|---|
| 28 | PYTHON_NAME= |
|---|
| 29 | ;; |
|---|
| 30 | *) |
|---|
| 31 | REQUIRE_PYTHON=1 |
|---|
| 32 | PYTHON_NAME=$withval |
|---|
| 33 | ;; |
|---|
| 34 | esac], |
|---|
| 35 | [REQUIRE_PYTHON=1; PYTHON_NAME=python]) |
|---|
| 36 | if test $REQUIRE_PYTHON; then |
|---|
| 37 | AC_CHECK_PROGS([PYTHON],$PYTHON_NAME) |
|---|
| 38 | if test $REQUIRE_PYTHON -a ! $PYTHON; then |
|---|
| 39 | AC_MSG_ERROR([$PYTHON_NAME not found]) |
|---|
| 40 | fi |
|---|
| 41 | fi |
|---|
| 42 | AC_SUBST(PYTHON) |
|---|
| 43 | if test $PYTHON; then |
|---|
| 44 | PYTHON_VERSION=[`$PYTHON -c 'import sys; print sys.version[:3]'`] |
|---|
| 45 | AC_SUBST(PYTHON_VERSION) |
|---|
| 46 | AC_DEFINE([HAVE_PYTHON],1,[Define to 1 if python support is enabled]) |
|---|
| 47 | fi |
|---|
| 48 | |
|---|
| 49 | AC_CHECK_LIB([pthread], [pthread_create],, |
|---|
| 50 | AC_MSG_ERROR([pthread library not found])) |
|---|
| 51 | AC_CHECK_LIB([bluetooth], [hci_devid],, |
|---|
| 52 | AC_MSG_ERROR([bluetooth library not found])) |
|---|
| 53 | AC_CHECK_LIB([dl], [dlopen],, |
|---|
| 54 | AC_MSG_ERROR([dl lib not found])) |
|---|
| 55 | #AC_CHECK_LIB([rt], [clock_gettime],, |
|---|
| 56 | # AC_MSG_ERROR([rt lib not found])) |
|---|
| 57 | |
|---|
| 58 | AC_HEADER_STDC |
|---|
| 59 | AC_CHECK_HEADER([stdint.h],, |
|---|
| 60 | AC_MSG_ERROR([stdint.h not found])) |
|---|
| 61 | AC_CHECK_HEADER([bluetooth/bluetooth.h],, |
|---|
| 62 | AC_MSG_ERROR([bluetooth/bluetooth.h not found])) |
|---|
| 63 | AC_CHECK_HEADERS([bluetooth/l2cap.h bluetooth/hci.h],, |
|---|
| 64 | AC_MSG_ERROR([bluetooth headers not found]), |
|---|
| 65 | [#include <bluetooth/bluetooth.h>]) |
|---|
| 66 | AC_CHECK_HEADER([linux/input.h],, |
|---|
| 67 | AC_MSG_ERROR([linux/input.h not found])) |
|---|
| 68 | AC_CHECK_HEADER([linux/uinput.h],, |
|---|
| 69 | AC_MSG_ERROR([linux/uinput.h]), |
|---|
| 70 | [#include <linux/input.h>]) |
|---|
| 71 | |
|---|
| 72 | AC_ISC_POSIX |
|---|
| 73 | |
|---|
| 74 | AC_ARG_WITH(cwiid-config-dir,AC_HELP_STRING([--with-cwiid-config-dir], |
|---|
| 75 | [CWiid configuration directory, default to $(sysconfdir)/cwiid])) |
|---|
| 76 | if test -z $with_cwiid_config_dir; then |
|---|
| 77 | CWIID_CONFIG_DIR='${sysconfdir}/cwiid' |
|---|
| 78 | else |
|---|
| 79 | CWIID_CONFIG_DIR=$with_cwiid_config_dir |
|---|
| 80 | fi |
|---|
| 81 | AC_SUBST(CWIID_CONFIG_DIR) |
|---|
| 82 | |
|---|
| 83 | AC_ARG_WITH(cwiid-plugins-dir,AC_HELP_STRING([--with-cwiid-plugins-dir], |
|---|
| 84 | [CWiid plugins directory, default to $(libdir)/cwiid/plugins])) |
|---|
| 85 | if test -n $with_cwiid_plugins_dir; then |
|---|
| 86 | CWIID_PLUGINS_DIR='${libdir}/cwiid/plugins' |
|---|
| 87 | else |
|---|
| 88 | CWIID_PLUGINS_DIR=$with_cwiid_plugins_dir |
|---|
| 89 | fi |
|---|
| 90 | AC_SUBST(CWIID_PLUGINS_DIR) |
|---|
| 91 | |
|---|
| 92 | AC_ARG_WITH(ldconfig,AC_HELP_STRING([--disable-ldconfig], |
|---|
| 93 | [don't execute ldconfig after install])) |
|---|
| 94 | if test "$enable_ldconfig" = "no"; then |
|---|
| 95 | LDCONFIG="#ldconfig" |
|---|
| 96 | else |
|---|
| 97 | LDCONFIG="ldconfig" |
|---|
| 98 | fi |
|---|
| 99 | AC_SUBST(LDCONFIG) |
|---|
| 100 | |
|---|
| 101 | pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0" |
|---|
| 102 | PKG_CHECK_MODULES([GTK], [$pkg_modules]) |
|---|
| 103 | AC_SUBST(GTK_CFLAGS) |
|---|
| 104 | AC_SUBST(GTK_LIBS) |
|---|
| 105 | |
|---|
| 106 | AC_OUTPUT( |
|---|
| 107 | [Makefile] |
|---|
| 108 | [defs.mak] |
|---|
| 109 | [common/include/lib.mak] |
|---|
| 110 | [doc/Makefile] |
|---|
| 111 | [man/Makefile] |
|---|
| 112 | [libcwiid/Makefile] |
|---|
| 113 | [libcwiid/cwiid.pc] |
|---|
| 114 | [wmdemo/Makefile] |
|---|
| 115 | [wmgui/Makefile] |
|---|
| 116 | [wminput/Makefile] |
|---|
| 117 | [wminput/plugins/Makefile] |
|---|
| 118 | [wminput/plugins/ir_ptr/Makefile] |
|---|
| 119 | [wminput/plugins/acc/Makefile] |
|---|
| 120 | [wminput/plugins/nunchuk_acc/Makefile] |
|---|
| 121 | [wminput/plugins/led/Makefile] |
|---|
| 122 | [wminput/plugins/nunchuk_stick2btn/Makefile] |
|---|
| 123 | [lswm/Makefile] |
|---|
| 124 | [python/Makefile] |
|---|
| 125 | ) |
|---|