--- automake-1.4.orig	Mon Feb  1 16:56:39 1999
+++ automake	Mon Feb  1 19:39:11 1999
@@ -41,7 +41,7 @@
 $COMMENT_PATTERN = "^#";
 $RULE_PATTERN = "^([\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*) *:([^=].*|)\$";
 $SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z]+)\\.([a-zA-Z]+)\$";
-$MACRO_PATTERN = "^([A-Za-z][A-Za-z0-9_]*)[ \t]*([:+]?)=[ \t]*(.*)\$";
+$MACRO_PATTERN = "^([A-Za-z_][A-Za-z0-9_]*)[ \t]*([:+]?)=[ \t]*(.*)\$";
 $BOGUS_MACRO_PATTERN = "^([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$";
 $GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?";
 $IF_PATTERN = "^if[ \t]+\([A-Za-z][A-Za-z0-9_]*\)[ \t]*\(#.*\)?\$";
@@ -205,6 +205,9 @@
 # TRUE if we've seen AM_PATH_LISPDIR.
 $seen_lispdir = 0;
 
+# TRUE if we'v seen AM_PATH_PYTHON
+$seen_path_python = 0;
+
 # TRUE if we've seen AC_EXEEXT.
 $seen_exeext = 0;
 
@@ -620,6 +623,7 @@
     &handle_multilib;
     &handle_texinfo;
     &handle_emacs_lisp;
+    &handle_python;
     &handle_java;
     &handle_man_pages;
     &handle_data;
@@ -1486,6 +1490,8 @@
 	    $xexe = 's/\@EXEEXT\@//g;';
 	}
 
+	$one_file =~ s/\$/\\\$/g;
+
 	$output_rules .=
 	    &file_contents_with_transform
 		('s/\@PROGRAM\@/' . $one_file . '/go;'
@@ -3853,6 +3859,26 @@
     }
 }
 
+# Handle Python.
+sub handle_python
+{
+    local (@sourcelist) = &am_install_var ('-clean', 'python', 'PYTHON',
+					   'python', 'noinst', 'check');
+    return if ! @sourcelist;
+
+    &define_pretty_variable ('PYTHONFILES', '', @sourcelist);
+    &push_dist_common ('$(PYTHONFILES)');
+
+    &am_error ("\`PYTHON' primary used, but AM_PATH_PYTHON not in \`configure.in'")
+	if ! $seen_path_python;
+
+    if ($config_aux_dir eq '.' || $config_aux_dir eq '') {
+	&define_variable ('py_compile', '$(top_srcdir)/py-compile');
+    } else {
+	&define_variable ('py_compile', $config_aux_dir . '/py-compile');
+    }
+}
+
 # Handle Java.
 sub handle_java
 {
@@ -4263,6 +4289,7 @@
 
 	$seen_prog_install = 1 if /AC_PROG_INSTALL/;
         $seen_lispdir = 1 if /AM_PATH_LISPDIR/;
+	$seen_path_python = 1 if /AM_PATH_PYTHON/;
 
         if (/AM_PROG_LIBTOOL/)
 	{
@@ -4330,6 +4357,9 @@
     &require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing');
     &am_error ("\`install.sh' is an anachronism; use \`install-sh' instead")
         if -f $config_aux_path[0] . '/install.sh';
+
+    &require_config_file ($FOREIGN, 'py-compile')
+	if $seen_path_python;
 }
 
 ################################################################
@@ -6199,7 +6229,7 @@
 	 "libversion.in", "mdate-sh", "mkinstalldirs", "install-sh",
 	 'texinfo.tex', "ansi2knr.c", "ansi2knr.1", 'elisp-comp',
 	 'ylwrap', 'acinclude.m4', @libtoolize_files,
-	 'missing'
+	 'missing', 'py-compile'
 	 );
 
     # Commonly used files we auto-include, but only sometimes.
@@ -6602,7 +6632,8 @@
     # allow `JAVA', as it is customarily used to mean the Java
     # interpreter.  This is but one of several Java hacks.
     &am_line_error ($primary, "\`$primary' is an anachronism")
-	if &variable_defined ($primary) && $primary ne 'JAVA';
+	if &variable_defined ($primary) && $primary ne 'JAVA' &&
+	    $primary ne 'PYTHON';
 
 
     # Look for misspellings.  It is an error to have a variable ending
@@ -6790,7 +6821,7 @@
     }
 
     # The JAVA variable is used as the name of the Java interpreter.
-    if (@used && $primary ne 'JAVA')
+    if (@used && $primary ne 'JAVA' && $primary ne 'PYTHON')
     {
 	# Define it.
 	&define_pretty_variable ($primary, '', @used);
@@ -6805,7 +6836,7 @@
 
     # Push here because PRIMARY might be configure time determined.
     push (@all, '$(' . $primary . ')')
-	if @used && $primary ne 'JAVA';
+	if @used && $primary ne 'JAVA' && $primary ne 'PYTHON';
 
     return (@result);
 }
