Changeset 8dfafdd3df12e09ce36b9d0018fbf3718b14c9a5
- Timestamp:
- 07/28/07 18:47:03 (6 years ago)
- Author:
- dsmith <dsmith@…>
- Children:
- d087284c9fe3be67c74edd495b443683ce4ce6af
- Parents:
- 1c06490e971a413d37373d5eb89a236149e61a94
- git-author:
- L. Donnie Smith <donnie.smith@…> (07/28/07 18:47:03)
- git-committer:
- dsmith <dsmith@…> (07/28/07 18:47:03)
- Message:
-
Added config.h header and with-python configure option
git-svn-id: http://abstrakraft.org/cwiid/svn/trunk@137 918edb2d-ff29-0410-9de2-eb38e7f22bc7
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
refbd885
|
r8dfafdd
|
|
| | 1 | 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 2 | configure.ac |
| | 3 | * added config.h header |
| | 4 | * added with-python argument and associated logic |
| | 5 | |
| | 6 | lswm |
| | 7 | * added config.h include for sources requiring defs |
| | 8 | |
| | 9 | wmgui |
| | 10 | * added config.h include for sources requiring defs |
| | 11 | |
| | 12 | wminput |
| | 13 | * added config.h include for sources requiring defs |
| | 14 | * added HAVE_PYTHON tests around all python code |
| | 15 | |
| 1 | 16 | 2007-06-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| 2 | 17 | libcwiid |
-
|
r49e0132
|
r8dfafdd
|
|
| 6 | 6 | BIN_DIRS = wmgui wminput lswm |
| 7 | 7 | DOC_DIRS = man doc |
| | 8 | ifdef PYTHON |
| 8 | 9 | BIND_DIRS = python |
| | 10 | endif |
| 9 | 11 | |
| 10 | 12 | SUB_DIRS = $(LIB_DIRS) $(BIN_DIRS) $(DOC_DIRS) $(BIND_DIRS) wmdemo |
| … |
… |
|
| 39 | 41 | distclean: |
| 40 | 42 | rm -rf Makefile config.log config.status autom4te.cache \ |
| 41 | | defs.mak $(COMMON)/include/lib.mak |
| | 43 | defs.mak $(COMMON)/include/lib.mak $(COMMON)/include/config.h |
| 42 | 44 | |
| 43 | 45 | uninstall: |
-
|
r1c06490
|
r8dfafdd
|
|
| 1 | 1 | # ChangeLog: |
| | 2 | # 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 3 | # * added config.h header |
| | 4 | # * added with-python argument and associated logic |
| | 5 | # |
| 2 | 6 | # 2007-05-30 L. Donnie Smith <cwiid@abstrakraft.org> |
| 3 | 7 | # * added python/Makefile |
| … |
… |
|
| 22 | 26 | |
| 23 | 27 | AC_INIT(CWiid,0.6.00_rc2,cwiid@abstrakraft.org) |
| | 28 | AC_CONFIG_HEADER(common/include/config.h) |
| 24 | 29 | |
| 25 | 30 | AC_PROG_CC |
| … |
… |
|
| 37 | 42 | fi |
| 38 | 43 | |
| 39 | | PYTHON_VERSION=[`python -c 'import sys; print sys.version[:3]'`] |
| 40 | | AC_SUBST(PYTHON_VERSION) |
| | 44 | AC_ARG_WITH( |
| | 45 | [python], |
| | 46 | [AS_HELP_STRING([--without-python],[compile without python support])], |
| | 47 | [case $withval in |
| | 48 | yes) |
| | 49 | REQUIRE_PYTHON=1 |
| | 50 | PYTHON_NAME=python |
| | 51 | ;; |
| | 52 | no) |
| | 53 | REQUIRE_PYTHON= |
| | 54 | PYTHON_NAME= |
| | 55 | ;; |
| | 56 | *) |
| | 57 | REQUIRE_PYTHON=1 |
| | 58 | PYTHON_NAME=$withval |
| | 59 | ;; |
| | 60 | esac], |
| | 61 | [REQUIRE_PYTHON=1; PYTHON_NAME=python]) |
| | 62 | if test $REQUIRE_PYTHON; then |
| | 63 | AC_CHECK_PROGS([PYTHON],$PYTHON_NAME) |
| | 64 | if test $REQUIRE_PYTHON -a ! $PYTHON; then |
| | 65 | AC_MSG_ERROR([$PYTHON_NAME not found]) |
| | 66 | fi |
| | 67 | fi |
| | 68 | AC_SUBST(PYTHON) |
| | 69 | if test $PYTHON; then |
| | 70 | PYTHON_VERSION=[`$PYTHON -c 'import sys; print sys.version[:3]'`] |
| | 71 | AC_SUBST(PYTHON_VERSION) |
| | 72 | AC_DEFINE([HAVE_PYTHON],1,[Define to 1 if python support is enabled]) |
| | 73 | fi |
| 41 | 74 | |
| 42 | 75 | AC_CHECK_LIB([pthread], [pthread_create],, |
-
|
r49e0132
|
r8dfafdd
|
|
| 21 | 21 | LEX = @LEX@ |
| 22 | 22 | YACC = @YACC@ |
| | 23 | PYTHON = @PYTHON@ |
| 23 | 24 | |
| 24 | 25 | COMMON = @abs_top_builddir@/common |
| … |
… |
|
| 33 | 34 | DEBUGFLAGS = -g |
| 34 | 35 | WARNFLAGS = -Wall -W |
| 35 | | CFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) |
| | 36 | CFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) @DEFS@ -I$(COMMON)/include |
-
|
r49e0132
|
r8dfafdd
|
|
| 7 | 7 | SOURCES = lswm.c |
| 8 | 8 | |
| 9 | | CFLAGS += -I@top_builddir@/libcwiid -DCWIID_VERSION=\"${PACKAGE_VERSION}\" |
| | 9 | CFLAGS += -I@top_builddir@/libcwiid |
| 10 | 10 | LDFLAGS += -L@top_builddir@/libcwiid |
| 11 | 11 | LDLIBS += -lcwiid |
-
|
r49e0132
|
r8dfafdd
|
|
| 16 | 16 | * |
| 17 | 17 | * ChangeLog: |
| | 18 | * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 19 | * * added config.h include |
| | 20 | * * use PACKAGE_VERSION from config.h instead of CWIID_VERSION |
| | 21 | * |
| 18 | 22 | * 2007-06-01 Nick <nickishappy@gmail.com> |
| 19 | 23 | * * reworked command-line options (added standard options, long options) |
| … |
… |
|
| 28 | 32 | * * created file |
| 29 | 33 | */ |
| | 34 | |
| | 35 | #ifdef HAVE_CONFIG_H |
| | 36 | #include "config.h" |
| | 37 | #endif |
| 30 | 38 | |
| 31 | 39 | #include <stdint.h> |
| … |
… |
|
| 91 | 99 | break; |
| 92 | 100 | case 'v': |
| 93 | | printf("CWiid Version %s\n", CWIID_VERSION); |
| | 101 | printf("CWiid Version %s\n", PACKAGE_VERSION); |
| 94 | 102 | return 0; |
| 95 | 103 | break; |
-
|
rbb2d26b
|
r8dfafdd
|
|
| 8 | 8 | |
| 9 | 9 | all: |
| 10 | | python setup.py build_ext $(DEBUGFLAGS) -I@top_builddir@/libcwiid -L@top_builddir@/libcwiid -lcwiid |
| | 10 | $(PYTHON) setup.py build_ext $(DEBUGFLAGS) -I@top_builddir@/libcwiid -L@top_builddir@/libcwiid -lcwiid |
| 11 | 11 | |
| 12 | 12 | install: |
| 13 | | python setup.py install --prefix=${prefix} $(SET_ROOT_DIR) |
| | 13 | $(PYTHON) setup.py install --prefix=${prefix} $(SET_ROOT_DIR) |
| 14 | 14 | |
| 15 | 15 | uninstall: |
-
|
r805477a
|
r8dfafdd
|
|
| 7 | 7 | SOURCES = main.c interface.c support.c |
| 8 | 8 | |
| 9 | | CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid \ |
| 10 | | -DCWIID_VERSION=\"${PACKAGE_VERSION}\" |
| | 9 | CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid |
| 11 | 10 | LDFLAGS += -L@top_builddir@/libcwiid |
| 12 | 11 | LDLIBS += @GTK_LIBS@ -lm -lcwiid |
-
|
ra09a4ee
|
r8dfafdd
|
|
| 16 | 16 | * |
| 17 | 17 | * ChangeLog: |
| | 18 | * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 19 | * * added config.h include |
| | 20 | * * use PACKAGE_VERSION from config.h instead of CWIID_VERSION |
| | 21 | * |
| 18 | 22 | * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> |
| 19 | 23 | * * changed cwiid_{connect,disconnect,command} to |
| … |
… |
|
| 44 | 48 | */ |
| 45 | 49 | |
| | 50 | #ifdef HAVE_CONFIG_H |
| | 51 | #include "config.h" |
| | 52 | #endif |
| | 53 | |
| 46 | 54 | #define APP_NAME "CWiid wmgui" |
| | 55 | #define APP_VERSION PACKAGE_VERSION |
| 47 | 56 | #define APP_COPYRIGHT "Copyright (C) 2007 L. Donnie Smith " \ |
| 48 | 57 | "<cwiid@abstrakraft.org>" |
| … |
… |
|
| 697 | 706 | gtk_show_about_dialog(GTK_WINDOW(winMain), |
| 698 | 707 | "name", APP_NAME, |
| 699 | | "version", CWIID_VERSION, |
| | 708 | "version", APP_VERSION, |
| 700 | 709 | "copyright", APP_COPYRIGHT, |
| 701 | 710 | "comments", APP_COMMENTS, |
-
|
r49e0132
|
r8dfafdd
|
|
| 5 | 5 | APP_NAME = wminput |
| 6 | 6 | |
| 7 | | SOURCES = main.c conf.c c_plugin.c py_plugin.c uinput.c action_enum.c parser.c \ |
| 8 | | lexer.c util.c |
| | 7 | SOURCES = main.c conf.c c_plugin.c uinput.c action_enum.c util.c |
| | 8 | #kludge to make sure YACC/LEX sources are listed last, otherwise we get errors |
| | 9 | #when building dependencies |
| | 10 | LAST_SOURCES = parser.c lexer.c |
| 9 | 11 | |
| 10 | 12 | WMINPUT_CONFIG_DIR = $(CWIID_CONFIG_DIR)/wminput |
| 11 | | CFLAGS += -I@top_builddir@/libcwiid -I/usr/include/python@PYTHON_VERSION@ \ |
| | 13 | CFLAGS += -I@top_builddir@/libcwiid \ |
| 12 | 14 | -DWMINPUT_CONFIG_DIR=\"$(WMINPUT_CONFIG_DIR)\" \ |
| 13 | | -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\" \ |
| 14 | | -DCWIID_VERSION=\"${PACKAGE_VERSION}\" |
| 15 | | LDLIBS += -lcwiid -ldl -lpython@PYTHON_VERSION@ |
| | 15 | -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\" |
| | 16 | |
| | 17 | LDLIBS += -lcwiid -ldl |
| 16 | 18 | LDFLAGS += -L@top_builddir@/libcwiid -rdynamic |
| 17 | 19 | INST_DIR = @bindir@ |
| 18 | 20 | |
| 19 | 21 | YFLAGS += -d |
| | 22 | |
| | 23 | ifdef PYTHON |
| | 24 | SOURCES += py_plugin.c |
| | 25 | CFLAGS += -I/usr/include/python@PYTHON_VERSION@ |
| | 26 | LDLIBS += -lpython@PYTHON_VERSION@ |
| | 27 | endif |
| | 28 | |
| | 29 | SOURCES += $(LAST_SOURCES) |
| 20 | 30 | |
| 21 | 31 | include $(COMMON)/include/app.mak |
-
|
ra498060
|
r8dfafdd
|
|
| 16 | 16 | * |
| 17 | 17 | * ChangeLog: |
| | 18 | * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 19 | * * added config.h include |
| | 20 | * * added HAVE_PYTHON tests around all python code |
| | 21 | * |
| 18 | 22 | * 2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> |
| 19 | 23 | * * revised error messages |
| … |
… |
|
| 41 | 45 | */ |
| 42 | 46 | |
| | 47 | #ifdef HAVE_CONFIG_H |
| | 48 | #include "config.h" |
| | 49 | #endif |
| | 50 | |
| 43 | 51 | #include <stdint.h> |
| 44 | 52 | #include <stdio.h> |
| … |
… |
|
| 50 | 58 | #include "y.tab.h" |
| 51 | 59 | #include "c_plugin.h" |
| | 60 | #ifdef HAVE_PYTHON |
| 52 | 61 | #include "py_plugin.h" |
| | 62 | #endif |
| 53 | 63 | |
| 54 | 64 | extern FILE *yyin; |
| … |
… |
|
| 99 | 109 | c_plugin_close(&conf->plugins[i]); |
| 100 | 110 | break; |
| | 111 | #ifdef HAVE_PYTHON |
| 101 | 112 | case PLUGIN_PYTHON: |
| 102 | 113 | py_plugin_close(&conf->plugins[i]); |
| 103 | 114 | break; |
| | 115 | #endif |
| 104 | 116 | } |
| 105 | 117 | } |
| … |
… |
|
| 346 | 358 | } |
| 347 | 359 | break; |
| | 360 | #ifdef HAVE_PYTHON |
| 348 | 361 | case PLUGIN_PYTHON: |
| 349 | 362 | if (py_plugin_param_int(plugin, i, value)) { |
| … |
… |
|
| 351 | 364 | } |
| 352 | 365 | break; |
| | 366 | #endif |
| 353 | 367 | } |
| 354 | 368 | |
| … |
… |
|
| 385 | 399 | } |
| 386 | 400 | break; |
| | 401 | #ifdef HAVE_PYTHON |
| 387 | 402 | case PLUGIN_PYTHON: |
| 388 | 403 | if (py_plugin_param_float(plugin, i, value)) { |
| … |
… |
|
| 390 | 405 | } |
| 391 | 406 | break; |
| | 407 | #endif |
| 392 | 408 | } |
| 393 | 409 | |
| … |
… |
|
| 596 | 612 | break; |
| 597 | 613 | } |
| | 614 | #ifdef HAVE_PYTHON |
| 598 | 615 | if (!py_plugin_open(plugin, conf->plugin_search_dirs[i])) { |
| 599 | 616 | plugin_found = 1; |
| 600 | 617 | break; |
| 601 | 618 | } |
| | 619 | #endif |
| 602 | 620 | } |
| 603 | 621 | |
-
|
r49e0132
|
r8dfafdd
|
|
| 16 | 16 | * |
| 17 | 17 | * ChangeLog: |
| | 18 | * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 19 | * * added config.h include |
| | 20 | * * added HAVE_PYTHON tests around all python code |
| | 21 | * |
| 18 | 22 | * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> |
| 19 | 23 | * * refactored to isolate plugin logic |
| … |
… |
|
| 38 | 42 | #ifndef CONF_H |
| 39 | 43 | #define CONF_H |
| | 44 | |
| | 45 | #ifdef HAVE_CONFIG_H |
| | 46 | #include "config.h" |
| | 47 | #endif |
| 40 | 48 | |
| 41 | 49 | #include <stdint.h> |
| … |
… |
|
| 119 | 127 | #define UINPUT_VENDOR 0x0001 |
| 120 | 128 | #define UINPUT_PRODUCT 0x0001 |
| | 129 | #ifndef UINPUT_VERSION |
| 121 | 130 | #define UINPUT_VERSION 0x0001 |
| | 131 | #endif |
| 122 | 132 | |
| 123 | 133 | struct lookup_enum { |
| … |
… |
|
| 141 | 151 | enum plugin_type { |
| 142 | 152 | PLUGIN_C, |
| | 153 | #ifdef HAVE_PYTHON |
| 143 | 154 | PLUGIN_PYTHON |
| | 155 | #endif |
| 144 | 156 | }; |
| 145 | 157 | |
-
|
ra498060
|
r8dfafdd
|
|
| 16 | 16 | * |
| 17 | 17 | * ChangeLog: |
| | 18 | * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> |
| | 19 | * * added config.h include |
| | 20 | * * use PACKAGE_VERSION from config.h instead of CWIID_VERSION |
| | 21 | * * added HAVE_PYTHON tests around all python code |
| | 22 | * |
| 18 | 23 | * 2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> |
| 19 | 24 | * * revised error messages |
| … |
… |
|
| 50 | 55 | */ |
| 51 | 56 | |
| | 57 | #ifdef HAVE_CONFIG_H |
| | 58 | #include "config.h" |
| | 59 | #endif |
| | 60 | |
| 52 | 61 | #include <stdint.h> |
| 53 | 62 | #include <stdio.h> |
| … |
… |
|
| 66 | 75 | #include "wmplugin.h" |
| 67 | 76 | #include "c_plugin.h" |
| | 77 | |
| | 78 | #ifdef HAVE_PYTHON |
| 68 | 79 | #include "py_plugin.h" |
| | 80 | #endif |
| 69 | 81 | |
| 70 | 82 | struct conf conf; |
| … |
… |
|
| 145 | 157 | break; |
| 146 | 158 | case 'v': |
| 147 | | printf("CWiid Version %s\n", CWIID_VERSION); |
| | 159 | printf("CWiid Version %s\n", PACKAGE_VERSION); |
| 148 | 160 | return 0; |
| 149 | 161 | break; |
| … |
… |
|
| 161 | 173 | return -1; |
| 162 | 174 | } |
| | 175 | |
| | 176 | #ifdef HAVE_PYTHON |
| 163 | 177 | if (py_init()) { |
| 164 | 178 | return -1; |
| 165 | 179 | } |
| | 180 | #endif |
| 166 | 181 | |
| 167 | 182 | /* Load Config */ |
| … |
… |
|
| 238 | 253 | return -1; |
| 239 | 254 | } |
| | 255 | #ifdef HAVE_PYTHON |
| 240 | 256 | if (py_wiimote(wiimote)) { |
| 241 | 257 | conf_unload(&conf); |
| 242 | 258 | return -1; |
| 243 | 259 | } |
| | 260 | #endif |
| 244 | 261 | |
| 245 | 262 | /* init plugins */ |
| … |
… |
|
| 254 | 271 | } |
| 255 | 272 | break; |
| | 273 | #ifdef HAVE_PYTHON |
| 256 | 274 | case PLUGIN_PYTHON: |
| 257 | 275 | if (py_plugin_init(&conf.plugins[i], i)) { |
| … |
… |
|
| 262 | 280 | } |
| 263 | 281 | break; |
| | 282 | #endif |
| 264 | 283 | } |
| 265 | 284 | } |
| … |
… |
|
| 315 | 334 | } |
| 316 | 335 | |
| | 336 | #ifdef HAVE_PYTHON |
| 317 | 337 | py_deinit(); |
| | 338 | #endif |
| 318 | 339 | |
| 319 | 340 | return ret; |
| … |
… |
|
| 640 | 661 | } |
| 641 | 662 | break; |
| | 663 | #ifdef HAVE_PYTHON |
| 642 | 664 | case PLUGIN_PYTHON: |
| 643 | 665 | if (py_plugin_exec(plugin, plugin_mesg_count, plugin_mesg)) { |
| … |
… |
|
| 645 | 667 | } |
| 646 | 668 | break; |
| | 669 | #endif |
| 647 | 670 | } |
| 648 | 671 | |