2002-10-10 Alexandre Duret-Lutz <adl@gnu.org>
+ For PR automake/369:
+ * lib/am/python.am: Lookup python files in build directory or
+ source directory.
+ From Mathias Doreille.
+ * tests/python3.test: New file.
+ * tests/Makefile.am (TESTS): Add python3.test.
+ * tests/defs: Handle `required=python'.
+
For PR automake/358:
* lib/am/texi-vers.am (%STAMPVTI%): Depend on configure instead of
configure.ac.
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
@list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\
- if test -f $(srcdir)/$$p; then \
+## A file can be in the source directory or the build directory.
+ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
+ if test -f $$b$$p; then \
## Compute basename of source file. Unless this is a nobase_ target, we
-## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo',
-## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'.
+## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.py',
+## not '$(DESTDIR)$(%NDIR%dir)/python/foo.py'.
?BASE? d=`echo "$$p" | sed -e 's,^.*/,,'`; \
?!BASE? d="$$p"; \
dlist="$$dlist $$d"; \
## Don't perform translation, since script name is important.
- echo " $(%DIR%PYTHON_INSTALL) $(srcdir)/$$p $(DESTDIR)$(%NDIR%dir)/$$d"; \
- $(%DIR%PYTHON_INSTALL) $(srcdir)/$$p $(DESTDIR)$(%NDIR%dir)/$$d; \
+ echo " $(%DIR%PYTHON_INSTALL) $$b$$p $(DESTDIR)$(%NDIR%dir)/$$d"; \
+ $(%DIR%PYTHON_INSTALL) $$b$$p $(DESTDIR)$(%NDIR%dir)/$$d; \
else :; fi; \
done; \
## Byte-compile must be done at install time, since file times are
proginst.test \
python.test \
python2.test \
+python3.test \
ranlib.test \
recurs.test \
recurs2.test \
proginst.test \
python.test \
python2.test \
+python3.test \
ranlib.test \
recurs.test \
recurs2.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure we install built python files.
+
+required=python
+. ./defs || exit 1
+
+set -e
+
+cat >>configure.in <<EOF
+AM_PATH_PYTHON
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'END'
+mydir=$(prefix)/my
+my_PYTHON = one.py
+
+one.py:
+ echo 'def one(): return 1' >$@
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+mkdir inst
+inst=`pwd`/inst
+mkdir build
+cd build
+../configure --prefix="$inst"
+$MAKE install
+test -f $inst/my/one.py
+test -f $inst/my/one.pyc
+test -f $inst/my/one.pyo