Sun Jun 2 10:33:10 1996 Tom Tromey <tromey@creche.cygnus.com>
+ * automake.in (handle_emacs_lisp): New function.
+ (initialize_global_constants): Added elisp-comp to
+ @common_sometimes.
+ (seen_lispdir): New global.
+ (scan_configure): Handle ud_PATH_LISPDIR.
+
+ * elisp-comp: New file.
+
+ * lisp.am: New file.
+
+ * automake.in (generate_makefile): Run handle_emacs_lisp.
+
+ * aclocal.m4 (ud_PATH_LISPDIR): New macro, from Ulrich Drepper.
+
* automake.in (initialize_global_constants): Removed version.texi
from common_sometimes.
(initialize_global_constants): Added texinfo.tex to common_files.
(read_am_file): Generate some extra variables when AC_CANONICAL_*
used.
(handle_options): Allow version number to have letters appended.
+ (handle_tests): Error if RUNTEST, RUNTESTFLAGS defined but dejagnu
+ option not specd.
+ (initialize_global_constants): install_man_format changed to
+ handle built man pages.
Wed May 29 10:35:01 1996 Tom Tromey <tromey@creche.cygnus.com>
remake.am scripts.am subdirs.am tags.am tags-subd.am tags-clean.am \
texi-version.am texinfos-vars.am texinfos.am libraries-clean.am \
programs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \
-ansi2knr.1 aclocal.m4
+ansi2knr.1 aclocal.m4 lisp.am
## These must all be executable when installed.
-pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh \
+mkinstalldirs elisp-comp
CLEANFILES = automake
$(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
$(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
-# Some simple checks:
-# * syntax check with perl4 and perl5.
-# * make sure the scripts don't use 'true'
-# * expect no instances of '${...}'
-# These are only really guaranteed to work on my machine.
+# Some simple checks, and then ordinary check. These are only really
+# guaranteed to work on my machine.
maintainer-check: automake
-## Do syntax, etc, checks before make check.
+## Syntax check with default Perl (on my machine, Perl 5).
$(PERL) -c -w automake
+## Ensure `true' is never used; I've accidentally used it before.
@if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
echo "can't use 'true' in GNU Makefile" 1>&2; \
exit 1; \
else :; fi
- @if test `fgrep '$${' $(srcdir)/[a-z]*.am | wc -l` -ne 0; then \
+## expect no instances of '${...}'. However, $${...} is ok, since that
+## is a shell construct, not a Makefile construct.
+ @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
echo "found too many uses of '\$${'" 1>&2; \
exit 1; \
fi
+## Another syntax check, this time with Perl 4, if it exists.
if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
perl4.036 -c -w automake; \
else :; fi
-# Makefile.in generated automatically by automake 1.0 from Makefile.am
+# Makefile.in generated automatically by automake 1.1a from Makefile.am
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
remake.am scripts.am subdirs.am tags.am tags-subd.am tags-clean.am \
texi-version.am texinfos-vars.am texinfos.am libraries-clean.am \
programs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \
-ansi2knr.1 aclocal.m4
+ansi2knr.1 aclocal.m4 lisp.am
-pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh \
+mkinstalldirs elisp-comp
CLEANFILES = automake
$(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
$(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
-# Some simple checks:
-# * syntax check with perl4 and perl5.
-# * make sure the scripts don't use 'true'
-# * expect no instances of '${...}'
-# These are only really guaranteed to work on my machine.
+# Some simple checks, and then ordinary check. These are only really
+# guaranteed to work on my machine.
maintainer-check: automake
$(PERL) -c -w automake
@if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
echo "can't use 'true' in GNU Makefile" 1>&2; \
exit 1; \
else :; fi
- @if test `fgrep '$${' $(srcdir)/[a-z]*.am | wc -l` -ne 0; then \
+ @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
echo "found too many uses of '\$${'" 1>&2; \
exit 1; \
fi
output. This is sometimes convenient when you want to write a
Makefile.am in more-or-less modular parts
-dejagnu support:
-* create site.exp based on known things: tool, srcdir, objdir,
- maybe host_alias, host_triplet, target_alias, target_triplet,
- build_triplet (depending on whether AC_CANONICAL_* is used)
-* use RUNTEST_FOR_TARGET in some cases?
-* defining RUNTEST, RUNTESTFLAGS should require dejagnu option
-
should be able to determine what is built by looking at rules (and
configure.in). Then built man pages (eg) could automatically be
omitted from the distribution.
If @LIBOBJS@ or @ALLOCA@ appears in _LDADD or _LIBADD, put it into
dependencies automatically
-Man pages can be generated
-
* ansi2knr.c needs STDC_HEADERS and HAVE_STRING_H
[ I've asked François about this. The change should probably
be in the fp_C_PROTOTYPES macro ]
Think about: maybe "make check" should just bomb if error occurs?
Then user must use "make -k check". This is probably more natural.
-Consider: should Gnits require jm_MAINTAINER_MODE?
-
Consider: "cvs" option adds some cvs-specific rules?
Consider adding an option that statically rewrites @MAINT@ to "#M#".
(this would be useful at Cygnus)
-
Automake and Cygnus: info target separate from all. Always make
install-info target. install-info separate from install.
Check to make sure various scripts are executable (IE when looking for
them in a directory)
-Think about ways to make automake fit better with Cygnus-style trees.
-
Use recode in dist target when MAINT_CHARSET specified. Read caveats
in automake.in before doing this. Note the same problem used to apply
to the no-dependencies option; maybe it still should? Note also that
* Should handle AC_CONFIG_SUBDIRS, ie must handle configure.in in subdirs
* Must handle SUBDIRS in subdir Makefile.am's
+dejagnu support:
+* use RUNTEST_FOR_TARGET in some cases?
+
These can both be handled via dist-hook:
. Consider supporting guile-style PLUGIN directories automatically?
. Consider allowing eg "foo/bar" to appear in EXTRA_DIST, and generating
document new variables introduced when AC_CANONICAL_* used
+document _LISP handling
+
================================================================
Libraries:
AC_SUBST(MAINT)dnl
]
)
+
+## ------------------------
+## Emacs LISP file handling
+## ------------------------
+AC_DEFUN(ud_PATH_LISPDIR,
+ [AC_PATH_PROG(EMACS, emacs, no)
+ if test $EMACS != "no"; then
+ AC_MSG_CHECKING([where .elc files should go])
+ dnl Set default value
+ lispdir="\$(datadir)/emacs/site-lisp"
+ if test "x$prefix" = "xNONE"; then
+ if test -d $ac_default_prefix/share/emacs/site-lisp; then
+ lispdir="\$(prefix)/share/emacs/site-lisp"
+ else
+ if test -d $ac_default_prefix/lib/emacs/site-lisp; then
+ lispdir="\$(prefix)/lib/emacs/site-lisp"
+ fi
+ fi
+ else
+ if test -d $prefix/share/emacs/site-lisp; then
+ lispdir="\$(prefix)/share/emacs/site-lisp"
+ else
+ if test -d $prefix/lib/emacs/site-lisp; then
+ lispdir="\$(prefix)/lib/emacs/site-lisp"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($lispdir)
+ ELCFILES="\$(ELCFILES)"
+ fi
+ AC_SUBST(lispdir)
+ AC_SUBST(ELCFILES)])
$seen_package = 0;
$seen_version = 0;
+# TRUE if we've seen ud_PATH_LISPDIR.
+$seen_lispdir = 0;
+
# Charsets used by maintainer and in distribution. MAINT_CHARSET is
# handled in a funny way: if seen in the top-level Makefile.am, it is
$contents{'OBJECTS'} = join (' ', @objects);
&handle_texinfo;
+ &handle_emacs_lisp;
&handle_man_pages;
&handle_data;
&handle_headers;
# Handle TESTS variable and other checks.
sub handle_tests
{
- if (&variable_defined ('DEJATOOL') && ! defined $options{'dejagnu'})
- {
- # Error.
- &am_line_error ('DEJATOOL',
- "\`DEJATOOL' defined but \`dejagnu' not in \`AUTOMAKE_OPTIONS'");
- return;
- }
-
if (defined $options{'dejagnu'})
{
push (@check, 'check-DEJAGNU');
$output_rules .= ("\t\@echo '## All variables above are generated by configure. Do Not Edit ##' >> site.exp\n"
. "\t-\@sed '1,/^## All variables above are.*##/ d' site.bak >> site.exp\n");
}
+ else
+ {
+ local ($c);
+ foreach $c ('DEJATOOL', 'RUNTEST', 'RUNTESTFLAGS')
+ {
+ if (&variable_defined ($c))
+ {
+ &am_line_error ($c, "\`$c' defined but \`dejagnu' not in \`AUTOMAKE_OPTIONS'");
+ }
+ }
+ }
if (&variable_defined ('TESTS'))
{
}
}
+# Handle Emacs Lisp.
+sub handle_emacs_lisp
+{
+ local (@elfiles) = &am_install_var ('lisp', 'LISP', 'lisp', 'noinst');
+
+ if (@elfiles)
+ {
+ # Found some lisp.
+ $output_vars .= "lispdir = \@lispdir\@\n";
+ $output_rules .= (".el.elc:\n"
+ . "\t\@echo 'WARNING: Warnings can be ignored. :-)'\n"
+ . "\t\$(SHELL) \$(srcdir)/elisp-comp \$<\n");
+ push (@suffixes, '.el', '.elc');
+
+ # Generate .elc files.
+ grep ($_ .= 'c', @elfiles);
+ &pretty_print ('ELCFILES =', '', @elfiles);
+
+ local ($varname);
+ if (&variable_defined ('lisp_LISP'))
+ {
+ $varname = 'lisp_LISP';
+ &am_error ("\`lisp_LISP' defined but \`ud_PATH_LISPDIR' not in \`configure.in'")
+ if ! $seen_lispdir;
+ }
+ else
+ {
+ $varname = 'noinst_LISP';
+ }
+ &require_file_with_line ($varname, $FOREIGN, 'elisp-comp');
+
+ }
+}
+
################################################################
# Scan configure.in for interesting things.
$seen_prog_install = 1 if ! $seen_prog_install && /AC_PROG_INSTALL/;
$seen_prog_install = 2 if /fp_PROG_INSTALL/;
+ $seen_lispdir = 1 if /ud_PATH_LISPDIR/;
+
if (/AC_PROG_LIBTOOL/ || /gm_PROG_LIBTOOL/)
{
$seen_libtool = 1;
' @sect=@SECTION@; \\
inst=`echo "@MANBASE@" | sed \'$(transform)\'`.@FULLSECT@; \\
echo installing @MAN@ as $(mandir)/man$$sect/$$inst; \\
+ if test -f $(srcdir)/@MAN@; then file=$(srcdir)/@MAN@; \\
+ else file=@MAN@; fi; \\
$(INSTALL_DATA) $(srcdir)/@MAN@ $(mandir)/man$$sect/$$inst
';
(
"aclocal.m4", "acconfig.h", "config.h.top",
"config.h.bot", "stamp-h.in", "ansi2knr.c",
- "ansi2knr.1", 'stamp-vti'
+ "ansi2knr.1", 'stamp-vti', 'elisp-comp'
);
$USAGE = "\
--- /dev/null
+#!/bin/sh
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# François Pinard <pinard@iro.umontreal.ca>, 1995.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This script byte-compiles all `.el' files which are part of its
+# arguments, using GNU Emacs, and put the resulting `.elc' files into
+# the current directory, so disregarding the original directories used
+# in `.el' arguments.
+#
+# This script manages in such a way that all Emacs LISP files to
+# be compiled are made visible between themselves, in the event
+# they require or load-library one another.
+
+if test $# = 0; then
+ echo 1>&2 "No files given to $0"
+else
+ tempdir=elc.$$
+ mkdir $tempdir
+ cp $* $tempdir
+ cd $tempdir
+
+ echo "(setq load-path (cons nil load-path))" > script
+ emacs -batch -l script -f batch-byte-compile *.el
+ mv *.elc ..
+
+ cd ..
+ rm -fr $tempdir
+fi
remake.am scripts.am subdirs.am tags.am tags-subd.am tags-clean.am \
texi-version.am texinfos-vars.am texinfos.am libraries-clean.am \
programs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \
-ansi2knr.1 aclocal.m4
+ansi2knr.1 aclocal.m4 lisp.am
## These must all be executable when installed.
-pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
+pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh \
+mkinstalldirs elisp-comp
CLEANFILES = automake
$(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
$(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
-# Some simple checks:
-# * syntax check with perl4 and perl5.
-# * make sure the scripts don't use 'true'
-# * expect no instances of '${...}'
-# These are only really guaranteed to work on my machine.
+# Some simple checks, and then ordinary check. These are only really
+# guaranteed to work on my machine.
maintainer-check: automake
-## Do syntax, etc, checks before make check.
+## Syntax check with default Perl (on my machine, Perl 5).
$(PERL) -c -w automake
+## Ensure `true' is never used; I've accidentally used it before.
@if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
echo "can't use 'true' in GNU Makefile" 1>&2; \
exit 1; \
else :; fi
- @if test `fgrep '$${' $(srcdir)/[a-z]*.am | wc -l` -ne 0; then \
+## expect no instances of '${...}'. However, $${...} is ok, since that
+## is a shell construct, not a Makefile construct.
+ @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
echo "found too many uses of '\$${'" 1>&2; \
exit 1; \
fi
+## Another syntax check, this time with Perl 4, if it exists.
if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \
perl4.036 -c -w automake; \
else :; fi
--- /dev/null
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1996 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+install-@DIR@LISP: $(@DIR@_LISP) $(ELCFILES)
+ $(mkinstalldirs) $(@DIR@dir)
+## Funny invocation because Makefile variable can be empty, leading to
+## a syntax error in sh.
+ list="$(@DIR@_LISP)"; for p in $$list; do \
+ $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \
+## Only install .elc file if it exists.
+ if test -f $${p}c; then
+ $(INSTALL_DATA) $${p}c $(@DIR@dir)/$${p}c; \
+ else : ; fi; \
+ done
+
+uninstall-@DIR@LISP:
+ list="$(@DIR@_LISP)"; for p in $$list; do \
+ rm -f $(@DIR@dir)/$$p $(@DIR@dir)/$${p}c; \
+ done
--- /dev/null
+#!/bin/sh
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# François Pinard <pinard@iro.umontreal.ca>, 1995.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This script byte-compiles all `.el' files which are part of its
+# arguments, using GNU Emacs, and put the resulting `.elc' files into
+# the current directory, so disregarding the original directories used
+# in `.el' arguments.
+#
+# This script manages in such a way that all Emacs LISP files to
+# be compiled are made visible between themselves, in the event
+# they require or load-library one another.
+
+if test $# = 0; then
+ echo 1>&2 "No files given to $0"
+else
+ tempdir=elc.$$
+ mkdir $tempdir
+ cp $* $tempdir
+ cd $tempdir
+
+ echo "(setq load-path (cons nil load-path))" > script
+ emacs -batch -l script -f batch-byte-compile *.el
+ mv *.elc ..
+
+ cd ..
+ rm -fr $tempdir
+fi
--- /dev/null
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1996 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+install-@DIR@LISP: $(@DIR@_LISP) $(ELCFILES)
+ $(mkinstalldirs) $(@DIR@dir)
+## Funny invocation because Makefile variable can be empty, leading to
+## a syntax error in sh.
+ list="$(@DIR@_LISP)"; for p in $$list; do \
+ $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \
+## Only install .elc file if it exists.
+ if test -f $${p}c; then
+ $(INSTALL_DATA) $${p}c $(@DIR@dir)/$${p}c; \
+ else : ; fi; \
+ done
+
+uninstall-@DIR@LISP:
+ list="$(@DIR@_LISP)"; for p in $$list; do \
+ rm -f $(@DIR@dir)/$$p $(@DIR@dir)/$${p}c; \
+ done