From: Akim Demaille Date: Fri, 27 Apr 2001 13:16:59 +0000 (+0000) Subject: Unify LISP, PYTHON and JAVA primaries. X-Git-Tag: handle-languages~40 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=0fa8e0d7f88f3a3847a017d9274c56d4c2eb123f;p=automake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 0e2d9dd6..2ab7d8c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-04-27 Akim Demaille + + 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. + 2001-04-27 Akim Demaille * automake.in (&am_install_var): Transform `ONE_PRIMARY'. diff --git a/automake.in b/automake.in index 946ca357..4289396b 100755 --- a/automake.in +++ b/automake.in @@ -4095,28 +4095,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 @@ -4127,20 +4117,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. @@ -4151,12 +4131,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'); @@ -4176,15 +4150,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 { @@ -4616,7 +4585,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/) { diff --git a/java.am b/java.am index 88442cf6..cbc7435b 100644 --- a/java.am +++ b/java.am @@ -16,6 +16,21 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. + +## --------- ## +## Bulding. ## +## --------- ## + +JAVAC = javac +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. ## ## ------------ ## diff --git a/lib/am/java.am b/lib/am/java.am index 88442cf6..cbc7435b 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -16,6 +16,21 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. + +## --------- ## +## Bulding. ## +## --------- ## + +JAVAC = javac +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. ## ## ------------ ##