]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/aclocal.m4
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / stepmake / aclocal.m4
index b113c80856c3e1e5427c95a11371b1350aad6476..b2e27613a4ed8bf796496ce5c05cea62ea5a8a6c 100644 (file)
@@ -1029,7 +1029,16 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
            fi
            ])
     
-    if test "$cross_compiling" = "no" -a -z "$PYTHON_CFLAGS"; then
+    AC_CHECK_PROGS(PYTHON_CONFIG, python-config, no)
+
+    if test -z "$PYTHON_CFLAGS" -a "$PYTHON_CONFIG" != "no"; then
+        # Clean out junk: http://bugs.python.org/issue3290
+       # Python headers may need some -f* flags, leave them in.
+       PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/ -\(W\|D\|O\)\(\w\|-\)\+//g'`
+       PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+    fi
+    
+    if test -z "$PYTHON_CFLAGS" -a "$cross_compiling" = "no"; then
        changequote(<<, >>)#dnl
        # alternatively, for python >= 2.0
        # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
@@ -1038,11 +1047,6 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
        changequote([, ])#dnl
     fi
     
-    if test "$cross_compiling" = "yes" -a -z "$PYTHON_CFLAGS"; then
-       PYTHON_CFLAGS=`python-config --cflags`
-       PYTHON_LDFLAGS=`python-config --ldflags`
-    fi
-    
     if test -z "$PYTHON_HEADER"; then
        CPPFLAGS="$PYTHON_CFLAGS $CPPFLAGS"
        AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])