changeset: 2323:6d6ca0de35c7 tag: tip user: perex date: Fri Aug 31 15:22:26 2007 +0200 files: configure.in modules/mixer/simple/Makefile.am modules/mixer/simple/python.c description: improved python detection and added --with-pythonincdir for configure.in diff -r 7dcb60b0ce1d -r 6d6ca0de35c7 configure.in --- a/configure.in Thu Aug 30 14:12:42 2007 +0200 +++ b/configure.in Fri Aug 31 15:22:26 2007 +0200 @@ -340,21 +340,28 @@ AC_ARG_ENABLE(python, AS_HELP_STRING([--disable-python], [disable the python components]), [build_python="$enableval"], [build_python="yes"]) PYTHON_LIBS="" +PYTHON_INCDIR="" if test "$build_python" = "yes"; then AC_ARG_WITH(pythonlibs, AS_HELP_STRING([--with-pythonlibs=ldflags], [specify python libraries (-lpthread -lm -ldl -lpython2.4)]), pythonlibs="$withval", pythonlibs=`python-config --libs`) - if test -z "$pythonlibs" ; then + AC_ARG_WITH(pythonincludes, + AS_HELP_STRING([--with-pythonincdir=dir], + [specify python C header files (-I/usr/include/python)]), + pythonincdir="$withval", pythonincdir=`python-config --includes`) + if test -z "$pythonlibs"; then echo "Unable to determine python libraries! Probably python-config is not" - echo "available on this system. Please, use --with-pythonlibs options." - echo "Python components are disabled in this build." + echo "available on this system. Please, use --with-pythonlibs and" + echo "--with-pythonincdir options. Python components are disabled in this build." build_python="no" else PYTHON_LIBS="$pythonlibs" + PYTHON_INCDIR="$pythonincdir" fi fi AC_SUBST(PYTHON_LIBS) +AC_SUBST(PYTHON_INCDIR) if test "$build_seq" != "yes"; then build_instr="no" diff -r 7dcb60b0ce1d -r 6d6ca0de35c7 modules/mixer/simple/Makefile.am --- a/modules/mixer/simple/Makefile.am Thu Aug 30 14:12:42 2007 +0200 +++ b/modules/mixer/simple/Makefile.am Fri Aug 31 15:22:26 2007 +0200 @@ -1,5 +1,6 @@ pkglibdir = @ALSA_PLUGIN_DIR@/smixer pkglibdir = @ALSA_PLUGIN_DIR@/smixer pythonlibs = @PYTHON_LIBS@ +pythonincdir = @PYTHON_INCDIR@ AM_CFLAGS = -g -O2 -W -Wall @@ -30,5 +31,6 @@ if BUILD_PYTHON if BUILD_PYTHON smixer_python_la_SOURCES = python.c smixer_python_la_LDFLAGS = -module -avoid-version $(pythonlibs) +smixer_python_la_CFLAGS = $(pythonincdir) smixer_python_la_LIBADD = ../../../src/libasound.la endif diff -r 7dcb60b0ce1d -r 6d6ca0de35c7 modules/mixer/simple/python.c --- a/modules/mixer/simple/python.c Thu Aug 30 14:12:42 2007 +0200 +++ b/modules/mixer/simple/python.c Fri Aug 31 15:22:26 2007 +0200 @@ -19,11 +19,11 @@ * */ +#include "Python.h" #include <stddef.h> #include "config.h" #include "asoundlib.h" #include "mixer_abst.h" -#include <python/Python.h> struct python_priv { int py_initialized;