| 1 | AC_INIT(CWiid,0.5.01,wiimote@abstrakraft.org) |
|---|
| 2 | |
|---|
| 3 | AC_PROG_CC |
|---|
| 4 | AC_PROG_AWK |
|---|
| 5 | AC_PROG_LEX |
|---|
| 6 | if test "$LEX" != "flex"; then |
|---|
| 7 | AC_MSG_ERROR([flex not found]) |
|---|
| 8 | fi |
|---|
| 9 | if test -z "`echo %%|$LEX -t --noyywrap|grep yypop_buffer_state`"; then |
|---|
| 10 | AC_MSG_ERROR([flex missing yypop_buffer_state - upgrade to version 2.5.33 or later]) |
|---|
| 11 | fi |
|---|
| 12 | AC_PROG_YACC |
|---|
| 13 | if test "$YACC" != "bison -y"; then |
|---|
| 14 | AC_MSG_ERROR([bison not found]) |
|---|
| 15 | fi |
|---|
| 16 | |
|---|
| 17 | AC_CHECK_LIB([pthread], [pthread_create],, |
|---|
| 18 | AC_MSG_ERROR([pthread library not found])) |
|---|
| 19 | AC_CHECK_LIB([bluetooth], [hci_devid],, |
|---|
| 20 | AC_MSG_ERROR([bluetooth library not found])) |
|---|
| 21 | AC_CHECK_LIB([dl], [dlopen],, |
|---|
| 22 | AC_MSG_ERROR([dl lib not found])) |
|---|
| 23 | #AC_CHECK_LIB([rt], [clock_gettime],, |
|---|
| 24 | # AC_MSG_ERROR([rt lib not found])) |
|---|
| 25 | |
|---|
| 26 | AC_HEADER_STDC |
|---|
| 27 | AC_CHECK_HEADER([bluetooth/bluetooth.h],, |
|---|
| 28 | AC_MSG_ERROR([bluetooth/bluetooth.h not found])) |
|---|
| 29 | AC_CHECK_HEADERS([bluetooth/l2cap.h bluetooth/hci.h],, |
|---|
| 30 | AC_MSG_ERROR([bluetooth headers not found]), |
|---|
| 31 | [#include <bluetooth/bluetooth.h>]) |
|---|
| 32 | AC_CHECK_HEADER([linux/input.h],, |
|---|
| 33 | AC_MSG_ERROR([linux/input.h not found])) |
|---|
| 34 | AC_CHECK_HEADER([linux/uinput.h],, |
|---|
| 35 | AC_MSG_ERROR([linux/uinput.h]), |
|---|
| 36 | [#include <linux/input.h>]) |
|---|
| 37 | |
|---|
| 38 | AC_ISC_POSIX |
|---|
| 39 | |
|---|
| 40 | AC_ARG_WITH(cwiid-config-dir,AC_HELP_STRING([--with-cwiid-config-dir], |
|---|
| 41 | [CWiid configuration directory, default to $(sysconfdir)/cwiid])) |
|---|
| 42 | if test -z $with_cwiid_config_dir; then |
|---|
| 43 | CWIID_CONFIG_DIR='${sysconfdir}/cwiid' |
|---|
| 44 | else |
|---|
| 45 | CWIID_CONFIG_DIR=$with_cwiid_config_dir |
|---|
| 46 | fi |
|---|
| 47 | AC_SUBST(CWIID_CONFIG_DIR) |
|---|
| 48 | |
|---|
| 49 | AC_ARG_WITH(cwiid-plugins-dir,AC_HELP_STRING([--with-cwiid-plugins-dir], |
|---|
| 50 | [CWiid plugins directory, default to $(libdir)/cwiid/plugins])) |
|---|
| 51 | if test -n $with_cwiid_plugins_dir; then |
|---|
| 52 | CWIID_PLUGINS_DIR='${libdir}/cwiid/plugins' |
|---|
| 53 | else |
|---|
| 54 | CWIID_PLUGINS_DIR=$with_cwiid_plugins_dir |
|---|
| 55 | fi |
|---|
| 56 | AC_SUBST(CWIID_PLUGINS_DIR) |
|---|
| 57 | |
|---|
| 58 | pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0" |
|---|
| 59 | PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) |
|---|
| 60 | AC_SUBST(PACKAGE_CFLAGS) |
|---|
| 61 | AC_SUBST(PACKAGE_LIBS) |
|---|
| 62 | |
|---|
| 63 | AC_OUTPUT( |
|---|
| 64 | [Makefile] |
|---|
| 65 | [common/include/defs.mak] |
|---|
| 66 | [wiimote/Makefile] |
|---|
| 67 | [wmdemo/Makefile] |
|---|
| 68 | [wmgui/Makefile] |
|---|
| 69 | [wminput/Makefile] |
|---|
| 70 | [wminput/plugins/Makefile] |
|---|
| 71 | [wminput/plugins/ir_ptr/Makefile] |
|---|
| 72 | [wminput/plugins/acc/Makefile] |
|---|
| 73 | [wminput/plugins/nunchuk_acc/Makefile] |
|---|
| 74 | ) |
|---|
| 75 | |
|---|