diff -r fe532dccf8f6 Makefile.pre.in --- a/Makefile.pre.in Mon Apr 14 10:30:43 2014 -0400 +++ b/Makefile.pre.in Tue Apr 15 00:35:54 2014 +0530 @@ -323,6 +323,13 @@ PGENOBJS= $(POBJS) $(PGOBJS) ########################################################################## +# opcode.h generation +OPCODE_H_DIR= Include +OPCODE_H_SCRIPT= Tools/scripts/generate_opcode_h.py +OPCODE_H= $(srcdir)/$(OPCODE_H_DIR)/opcode.h +OPCODE_H_GEN= @OPCODEHGEN@ $(OPCODE_H_SCRIPT) Lib/ $(OPCODE_H) +# +########################################################################## # AST AST_H_DIR= Include AST_H= $(AST_H_DIR)/Python-ast.h @@ -760,6 +767,9 @@ $(MKDIR_P) $(AST_C_DIR) $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) +$(OPCODE_H): + $(OPCODE_H_GEN) + Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) Python/getplatform.o: $(srcdir)/Python/getplatform.c @@ -871,7 +881,7 @@ $(srcdir)/Include/node.h \ $(srcdir)/Include/object.h \ $(srcdir)/Include/objimpl.h \ - $(srcdir)/Include/opcode.h \ + $(OPCODE_H) \ $(srcdir)/Include/osdefs.h \ $(srcdir)/Include/patchlevel.h \ $(srcdir)/Include/pgen.h \ diff -r fe532dccf8f6 configure --- a/configure Mon Apr 14 10:30:43 2014 -0400 +++ b/configure Tue Apr 15 00:35:54 2014 +0530 @@ -670,6 +670,7 @@ INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +OPCODEHGEN PYTHON ASDLGEN ac_ct_READELF @@ -6048,6 +6049,57 @@ fi +for ac_prog in python$PACKAGE_VERSION python3 python +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PYTHON"; then + ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. +else +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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PYTHON="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PYTHON=$ac_cv_prog_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PYTHON" && break +done +test -n "$PYTHON" || PYTHON="not-found" + +if test "$PYTHON" = not-found; then + OPCODEHGEN="@echo python: $PYTHON! cannot run Tools/scripts/generate_opcode_h.py" +else + OPCODEHGEN="$PYTHON" +fi + + + case $MACHDEP in bsdos*|hp*|HP*) # install -d does not work on BSDI or HP-UX diff -r fe532dccf8f6 configure.ac --- a/configure.ac Mon Apr 14 10:30:43 2014 -0400 +++ b/configure.ac Tue Apr 15 00:35:54 2014 +0530 @@ -1036,6 +1036,15 @@ ASDLGEN="$PYTHON" fi +AC_SUBST(OPCODEHGEN) +AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found) +if test "$PYTHON" = not-found; then + OPCODEHGEN="@echo python: $PYTHON! cannot run Tools/scripts/generate_opcode_h.py" +else + OPCODEHGEN="$PYTHON" +fi + + case $MACHDEP in bsdos*|hp*|HP*)