First cut at Python support (untested).
A few miscellaneous bug fixes.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
+necessary. Hereny it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Section\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\ No newline at end of file
+1999-11-22 Tom Tromey <tromey@cygnus.com>
+
+ * automake.in (handle_single_transform_list): Generate explicit
+ rule for subdir objects. Fixes new addition to subobj.test.
+
+ * automake.in (handle_lib_objects_cond): Allow LIBOBJS to be
+ defined by AC_SUBST. Fixes ltlibobjs.test.
+
+ Fix for sourcesub.test:
+ * automake.in (handle_single_transform_list): Added `var'
+ argument. If config sub found, give error.
+ (handle_source_transform): Updated for new
+ handle_source_transform.
+
+ * py-compile: New file.
+ * m4/Makefile.am (m4data_DATA): Added python.m4.
+ * m4/python.m4: New file.
+ * automake.texi (Uniform): Mention PYTHON.
+ (Python): New node.
+ * Makefile.am (amfiles): Added python.am, python-clean.am.
+ (dist_script_DATA): Added py-compile.
+ * python.am: New file.
+ * python-clean.am: New file.
+ * automake.in (seen_pythondir): New global.
+ (generate_makefile): Call handle_python.
+ (handle_python): New function.
+ (scan_one_configure_file): Set seen_pythondir if AM_PATH_PYTHON
+ seen.
+ (am_install_var): Special-case PYTHON like JAVA.
+ (scan_configure): Check for py-compile.
+ (initialize_global_constants): Added py-compile to @common_files.
+
+ * ltlib.am (install-@DIR@LTLIBRARIES): Added missing space.
+
1999-11-21 Tom Tromey <tromey@cygnus.com>
* automake.in (finish_languages): Only generate suffix rule when
dist-vars.am footer.am header-vars.am header.am java-clean.am java.am \
kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am \
lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am \
-multilib.am program.am progs-clean.am progs.am remake-hdr.am remake.am \
-scripts.am subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
+multilib.am program.am progs-clean.am progs.am python.am \
+python-clean.am remake-hdr.am remake.am scripts.am subdirs.am \
+tags-clean.am tags.am texi-vers.am texinfos.am
dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
$(amfiles)
## what we want. So we make them executable by hand.
scriptdir = $(pkgdatadir)
dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
-mkinstalldirs elisp-comp ylwrap acinstall depcomp compile
+mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile
install-data-hook:
@$(POST_INSTALL)
dist-vars.am footer.am header-vars.am header.am java-clean.am java.am \
kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am \
lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am \
-multilib.am program.am progs-clean.am progs.am remake-hdr.am remake.am \
-scripts.am subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
+multilib.am program.am progs-clean.am progs.am python.am \
+python-clean.am remake-hdr.am remake.am scripts.am subdirs.am \
+tags-clean.am tags.am texi-vers.am texinfos.am
dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
scriptdir = $(pkgdatadir)
dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
-mkinstalldirs elisp-comp ylwrap acinstall depcomp compile
+mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile
TAGS_FILES = automake.in aclocal.in $(amfiles)
DIST_COMMON = README $(dist_pkgdata_DATA) $(dist_script_DATA) AUTHORS \
COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS README-alpha \
THANKS TODO aclocal.in aclocal.m4 ansi2knr.1 ansi2knr.c automake.in \
-compile config.guess config.sub configure configure.in elisp-comp \
-install-sh mdate-sh missing mkinstalldirs stamp-vti texinfo.tex \
-version.texi ylwrap
+compile config.guess config.sub configure configure.in depcomp \
+elisp-comp install-sh mdate-sh missing mkinstalldirs stamp-vti \
+texinfo.tex version.texi ylwrap
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
- $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
dist-all: distdir
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
- $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
distdir: $(DISTFILES)
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \
fi
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
mkdir $(distdir)
- here=`cd $(top_builddir) && pwd`; \
- top_distdir=`cd $(distdir) && pwd`; \
- distdir=`cd $(distdir) && pwd`; \
- cd $(top_srcdir) \
- && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
* Document why putting @FOO@ in _SOURCES doesn't work.
- Make it an error when the user tries to do this
This must be done for 1.5
* if automake -a, and dangling links exist, automake should
# TRUE if we've seen AM_PATH_LISPDIR.
$seen_lispdir = 0;
+# TRUE if we've seen AM_CHECK_PYTHON.
+$seen_pythondir = 0;
+
# TRUE if we've seen AC_EXEEXT.
$seen_exeext = 0;
&handle_multilib;
&handle_texinfo;
&handle_emacs_lisp;
+ &handle_python;
&handle_java;
&handle_man_pages;
&handle_data;
# remaining elements are names of objects
sub handle_single_transform_list
{
- local ($derived, $obj, @files) = @_;
+ local ($var, $derived, $obj, @files) = @_;
local (@result) = ();
local ($nonansi_obj) = $obj;
$nonansi_obj =~ s/_//g;
# Turn sources into objects.
foreach (@files)
{
- # Skip things that look like configure substitutions.
- next if /^\@.*\@$/;
+ # Configure substitutions in _SOURCES variables are errors.
+ if (/^\@.*\@$/)
+ {
+ &am_line_error ($var, "$var includes configure substitution \`$_'");
+ next;
+ }
# If the source file is in a subdirectory then the `.o' is
# put into the current directory.
}
# If doing dependency tracking, then we can't print
- # the rule.
- if ($use_dependencies
- && $rule ne ''
- && $language_map{$lang . '-autodep'} ne 'no')
+ # the rule. Also, if we have a subdir object, we need
+ # to generate an explicit rule.
+ if (($use_dependencies
+ && $rule ne ''
+ && $language_map{$lang . '-autodep'} ne 'no')
+ || ($r == $LANG_SUBDIR && $directory ne ''))
{
$rule = '';
local ($obj_sans_ext) = substr ($object, 0,
{
@files = &variable_value_as_list ($var, $cond);
($temp, @result) =
- &handle_single_transform_list ($one_file, $obj,
+ &handle_single_transform_list ($var, $one_file, $obj,
@files);
$linker = $temp if $linker eq '';
# Avoid defining needless variables.
next if (scalar @files == 0);
- ($temp, @result) = &handle_single_transform_list ($one_file, $obj,
- @files);
+ ($temp, @result) = &handle_single_transform_list ($var, $one_file,
+ $obj, @files);
$linker = $temp if $linker eq '';
&define_pretty_variable ($xpfx . $one_file . "_OBJECTS", '', @result)
unless $prefix =~ /EXTRA_/;
push (@objects, $unxformed . $obj);
push (@files, $unxformed . '.c');
- ($temp, @result) = &handle_single_transform_list ($one_file, $obj,
+ ($temp, @result) = &handle_single_transform_list ($one_file . '_SOURCES',
+ $one_file, $obj,
@files);
$linker = $temp if $linker eq '';
&define_pretty_variable ($one_file . "_OBJECTS", '', @result)
push (@dep_list, $lsearch);
$seen_libobjs = 1;
- if (! keys %libsources)
+ if (! keys %libsources
+ && ! &variable_defined ($1 . 'LIBOBJS'))
{
&am_line_error ($var, "\@$1" . "LIBOBJS\@ seen but never set in \`configure.in'");
}
}
}
+# Handle Python
+sub handle_python
+{
+ local (@pyfiles) = &am_install_var ('-defaultdist', 'python', 'PYTHON',
+ 'python', 'noinst');
+ return if ! @pyfiles;
+
+ # Found some python.
+ &define_configure_variable ('pythondir');
+ &define_configure_variable ('PYTHON');
+
+ $output_rules .= &file_contents ('python-clean');
+ push (@clean, 'python');
+
+ &am_error ("\`python_PYTHON' defined but \`AM_CHECK_PYTHON' not in \`configure.in'")
+ 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');
+ }
+}
+
# Handle Java.
sub handle_java
{
$seen_prog_install = 1 if /AC_PROG_INSTALL/;
$seen_lispdir = 1 if /AM_PATH_LISPDIR/;
+ $seen_pythondir = 1 if /AM_PATH_PYTHON/;
if (/A(C|M)_PROG_LIBTOOL/)
{
}
&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_pythondir;
}
################################################################
"libversion.in", "mdate-sh", "mkinstalldirs", "install-sh",
'texinfo.tex', "ansi2knr.c", "ansi2knr.1", 'elisp-comp',
'ylwrap', 'acinclude.m4', @libtoolize_files,
- 'missing', 'depcomp', 'compile'
+ 'missing', 'depcomp', 'compile', 'py-compile'
);
# Commonly used files we auto-include, but only sometimes.
# Now that configure substitutions are allowed in where_HOW
# variables, it is an error to actually define the primary. We
# allow `JAVA', as it is customarily used to mean the Java
- # interpreter. This is but one of several Java hacks.
+ # interpreter. This is but one of several Java hacks. Similarly,
+ # `PYTHON' is customarily used to mean the Python interpreter.
&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
}
# The JAVA variable is used as the name of the Java interpreter.
- if (@used && $primary ne 'JAVA')
+ # The PYTHON variable is used as the name of the Python interpreter.
+ if (@used && $primary ne 'JAVA' && $primary ne 'PYTHON')
{
# Define it.
&define_pretty_variable ($primary, '', @used);
# 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';
# Make the result unique. This lets the user use conditionals in
# a natural way, but still lets us program lazily -- we don't have
should not be built until the @code{make check} command is run.
Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES},
-@samp{LISP}, @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS},
-and @samp{TEXINFOS}.
+@samp{LISP}, @samp{PYTHON}, @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS},
+@samp{MANS}, and @samp{TEXINFOS}.
@vindex PROGRAMS
@vindex LIBRARIES
@vindex LISP
+@vindex PYTHON
@vindex SCRIPTS
@vindex DATA
@vindex HEADERS
* Guile:: Guile
* Libtool:: Libtool
* Java:: Java
+* Python:: Python
@end menu
@xref{A Shared Library}.
-@node Java, , Libtool, Other GNU Tools
+@node Java, Python, Libtool, Other GNU Tools
@section Java
@cindex _JAVA primary, defined
@file{.class} files were generated from which @file{.java} files -- so
it would be impossible to know which files to install where.
+@node Python, , Java, Other GNU Tools
+@section Python
+
+@cindex _PYTHON primary, defined
+@cindex PYTHON primary, defined
+@cindex Primary variable, PYTHON
+
+
+Automake provides support for Python modules. Automake will turn on
+Python support if the @code{AM_CHECK_PYTHON} macro is used in
+@file{configure.in}. The @samp{PYTHON} primary is used to hold a list
+of @file{.py} files. Possible prefixes for this primary are
+@samp{python_} and @samp{noinst_}. Note that if @code{python_PYTHON} is
+defined, then @file{configure.in} must run @code{AM_CHECK_PYTHON}.
+
+@code{AM_CHECK_PYTHON} takes a single argument --- either the word
+@samp{module} or @samp{package}. The first installs files directly into
+the @file{site-packages} directory and is used when the @file{.py[co]}
+files must be on the @code{PYTHONPATH}. The second is used for modules
+distributed as a package, which should be installed in a subdirectory
+of @file{site-packages} and contain the @file{__init__.py} file. The
+subdirectory name is the same as the name given by @samp{PACKAGE}.
+
+
+@code{AM_CHECK_PYTHON} creates several output variables based on the
+Python installation found during configuration.
+
+@table @samp
+@item PYTHON
+The name of the Python executable.
+
+@item PYTHON_VERSION
+The Python version number, in the form @var{major}.@var{minor}
+(e.g. @samp{1.5}). This is currently the value of
+@code{sys.version[:3]}.
+
+@item PYTHON_PREFIX
+The string @code{$prefix}. This term may be used in future work
+which needs the contents of Python's @code{sys.prefix}, but general
+consensus is to always use the value from configure.
+
+@item PYTHON_EXEC_PREFIX
+The string @code{$exec_prefix}. This term may be used in future work
+which needs the contents of Python's @code{sys.exec_prefix}, but general
+consensus is to always use the value from configure.
+
+@item PYTHON_PLATFORM
+The canonical name used by Python to describe the operating system, as
+given by @code{sys.platform}. This value is sometimes needed when
+building Python extensions.
+
+@item pythondir
+The directory name for the top of the standard Python library.
+
+@item PYTHON_SITE
+The location of the platform-independent @file{site-packages} directory,
+where `module' files are installed. Note that older versions of Python
+(pre-1.5) used @file{$prefix/lib/site-python} so future versions of
+Automake's Python support may provide backwards compatibility.
+
+@item PYTHON_SITE_PACKAGE
+The string @code{$PYTHON_SITE/$PACKAGE}. This is the default
+installation directory for a Python `package.'
+
+@item PYTHON_SITE_INSTALL
+The top-level directory in which the Python files will be installed. It
+will be the value of either @samp{PYTHON_SITE} or @samp{PYTHON_PACKAGE}
+depending on the argument given to @code{AM_CHECK_PYTHON}.
+
+@item PYTHON_SITE_EXEC
+The location of the platform-dependent @file{site-packages} directory,
+where shared library extensions should be placed. Note that older
+versions of Python (pre-1.5) used @file{sharedmodules} so future version
+of Automake's Python support may provide backwards compatibility.
+
+@end table
+
+@vindex PYCFILES
+@vindex PYOFILES
+
+By default Automake will byte-compile all Python source files to both
+@file{.pyc} and @file{.pyo} forms. If you wish to avoid generating the
+optimized byte-code files, simply define the variable @code{PYOFILES} to
+be empty. Similarly, if you don't wish to generate the standard
+byte-compiled files, define the variable @code{PYCFILES} to be empty.
+
@node Documentation, Install, Other GNU Tools, Top
@chapter Building documentation
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
+necessary. Hereny it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Section\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\ No newline at end of file
dist-vars.am footer.am header-vars.am header.am java-clean.am java.am \
kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am \
lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am \
-multilib.am program.am progs-clean.am progs.am remake-hdr.am remake.am \
-scripts.am subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
+multilib.am program.am progs-clean.am progs.am python.am \
+python-clean.am remake-hdr.am remake.am scripts.am subdirs.am \
+tags-clean.am tags.am texi-vers.am texinfos.am
dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
$(amfiles)
## what we want. So we make them executable by hand.
scriptdir = $(pkgdatadir)
dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
-mkinstalldirs elisp-comp ylwrap acinstall depcomp compile
+mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile
install-data-hook:
@$(POST_INSTALL)
## if the program doesn't have a name that libtool expects.
## Use INSTALL and not INSTALL_DATA because libtool knows the right
## permissions to use.
- echo "@LIBTOOL --mode=install@ $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$p"; \
+ echo " @LIBTOOL --mode=install@ $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$p"; \
@LIBTOOL --mode=install@ $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$p; \
else :; fi; \
done
--- /dev/null
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1999 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@PYTHON: $(@DIR@_PYTHON)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(@DIR@dir)
+ @list='$(@DIR@_PYTHON)'; for p in $$list; do\
+ if test -f $(srcdir)/$$p; then \
+## Don't perform translation, since script name is important.
+ echo " $(INSTALL_PROGRAM) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/$$p"; \
+ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/$$p; \
+ else :; fi; \
+ done
+## Byte-compile must be done at install time, since file times are
+## encoded in the actual files.
+ @PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(@DIR@dir) $(@DIR@_PYTHON)
+
+uninstall-@DIR@PYTHON:
+ @$(NORMAL_UNINSTALL)
+ list='$(@DIR@_PYTHON)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(@DIR@dir)/$$p; \
+## This is to remove the .pyc and .pyo byte compiled versions (a bit
+## of a hack).
+ rm -f $(DESTDIR)$(@DIR@dir)/$${p}c; \
+ rm -f $(DESTDIR)$(@DIR@dir)/$${p}o; \
+ done
--- /dev/null
+#!/bin/sh
+# called as "py-compile [--basedir DIR] PY_FILES ...
+
+if [ -z "$PYTHON" ]; then
+ PYTHON=python
+fi
+
+basedir=
+
+case "$1" in
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ --help)
+ echo "Usage: py-compile [--basedir DIR] PY_FILES ..."
+ echo "Byte compile some python scripts. This should be performed"
+ echo "after they have been moved to the final installation location"
+ exit 0
+ ;;
+ --version)
+ echo "py-compile version 0.0"
+ exit 0
+ ;;
+esac
+
+if [ $# = 0 ]; then
+ echo "No files given to $0" 1>&2
+ exit 1
+fi
+
+# if basedir was given, then it should be prepended to filenames before
+# byte compilation.
+if [ -z "$basedir" ]; then
+ trans="path = file"
+else
+ trans="path = os.path.join('$basedir', file)"
+fi
+
+$PYTHON -c "
+import sys, os, string, py_compile
+
+files = '''$*'''
+print 'Byte-compiling python modules...'
+for file in string.split(files):
+ $trans
+ if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(path)
+print" || exit $?
+
+# this will fail for python < 1.5, but that doesn't matter ...
+$PYTHON -O -c "
+import sys, os, string, py_compile
+
+files = '''$*'''
+print 'Byte-compiling python modules (optimised versions) ...'
+for file in string.split(files):
+ $trans
+ if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(path)
+print" 2>/dev/null || :
+
## if the program doesn't have a name that libtool expects.
## Use INSTALL and not INSTALL_DATA because libtool knows the right
## permissions to use.
- echo "@LIBTOOL --mode=install@ $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$p"; \
+ echo " @LIBTOOL --mode=install@ $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$p"; \
@LIBTOOL --mode=install@ $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(@NDIR@dir)/$$p; \
else :; fi; \
done
m4datadir = $(datadir)/aclocal
m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
-minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 \
-sanity.m4 strtod.m4 termios.m4 winsz.m4
+minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \
+python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
EXTRA_DIST = $(m4data_DATA)
m4datadir = $(datadir)/aclocal
m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 \
-minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 \
-sanity.m4 strtod.m4 termios.m4 winsz.m4
+minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 \
+python.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
EXTRA_DIST = $(m4data_DATA)
--- /dev/null
+## ------------------------
+## Python file handling
+## From Andrew Dalke
+## ------------------------
+
+dnl AM_PATH_PYTHON([package, module])
+dnl
+
+dnl Adds support for distributing Python modules or the special form
+dnl of a module called a `package.' Modules of the first type are
+dnl files ending in `.py' with no '__init__.py' file. This must be
+dnl placed on the PYTHONPATH, and the default location is PYTHON_SITE,
+dnl or $(prefix)/lib/python$(PYTHON_VERSION)/site-package
+dnl
+dnl A package module is contained in its own directory. This directory
+dnl is named PACKAGE, which was the name given to automake. The full
+dnl directory path is PYTHON_SITE_PACKAGE or
+dnl $(prefix)/lib/python$(PYTHON_VERSION)/site-package/$(PACKAGE)
+dnl where site-package is on the PYTHONPATH. The `__init__.py' file is
+dnl located in the directory, along with any other submodules which may
+dnl be necessary.
+
+
+AC_DEFUN(AM_PATH_PYTHON,
+ [
+ dnl Find a version of Python. I could check for python versions 1.4
+ dnl or earlier, but the default installation locations changed from
+ dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
+ dnl in 1.5, and I don't want to maintain that logic.
+
+ AC_PATH_PROG(PYTHON, python python1.5)
+
+ AC_MSG_CHECKING([local Python configuration])
+
+ dnl Query Python for its version number. Getting [:3] seems to be
+ dnl the best way to do this; it's what "site.py" does in the standard
+ dnl library. Need to change quote character because of [:3]
+
+ AC_SUBST(PYTHON_VERSION)
+ changequote(<<, >>)dnl
+ PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
+ changequote([, ])dnl
+
+
+ dnl Use the values of $prefix and $exec_prefix for the corresponding
+ dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
+ dnl distinct variables so they can be overridden if need be. However,
+ dnl general consensus is that you shouldn't need this ability.
+
+ AC_SUBST(PYTHON_PREFIX)
+ PYTHON_PREFIX='${prefix}'
+
+ AC_SUBST(PYTHON_EXEC_PREFIX)
+ PYTHON_EXEC_PREFIX='${exec_prefix}'
+
+ dnl At times (like when building shared libraries) you may want
+ dnl to know which OS platform Python thinks this is.
+
+ AC_SUBST(PYTHON_PLATFORM)
+ PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"`
+
+
+ dnl Set up 4 directories:
+
+ dnl pythondir -- location of the standard python libraries
+ dnl Also lets automake think PYTHON means something.
+
+ AC_SUBST(pythondir)
+ pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION
+
+ dnl PYTHON_SITE -- the platform independent site-packages directory
+
+ AC_SUBST(PYTHON_SITE)
+ PYTHON_SITE=$pythondir/site-packages
+
+ dnl PYTHON_SITE_PACKAGE -- the $PACKAGE directory under PYTHON_SITE
+
+ AC_SUBST(PYTHON_SITE_PACKAGE)
+ PYTHON_SITE_PACKAGE=$pythondir/site-packages/$PACKAGE
+
+ dnl PYTHON_SITE_EXEC -- platform dependent site-packages dir (eg, for
+ dnl shared libraries)
+
+ AC_SUBST(PYTHON_SITE_EXEC)
+ PYTHON_SITE_EXEC=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages
+
+
+ dnl Configure PYTHON_SITE_INSTALL so it points to either the module
+ dnl directory or the package subdirectory, depending on the $1
+ dnl parameter ("module" or "package").
+
+ AC_SUBST(PYTHON_SITE_INSTALL)
+ ifelse($1, module, [PYTHON_SITE_INSTALL=$PYTHON_SITE],
+ $1, package, [PYTHON_SITE_INSTALL=$PYTHON_SITE_PACKAGE],
+ [errprint([Unknown option `$1' used in call to AM_PATH_PYTHON.
+Valid options are `module' or `package'
+])m4exit(4)])
+
+
+ dnl All done.
+
+ AC_MSG_RESULT(looks good)
+])
--- /dev/null
+#!/bin/sh
+# called as "py-compile [--basedir DIR] PY_FILES ...
+
+if [ -z "$PYTHON" ]; then
+ PYTHON=python
+fi
+
+basedir=
+
+case "$1" in
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ --help)
+ echo "Usage: py-compile [--basedir DIR] PY_FILES ..."
+ echo "Byte compile some python scripts. This should be performed"
+ echo "after they have been moved to the final installation location"
+ exit 0
+ ;;
+ --version)
+ echo "py-compile version 0.0"
+ exit 0
+ ;;
+esac
+
+if [ $# = 0 ]; then
+ echo "No files given to $0" 1>&2
+ exit 1
+fi
+
+# if basedir was given, then it should be prepended to filenames before
+# byte compilation.
+if [ -z "$basedir" ]; then
+ trans="path = file"
+else
+ trans="path = os.path.join('$basedir', file)"
+fi
+
+$PYTHON -c "
+import sys, os, string, py_compile
+
+files = '''$*'''
+print 'Byte-compiling python modules...'
+for file in string.split(files):
+ $trans
+ if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(path)
+print" || exit $?
+
+# this will fail for python < 1.5, but that doesn't matter ...
+$PYTHON -O -c "
+import sys, os, string, py_compile
+
+files = '''$*'''
+print 'Byte-compiling python modules (optimised versions) ...'
+for file in string.split(files):
+ $trans
+ if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'):
+ continue
+ print file,
+ sys.stdout.flush()
+ py_compile.compile(path)
+print" 2>/dev/null || :
+
--- /dev/null
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1999 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.
+mostlyclean-python:
+
+clean-python:
+ -test -z "$(PYCFILES)" || rm -f $(PYCFILES)
+ -test -z "$(PYOFILES)" || rm -f $(PYOFILES)
+
+distclean-python:
+
+maintainer-clean-python:
--- /dev/null
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1999 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@PYTHON: $(@DIR@_PYTHON)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(@DIR@dir)
+ @list='$(@DIR@_PYTHON)'; for p in $$list; do\
+ if test -f $(srcdir)/$$p; then \
+## Don't perform translation, since script name is important.
+ echo " $(INSTALL_PROGRAM) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/$$p"; \
+ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/$$p; \
+ else :; fi; \
+ done
+## Byte-compile must be done at install time, since file times are
+## encoded in the actual files.
+ @PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(@DIR@dir) $(@DIR@_PYTHON)
+
+uninstall-@DIR@PYTHON:
+ @$(NORMAL_UNINSTALL)
+ list='$(@DIR@_PYTHON)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(@DIR@dir)/$$p; \
+## This is to remove the .pyc and .pyo byte compiled versions (a bit
+## of a hack).
+ rm -f $(DESTDIR)$(@DIR@dir)/$${p}c; \
+ rm -f $(DESTDIR)$(@DIR@dir)/$${p}o; \
+ done
-@set UPDATED 19 November 1999
+@set UPDATED 21 November 1999
@set EDITION 1.4a
@set VERSION 1.4a
-@set UPDATED 19 November 1999
+@set UPDATED 21 November 1999
@set EDITION 1.4a
@set VERSION 1.4a