diff options
author | reinelt <> | 2005-05-02 10:29:20 +0000 |
---|---|---|
committer | reinelt <> | 2005-05-02 10:29:20 +0000 |
commit | 3f9d0ec33a203cf19aa380fb07d26f30b6549580 (patch) | |
tree | dfb02be1bd48236faa35fb0dc814c44eb5d55d77 /configure | |
parent | bce8f6ed91e5264dadae0d77171dc2d94e9a867e (diff) | |
download | lcd4linux-3f9d0ec33a203cf19aa380fb07d26f30b6549580.tar.gz |
[lcd4linux @ 2005-05-02 10:29:20 by reinelt]
preparations for python bindings and python plugin
Diffstat (limited to '')
-rwxr-xr-x | configure | 283 | ||||
-rw-r--r-- | configure.in | 4 |
2 files changed, 285 insertions, 2 deletions
@@ -311,7 +311,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP LN_S CURSES_LIBS CURSES_INCLUDEDIR EGREP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS DRIVERS DRVLIBS PLUGINS PLUGINLIBS LIBOBJS POW_LIB LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP LN_S CURSES_LIBS CURSES_INCLUDEDIR EGREP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir PYTHON_CPPFLAGS PYTHON_LDFLAGS PYTHON_SITE_PKG PYTHON_EXTRA_LIBS DRIVERS DRVLIBS PLUGINS PLUGINLIBS LIBOBJS POW_LIB LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -5523,6 +5523,255 @@ fi done +# check for python +## ------------------------ +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## ------------------------ + +# Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# AM_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + + + + +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# hexversion has been introduced in Python 1.5.2; it's probably not +# worth to support older versions (1.5.1 was released on October 31, 1998). + + + + + + + + + + + + # Find any Python interpreter. + for ac_prog in python python2 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PYTHON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON + +if test -n "$PYTHON"; then + echo "$as_me:$LINENO: result: $PYTHON" >&5 +echo "${ECHO_T}$PYTHON" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$PYTHON" && break +done + + am_display_PYTHON=python + + + + echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 +echo $ECHO_N "checking for $am_display_PYTHON version... $ECHO_C" >&6 +if test "${am_cv_python_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"` +fi +echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +echo "${ECHO_T}$am_cv_python_version" >&6 + PYTHON_VERSION=$am_cv_python_version + + + + PYTHON_PREFIX='${prefix}' + + PYTHON_EXEC_PREFIX='${exec_prefix}' + + + + echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 +echo $ECHO_N "checking for $am_display_PYTHON platform... $ECHO_C" >&6 +if test "${am_cv_python_platform+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` +fi +echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +echo "${ECHO_T}$am_cv_python_platform" >&6 + PYTHON_PLATFORM=$am_cv_python_platform + + + + + echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 +echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6 +if test "${am_cv_python_pythondir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` +fi +echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +echo "${ECHO_T}$am_cv_python_pythondir" >&6 + pythondir=$am_cv_python_pythondir + + + + pkgpythondir=\${pythondir}/$PACKAGE + + + echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 +echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6 +if test "${am_cv_python_pyexecdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` +fi +echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 + pyexecdir=$am_cv_python_pyexecdir + + + + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + + + # + # should allow for checking of python version here... + # + + + # Check for Python include path + echo "$as_me:$LINENO: checking for Python include path" >&5 +echo $ECHO_N "checking for Python include path... $ECHO_C" >&6 + python_path=`echo $PYTHON | sed "s,/bin.*$,,"` + for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" "$python_path/" ; do + python_path=`find $i -type f -name Python.h -print | sed "1q"` + if test -n "$python_path" ; then + break + fi + done + python_path=`echo $python_path | sed "s,/Python.h$,,"` + echo "$as_me:$LINENO: result: $python_path" >&5 +echo "${ECHO_T}$python_path" >&6 + if test -z "$python_path" ; then + { { echo "$as_me:$LINENO: error: cannot find Python include path" >&5 +echo "$as_me: error: cannot find Python include path" >&2;} + { (exit 1); exit 1; }; } + fi + PYTHON_CPPFLAGS=-I$python_path + + + # Check for Python library path + echo "$as_me:$LINENO: checking for Python library path" >&5 +echo $ECHO_N "checking for Python library path... $ECHO_C" >&6 + python_path=`echo $PYTHON | sed "s,/bin.*$,,"` + for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do + python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"` + if test -n "$python_path" ; then + break + fi + done + python_path=`echo $python_path | sed "s,/libpython.*$,,"` + echo "$as_me:$LINENO: result: $python_path" >&5 +echo "${ECHO_T}$python_path" >&6 + if test -z "$python_path" ; then + { { echo "$as_me:$LINENO: error: cannot find Python library path" >&5 +echo "$as_me: error: cannot find Python library path" >&2;} + { (exit 1); exit 1; }; } + fi + PYTHON_LDFLAGS="-L$python_path -lpython$PYTHON_VERSION" + + # + python_site=`echo $python_path | sed "s/config/site-packages/"` + PYTHON_SITE_PKG=$python_site + + # + # libraries which must be linked in when embedding + # + echo "$as_me:$LINENO: checking python extra libraries" >&5 +echo $ECHO_N "checking python extra libraries... $ECHO_C" >&6 + PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print conf('LOCALMODLIBS')+' '+conf('LIBS')" + echo "$as_me:$LINENO: result: $PYTHON_EXTRA_LIBS" >&5 +echo "${ECHO_T}$PYTHON_EXTRA_LIBS" >&6` + + + # drivers echo "$as_me:$LINENO: checking which drivers to compile" >&5 @@ -6005,6 +6254,7 @@ echo "$as_me: error: run ./configure --with-plugins=..." >&2;} PLUGIN_POP3="yes" PLUGIN_PPP="yes" PLUGIN_PROC_STAT="yes" + PLUGIN_PYTHON="yes" PLUGIN_SETI="yes" PLUGIN_STATFS="yes" PLUGIN_UNAME="yes" @@ -6057,6 +6307,9 @@ echo "$as_me: error: run ./configure --with-plugins=..." >&2;} proc_stat) PLUGIN_PROC_STAT=$val ;; + python) + PLUGIN_PYTHON=$val + ;; seti) PLUGIN_SETI=$val ;; @@ -6884,7 +7137,7 @@ fi done if test "$has_ppp_header" = "true"; then - PLUGINS="$PLUGINS plugin_ppp.o" + PLUGINS="$PLUGINS plugin_ppp.o" cat >>confdefs.h <<\_ACEOF #define PLUGIN_PPP 1 @@ -6903,6 +7156,19 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi +if test "$PLUGIN_PYTHON" = "yes"; then + if test -z "$python_path"; then + { echo "$as_me:$LINENO: WARNING: python headers not found: python plugin disabled" >&5 +echo "$as_me: WARNING: python headers not found: python plugin disabled" >&2;} + else + PLUGINS="$PLUGINS plugin_python.o" + +cat >>confdefs.h <<\_ACEOF +#define PLUGIN_PYTHON 1 +_ACEOF + + fi +fi if test "$PLUGIN_SETI" = "yes"; then PLUGINS="$PLUGINS plugin_seti.o" @@ -10617,6 +10883,19 @@ s,@X_CFLAGS@,$X_CFLAGS,;t t s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t s,@X_LIBS@,$X_LIBS,;t t s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@PYTHON@,$PYTHON,;t t +s,@PYTHON_VERSION@,$PYTHON_VERSION,;t t +s,@PYTHON_PREFIX@,$PYTHON_PREFIX,;t t +s,@PYTHON_EXEC_PREFIX@,$PYTHON_EXEC_PREFIX,;t t +s,@PYTHON_PLATFORM@,$PYTHON_PLATFORM,;t t +s,@pythondir@,$pythondir,;t t +s,@pkgpythondir@,$pkgpythondir,;t t +s,@pyexecdir@,$pyexecdir,;t t +s,@pkgpyexecdir@,$pkgpyexecdir,;t t +s,@PYTHON_CPPFLAGS@,$PYTHON_CPPFLAGS,;t t +s,@PYTHON_LDFLAGS@,$PYTHON_LDFLAGS,;t t +s,@PYTHON_SITE_PKG@,$PYTHON_SITE_PKG,;t t +s,@PYTHON_EXTRA_LIBS@,$PYTHON_EXTRA_LIBS,;t t s,@DRIVERS@,$DRIVERS,;t t s,@DRVLIBS@,$DRVLIBS,;t t s,@PLUGINS@,$PLUGINS,;t t diff --git a/configure.in b/configure.in index 1a4c97d..185d97b 100644 --- a/configure.in +++ b/configure.in @@ -64,6 +64,10 @@ AC_CHECK_HEADERS(linux/compiler.h linux/i2c.h linux/i2c-dev.h,[has_i2c="true"],[ # endif ]) +# check for python +sinclude(python.m4) +AC_PYTHON_DEVEL + # drivers sinclude(drivers.m4) |