+2003-07-17 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * configure.in: Use lily/main.cc as identifying source file.
+
+ * lily/accidental-engraver.cc: Compile fix: include protected-scm.hh.
+
+ * config.hh.in:
+ * python/midi.c: Remove <pyphonX>/Python.h ifdef tree.
+
+ * configure.in: Require PYTHON >= 2.0.
+
+ * stepmake/aclocal.m4 (STEPMAKE_PYTHON_DEVEL): Rewrite. Ask
+ $PYTHON for include dir location.
+ (STEPMAKE_PYTHON): New function. Use
+
+ PYTHON=foo ./configure
+
+ to override.
+
2003-07-17 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* make/lilypond.redhat.spec.in (Group): change ftp.cs.uu.nl to
/* define if you have kpse_find_tfm */
#define HAVE_KPSE_FIND_TFM 0
-/* define if you have python2.2/Python.h header */
-#define HAVE_PYTHON2_2_PYTHON_H 0
-
-/* define if you have python2.1/Python.h header */
-#define HAVE_PYTHON2_1_PYTHON_H 0
-
-/* define if you have python2.0/Python.h header */
-#define HAVE_PYTHON2_0_PYTHON_H 0
-
-/* define if you have python2/Python.h header */
-#define HAVE_PYTHON2_PYTHON_H 0
-
-/* define if you have python1.5/Python.h */
-#define HAVE_PYTHON1_5_PYTHON_H 0
-
-/* define if you have python/Python.h header */
-#define HAVE_PYTHON_PYTHON_H 0
-
/* define if you have Python.h header */
#define HAVE_PYTHON_H 0
STEPMAKE_INIT
# List a file that identifies your package.
-AC_CONFIG_SRCDIR([make/lilypond.lsm.in])
+## huh, lsm.in silently [re]moved?
+##AC_CONFIG_SRCDIR([make/lilypond.lsm.in])
+AC_CONFIG_SRCDIR([lily/main.cc])
# Move to aclocal.m4?
AC_CONFIG_HEADER([$CONFIGFILE.h:config.hh.in])
# must come before any header checks
STEPMAKE_COMPILE
+STEPMAKE_PYTHON(REQUIRED,2.0)
STEPMAKE_GCC(REQUIRED, 2.8)
STEPMAKE_CXX(REQUIRED)
STEPMAKE_GXX(REQUIRED, 2.95)
/*
-python2
+python
import midi
s = open ("s.midi").read ()
midi.parse_track (s)
*/
#include "config.h"
-
-/* urg */
-#if HAVE_PYTHON2_PYTHON_H
-#include <python2/Python.h>
-#elif HAVE_PYTHON2_2_PYTHON_H
-#include <python2.2/Python.h>
-#elif HAVE_PYTHON2_1_PYTHON_H
-#include <python2.1/Python.h>
-#elif HAVE_PYTHON2_0_PYTHON_H
-#include <python2.0/Python.h>
-#elif HAVE_PYTHON1_5_PYTHON_H
-#include <python1.5/Python.h>
-#elif HAVE_PYTHON_PYTHON_H
-#define assert(x)
-#include <python/Python.h>
-#elif HAVE_PYTHON_H
-#define assert(x)
#include <Python.h>
-#else
-#error Need Python.h
-#endif
#if 0
int x = 0;
## Workaround for broken Debian gcc version string:
## gcc (GCC) 3.1.1 20020606 (Debian prerelease)
##
+ ## -V: Workaround for python
+ ##
## Assume, and hunt for, dotted version multiplet.
changequote(<<, >>)dnl
- "$1" --version 2>&1 | grep '[0-9]\.[0-9]' | head -1 | \
+ ("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\.[0-9]' | head -1 | \
sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/'
changequote([, ])dnl
])
AC_PATH_PROG(BASH, bash, $SHELL)
fi
AC_SUBST(SHELL)
-
- STEPMAKE_PATH_PROG(PYTHON, python, REQUIRED)
+
+ STEPMAKE_PYTHON(REQUIRED, 1.5)
if expr "$MAKE" : '.*\(echo\)' >/dev/null; then
$MAKE -v 2> /dev/null | grep GNU > /dev/null
])
+AC_DEFUN(STEPMAKE_PYTHON, [
+ unset pv
+ AC_MSG_CHECKING([for python])
+ for python in $PYTHON python python2 python2.3 python2.2 python2.1 python2.0; do
+ AC_MSG_RESULT([$python])
+ if ! $python -V > /dev/null 2>&1 ; then
+ #AC_MSG_WARN([cannot execute $python])
+ PYTHON='echo no python'
+ else
+ unset pv
+ STEPMAKE_CHECK_VERSION(python, pv, $2)
+ if test -z "$pv"; then
+ PYTHON=$python
+ break
+ fi
+ fi
+ done
+ if test -n "$pv"; then
+ STEPMAKE_ADD_ENTRY($1, $pv)
+ fi
+ AC_SUBST(PYTHON)
+])
+
AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
- AC_CHECK_HEADERS([python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h],[PYTHON_HEADER=yes])
+ unset PYTHON_HEADER PYTHON_INCLUDE
+ if test -n "$PYTHON"; then
+ changequote(<<, >>)dnl
+ # alternatively, for python >= 2.0
+ # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
+ PYTHON_INCLUDE=`$PYTHON -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'`
+ changequote([, ])dnl
+ fi
+
+ ##AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
+ if test -z "$PYTHON_HEADER"; then
+ #URG -- how to extend include path?
+ ac_compile="$ac_compile -I$PYTHON_INCLUDE"
+ ac_cpp="$ac_cpp -I$PYTHON_INCLUDE"
+ CPPFLAGS="$CPPFLAGS -I$PYTHON_INCLUDE"
+ AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
+ fi
+
if test -z "$PYTHON_HEADER"; then
- warn='python.h (python-devel, python-dev or libpython-dev package)'
+ warn="$PYTHON_INCLUDE/Python.h (python-devel, python-dev or libpython-dev package)"
STEPMAKE_ADD_ENTRY($1, $warn)
fi
])