This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

91-handle-java-python-lisp.patch


Index: ChangeLog
from  Akim Demaille  <akim@epita.fr>
	Unify LISP, PYTHON and JAVA primaries.
	
	* automake.in (&handle_emacs_lisp): Be like &handle_python, i.e.,
	return if there are no files, hook elist-comp on the Autoconf
	macro, rely on lisp.am to define variables.
	(&handle_python, &handle_java): Likewise.
	(&scan_one_autoconf_file): Pseudo AC_SUBST of `pythondir' and
	`PYTHON' must be handled here, not in `&handle_python'.
	* java.am: Define needed variables and rules.
	
	
Index: automake.in
--- automake.in Sun, 25 Mar 2001 18:56:51 +0200 akim (am/f/39_automake.i 1.216 755)
+++ automake.in Sun, 25 Mar 2001 19:26:57 +0200 akim (am/f/39_automake.i 1.216 755)
@@ -4006,28 +4006,18 @@ sub handle_emacs_lisp
     my @elfiles = &am_install_var ('-candist', 'lisp', 'LISP',
 				   'lisp', 'noinst');
 
-    if (@elfiles)
-    {
-	# Generate .elc files.
-	grep ($_ .= 'c', @elfiles);
-	&define_pretty_variable ('ELCFILES', '', @elfiles);
+    return if ! @elfiles;
 
-	push (@all, '$(ELCFILES)');
+    # Generate .elc files.
+    grep ($_ .= 'c', @elfiles);
+    &define_pretty_variable ('ELCFILES', '', @elfiles);
 
-	my $varname;
-	if (&variable_defined ('lisp_LISP'))
-	{
-	    $varname = 'lisp_LISP';
-	    &am_error ("`lisp_LISP' defined but `AM_PATH_LISPDIR' not in `$configure_ac'")
-		if ! $seen_lispdir;
-	}
-	else
-	{
-	    $varname = 'noinst_LISP';
-	}
+    push (@all, '$(ELCFILES)');
 
-	&require_file_with_line ($varname, $FOREIGN, 'elisp-comp');
-    }
+    &am_error ("`lisp_LISP' defined but `AM_PATH_LISPDIR' not in `$configure_ac'")
+      if ! $seen_lispdir && &variable_defined ('lisp_LISP');
+
+    &require_file_with_conf_line ('AM_PATH_LISPDIR', $FOREIGN, 'elisp-comp');
 }
 
 # Handle Python
@@ -4038,20 +4028,10 @@ sub handle_python
     return if ! @pyfiles;
 
     # Found some python.
-    &define_configure_variable ('pythondir');
-    &define_configure_variable ('PYTHON');
-
     &am_error ("`python_PYTHON' defined but `AM_CHECK_PYTHON' not in `$configure_ac'")
 	if ! $seen_pythondir && &variable_defined ('python_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');
-    }
+    &require_file_with_conf_line ('AM_CHECK_PYTHON', $FOREIGN, 'py_comp');
 }
 
 # Handle Java.
@@ -4062,12 +4042,6 @@ sub handle_java
 				      'java', 'noinst', 'check');
     return if ! @sourcelist;
 
-    &define_variable ('JAVAC', 'javac');
-    &define_variable ('JAVACFLAGS', '');
-    &define_variable ('CLASSPATH_ENV',
-		      'CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT):$$CLASSPATH');
-    &define_variable ('JAVAROOT', '$(top_builddir)');
-
     my %valid = &am_primary_prefixes ('JAVA', 1,
 				      'java', 'noinst', 'check');
 
@@ -4087,15 +4061,10 @@ sub handle_java
 	$dir = $curs;
     }
 
-    $output_rules .= ('class' . $dir . '.stamp: $(' . $dir . '_JAVA)' . "\n"
-		      . "\t" . '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) '
-		      . '$(JAVACFLAGS) $?' . "\n"
-		      . "\t" . 'echo timestamp > class' . $dir . '.stamp'
-		      . "\n");
     push (@all, 'class' . $dir . '.stamp');
-    &push_dist_common ('$(' . $dir . '_JAVA)');
 }
 
+
 # Handle some of the minor options.
 sub handle_minor_options
 {
@@ -4527,7 +4496,13 @@ sub scan_one_autoconf_file
 
 	$seen_prog_install = 1 if /AC_PROG_INSTALL/;
         $seen_lispdir = 1 if /AM_PATH_LISPDIR/;
-	$seen_pythondir = 1 if /AM_PATH_PYTHON/;
+
+        if (/AM_PATH_PYTHON/)
+	  {
+	    $seen_pythondir = 1;
+	    $configure_vars{'pythondir'} = $filename . ':' . $.;
+	    $configure_vars{'PYTHON'} = $filename . ':' . $.;
+	  }
 
         if (/A(C|M)_PROG_LIBTOOL/)
 	{
Index: java.am
--- java.am Mon, 12 Mar 2001 21:28:36 +0100 akim (am/g/36_java.am 1.10 644)
+++ java.am Sun, 25 Mar 2001 19:22:35 +0200 akim (am/g/36_java.am 1.10 644)
@@ -16,6 +16,21 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
+
+## --------- ##
+## Bulding.  ##
+## --------- ##
+
+JAVAC = @JAVAC@
+JAVACFLAGS = @JAVACFLAGS@
+CLASSPATH_ENV = CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT):$$CLASSPATH
+JAVAROOT = $(top_builddir)
+
+class%DIR%.stamp: $(%DIR%_JAVA)
+	$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(JAVACFLAGS) $?
+	echo timestamp > class%DIR%.stamp
+
+
 ## ------------ ##
 ## Installing.  ##
 ## ------------ ##


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]