]> git.donarmstrong.com Git - lilypond.git/commitdiff
* configure.in: Use lily/main.cc as identifying source file.
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 17 Jul 2003 08:35:30 +0000 (08:35 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 17 Jul 2003 08:35:30 +0000 (08:35 +0000)
* 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

ChangeLog
config.hh.in
configure.in
lily/accidental-engraver.cc
python/midi.c
stepmake/aclocal.m4

index 6ed263f099f9bb46b978bf9c6d92132619223d5f..640b5b385244df19e4c60a152e912b0877fd5717 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+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
index 71848269c4aa1313f46065b0a58ea6b76c99abf2..64bbf775fdb12a51826d6a0c0414ef6964521944 100644 (file)
 /* 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
 
index 7acae1843d9ea3d8328c187abb5ed5a2e9a78654..8dd486c886848f477a3ead6e52ad419b58c9e0ce 100644 (file)
@@ -12,7 +12,9 @@ AC_CONFIG_AUX_DIR([stepmake/bin])
 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])
 
@@ -24,6 +26,7 @@ AC_CONFIG_SUBDIRS(stepmake)
 # 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)
index 095ed8d0d0e92bd56914e687b404b0239f83943b..23958478898ae7a1fec65e7335531cd8481e74e1 100644 (file)
@@ -17,6 +17,7 @@
 #include "arpeggio.hh"
 #include "warn.hh"
 #include "translator-group.hh"
+#include "protected-scm.hh"
 
 /**
 
index f387a758f12e6da131c67adc01ff08476c0dbf27..5ce8ba78f937426d4c2cccd67fb848fdc7b042ff 100644 (file)
@@ -10,7 +10,7 @@
 
 /*
 
-python2
+python
 import midi
 s = open ("s.midi").read ()
 midi.parse_track (s)
@@ -19,27 +19,7 @@ midi.parse (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;
index fe8d1a9f8cd220dc3db278bf6fb978a6d84b18b3..a4c8fddd70c5365134efd1475008ba8c42c84dc1 100644 (file)
@@ -23,10 +23,12 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [
     ## 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
 ])
@@ -640,8 +642,8 @@ AC_DEFUN(STEPMAKE_INIT, [
        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
@@ -878,10 +880,50 @@ AC_DEFUN(STEPMAKE_PERL, [
 ])
 
 
+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
 ])