Changeset 8dfafdd3df12e09ce36b9d0018fbf3718b14c9a5

Show
Ignore:
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:
1 added
13 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    refbd885 r8dfafdd  
     12007-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 
    1162007-06-28 L. Donnie Smith <cwiid@abstrakraft.org> 
    217        libcwiid 
  • Makefile.in

    r49e0132 r8dfafdd  
    66BIN_DIRS = wmgui wminput lswm 
    77DOC_DIRS = man doc 
     8ifdef PYTHON 
    89BIND_DIRS = python 
     10endif 
    911 
    1012SUB_DIRS = $(LIB_DIRS) $(BIN_DIRS) $(DOC_DIRS) $(BIND_DIRS) wmdemo 
     
    3941distclean: 
    4042        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 
    4244 
    4345uninstall: 
  • configure.ac

    r1c06490 r8dfafdd  
    11# 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# 
    26# 2007-05-30 L. Donnie Smith <cwiid@abstrakraft.org> 
    37# * added python/Makefile 
     
    2226 
    2327AC_INIT(CWiid,0.6.00_rc2,cwiid@abstrakraft.org) 
     28AC_CONFIG_HEADER(common/include/config.h) 
    2429 
    2530AC_PROG_CC 
     
    3742fi 
    3843 
    39 PYTHON_VERSION=[`python -c 'import sys; print sys.version[:3]'`] 
    40 AC_SUBST(PYTHON_VERSION) 
     44AC_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]) 
     62if 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 
     67fi 
     68AC_SUBST(PYTHON) 
     69if 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]) 
     73fi 
    4174 
    4275AC_CHECK_LIB([pthread], [pthread_create],, 
  • defs.mak.in

    r49e0132 r8dfafdd  
    2121LEX = @LEX@ 
    2222YACC = @YACC@ 
     23PYTHON = @PYTHON@ 
    2324 
    2425COMMON = @abs_top_builddir@/common 
     
    3334DEBUGFLAGS = -g 
    3435WARNFLAGS = -Wall -W 
    35 CFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) 
     36CFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) @DEFS@ -I$(COMMON)/include 
  • lswm/Makefile.in

    r49e0132 r8dfafdd  
    77SOURCES = lswm.c 
    88 
    9 CFLAGS += -I@top_builddir@/libcwiid -DCWIID_VERSION=\"${PACKAGE_VERSION}\" 
     9CFLAGS += -I@top_builddir@/libcwiid 
    1010LDFLAGS += -L@top_builddir@/libcwiid 
    1111LDLIBS += -lcwiid 
  • lswm/lswm.c

    r49e0132 r8dfafdd  
    1616 * 
    1717 *  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 * 
    1822 *  2007-06-01 Nick <nickishappy@gmail.com> 
    1923 *  * reworked command-line options (added standard options, long options) 
     
    2832 *  * created file 
    2933 */ 
     34 
     35#ifdef HAVE_CONFIG_H 
     36#include "config.h" 
     37#endif 
    3038 
    3139#include <stdint.h> 
     
    9199                        break; 
    92100                case 'v': 
    93                         printf("CWiid Version %s\n", CWIID_VERSION); 
     101                        printf("CWiid Version %s\n", PACKAGE_VERSION); 
    94102                        return 0; 
    95103                        break; 
  • python/Makefile.in

    rbb2d26b r8dfafdd  
    88 
    99all: 
    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 
    1111 
    1212install: 
    13         python setup.py install --prefix=${prefix} $(SET_ROOT_DIR) 
     13        $(PYTHON) setup.py install --prefix=${prefix} $(SET_ROOT_DIR) 
    1414 
    1515uninstall: 
  • wmgui/Makefile.in

    r805477a r8dfafdd  
    77SOURCES = main.c interface.c support.c 
    88 
    9 CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid \ 
    10         -DCWIID_VERSION=\"${PACKAGE_VERSION}\" 
     9CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid 
    1110LDFLAGS += -L@top_builddir@/libcwiid 
    1211LDLIBS += @GTK_LIBS@ -lm -lcwiid 
  • wmgui/main.c

    ra09a4ee r8dfafdd  
    1616 * 
    1717 *  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 * 
    1822 *  2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> 
    1923 *  * changed cwiid_{connect,disconnect,command} to 
     
    4448 */ 
    4549 
     50#ifdef HAVE_CONFIG_H 
     51#include "config.h" 
     52#endif 
     53 
    4654#define APP_NAME                "CWiid wmgui" 
     55#define APP_VERSION             PACKAGE_VERSION 
    4756#define APP_COPYRIGHT   "Copyright (C) 2007 L. Donnie Smith " \ 
    4857                        "<cwiid@abstrakraft.org>" 
     
    697706        gtk_show_about_dialog(GTK_WINDOW(winMain), 
    698707                              "name", APP_NAME, 
    699                               "version", CWIID_VERSION, 
     708                              "version", APP_VERSION, 
    700709                              "copyright", APP_COPYRIGHT, 
    701710                              "comments", APP_COMMENTS, 
  • wminput/Makefile.in

    r49e0132 r8dfafdd  
    55APP_NAME = wminput 
    66 
    7 SOURCES = main.c conf.c c_plugin.c py_plugin.c uinput.c action_enum.c parser.c \ 
    8         lexer.c util.c 
     7SOURCES = 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 
     10LAST_SOURCES = parser.c lexer.c 
    911 
    1012WMINPUT_CONFIG_DIR = $(CWIID_CONFIG_DIR)/wminput 
    11 CFLAGS += -I@top_builddir@/libcwiid -I/usr/include/python@PYTHON_VERSION@ \ 
     13CFLAGS += -I@top_builddir@/libcwiid \ 
    1214        -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 
     17LDLIBS += -lcwiid -ldl 
    1618LDFLAGS += -L@top_builddir@/libcwiid -rdynamic 
    1719INST_DIR = @bindir@ 
    1820 
    1921YFLAGS += -d 
     22 
     23ifdef PYTHON 
     24        SOURCES += py_plugin.c 
     25        CFLAGS += -I/usr/include/python@PYTHON_VERSION@ 
     26        LDLIBS += -lpython@PYTHON_VERSION@ 
     27endif 
     28 
     29SOURCES += $(LAST_SOURCES) 
    2030 
    2131include $(COMMON)/include/app.mak 
  • wminput/conf.c

    ra498060 r8dfafdd  
    1616 * 
    1717 *  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 * 
    1822 *  2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> 
    1923 *  * revised error messages 
     
    4145 */ 
    4246 
     47#ifdef HAVE_CONFIG_H 
     48#include "config.h" 
     49#endif 
     50 
    4351#include <stdint.h> 
    4452#include <stdio.h> 
     
    5058#include "y.tab.h" 
    5159#include "c_plugin.h" 
     60#ifdef HAVE_PYTHON 
    5261#include "py_plugin.h" 
     62#endif 
    5363 
    5464extern FILE *yyin; 
     
    99109                                c_plugin_close(&conf->plugins[i]); 
    100110                                break; 
     111#ifdef HAVE_PYTHON 
    101112                        case PLUGIN_PYTHON: 
    102113                                py_plugin_close(&conf->plugins[i]); 
    103114                                break; 
     115#endif 
    104116                        } 
    105117                } 
     
    346358                } 
    347359                break; 
     360#ifdef HAVE_PYTHON 
    348361        case PLUGIN_PYTHON: 
    349362                if (py_plugin_param_int(plugin, i, value)) { 
     
    351364                } 
    352365                break; 
     366#endif 
    353367        } 
    354368 
     
    385399                } 
    386400                break; 
     401#ifdef HAVE_PYTHON 
    387402        case PLUGIN_PYTHON: 
    388403                if (py_plugin_param_float(plugin, i, value)) { 
     
    390405                } 
    391406                break; 
     407#endif 
    392408        } 
    393409 
     
    596612                        break; 
    597613                } 
     614#ifdef HAVE_PYTHON 
    598615                if (!py_plugin_open(plugin, conf->plugin_search_dirs[i])) { 
    599616                        plugin_found = 1; 
    600617                        break; 
    601618                } 
     619#endif 
    602620        } 
    603621 
  • wminput/conf.h

    r49e0132 r8dfafdd  
    1616 * 
    1717 *  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 * 
    1822 *  2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> 
    1923 *  * refactored to isolate plugin logic 
     
    3842#ifndef CONF_H 
    3943#define CONF_H 
     44 
     45#ifdef HAVE_CONFIG_H 
     46#include "config.h" 
     47#endif 
    4048 
    4149#include <stdint.h> 
     
    119127#define UINPUT_VENDOR   0x0001 
    120128#define UINPUT_PRODUCT  0x0001 
     129#ifndef UINPUT_VERSION 
    121130#define UINPUT_VERSION  0x0001 
     131#endif 
    122132 
    123133struct lookup_enum { 
     
    141151enum plugin_type { 
    142152        PLUGIN_C, 
     153#ifdef HAVE_PYTHON 
    143154        PLUGIN_PYTHON 
     155#endif 
    144156}; 
    145157 
  • wminput/main.c

    ra498060 r8dfafdd  
    1616 * 
    1717 *  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 * 
    1823 *  2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> 
    1924 *  * revised error messages 
     
    5055 */ 
    5156 
     57#ifdef HAVE_CONFIG_H 
     58#include "config.h" 
     59#endif 
     60 
    5261#include <stdint.h> 
    5362#include <stdio.h> 
     
    6675#include "wmplugin.h" 
    6776#include "c_plugin.h" 
     77 
     78#ifdef HAVE_PYTHON 
    6879#include "py_plugin.h" 
     80#endif 
    6981 
    7082struct conf conf; 
     
    145157                        break; 
    146158                case 'v': 
    147                         printf("CWiid Version %s\n", CWIID_VERSION); 
     159                        printf("CWiid Version %s\n", PACKAGE_VERSION); 
    148160                        return 0; 
    149161                        break; 
     
    161173                return -1; 
    162174        } 
     175 
     176#ifdef HAVE_PYTHON 
    163177        if (py_init()) { 
    164178                return -1; 
    165179        } 
     180#endif 
    166181 
    167182        /* Load Config */ 
     
    238253                return -1; 
    239254        } 
     255#ifdef HAVE_PYTHON 
    240256        if (py_wiimote(wiimote)) { 
    241257                conf_unload(&conf); 
    242258                return -1; 
    243259        } 
     260#endif 
    244261 
    245262        /* init plugins */ 
     
    254271                        } 
    255272                        break; 
     273#ifdef HAVE_PYTHON 
    256274                case PLUGIN_PYTHON: 
    257275                        if (py_plugin_init(&conf.plugins[i], i)) { 
     
    262280                        } 
    263281                        break; 
     282#endif 
    264283                } 
    265284        } 
     
    315334        } 
    316335 
     336#ifdef HAVE_PYTHON 
    317337        py_deinit(); 
     338#endif 
    318339 
    319340        return ret; 
     
    640661                        } 
    641662                        break; 
     663#ifdef HAVE_PYTHON 
    642664                case PLUGIN_PYTHON: 
    643665                        if (py_plugin_exec(plugin, plugin_mesg_count, plugin_mesg)) { 
     
    645667                        } 
    646668                        break; 
     669#endif 
    647670                } 
    648671