]> granicus.if.org Git - python/commitdiff
disable ASDLGEN if hg won't work, or if python is not installed.
authorRalf Schmitt <ralf@systemexit.de>
Tue, 31 May 2011 22:10:03 +0000 (17:10 -0500)
committerRalf Schmitt <ralf@systemexit.de>
Tue, 31 May 2011 22:10:03 +0000 (17:10 -0500)
This change makes configure check for
- the existence of a hg repository
- the hg executable itself
- the python executable

Running $(srcdir)/Parser/asdl_c.py (i.e. ASDLGEN) will fail if any of
the above prerequisites is missing, so we now disable it instead.

closes #12225

Makefile.pre.in
configure.in

index f6ecacf307a6510864c0fab5c4d6abe1c3d86fa1..3cf8ec115f42ac8a9dc70e62e770de039bda9f9b 100644 (file)
@@ -274,7 +274,7 @@ AST_ASDL=   $(srcdir)/Parser/Python.asdl
 
 ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
 # XXX Note that a build now requires Python exist before the build starts
-ASDLGEN=       $(srcdir)/Parser/asdl_c.py
+ASDLGEN=       @DISABLE_ASDLGEN@ $(srcdir)/Parser/asdl_c.py
 
 ##########################################################################
 # Python
index b5f155d7bbffbc86559f18770a4a322fbdf36650..49932debca5e9cbd97026a1cd1715111692dfc28 100644 (file)
@@ -811,7 +811,13 @@ fi
 AC_SUBST(HGVERSION)
 AC_SUBST(HGTAG)
 AC_SUBST(HGBRANCH)
+
+if test -e $srcdir/.hg/00changelog.i
+then
 AC_CHECK_PROG(HAS_HG, hg, found, not-found)
+else
+HAS_HG=no-repository
+fi
 if test $HAS_HG = found
 then
     HGVERSION="hg id -i \$(srcdir)"
@@ -823,6 +829,15 @@ else
     HGBRANCH=""
 fi
 
+AC_SUBST(DISABLE_ASDLGEN)
+DISABLE_ASDLGEN=""
+AC_CHECK_PROG(HAS_PYTHON, python, found, not-found)
+if test $HAS_HG != found -o $HAS_PYTHON != found
+then
+    DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
+fi
+
+
 case $MACHDEP in
 bsdos*|hp*|HP*)
        # install -d does not work on BSDI or HP-UX