]> sourceware.org Git - automake.git/commitdiff
For PR automake/369:
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 10 Oct 2002 18:22:05 +0000 (18:22 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 10 Oct 2002 18:22:05 +0000 (18:22 +0000)
* 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'.

ChangeLog
lib/am/python.am
tests/Makefile.am
tests/Makefile.in
tests/python3.test [new file with mode: 0755]

index 3687abbe0bbac2f1010cd5902ee38e90d7755897..dbb3d8abc26c388dbf416653208d16bf78f7f06b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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.
index ddf6974e1c69fd1e8d53a23553d0c7ca7faa364f..24f51d13e443e1135690f2a70a8b72d9d84acf86 100644 (file)
@@ -31,16 +31,18 @@ install-%DIR%PYTHON: $(%DIR%_PYTHON)
        @$(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
index 75cfa6715c1087ea473b6c05bf5ec654c0ba9cc6..0b460a5351cc0815f198476133aaa7663d17bb72 100644 (file)
@@ -317,6 +317,7 @@ primary2.test \
 proginst.test \
 python.test \
 python2.test \
+python3.test \
 ranlib.test \
 recurs.test \
 recurs2.test \
index e3c0fdbb38a803438029b142f245ba0f0394516f..624ea0ffb81218d0ffeabef366208b358a70b993 100644 (file)
@@ -409,6 +409,7 @@ primary2.test \
 proginst.test \
 python.test \
 python2.test \
+python3.test \
 ranlib.test \
 recurs.test \
 recurs2.test \
diff --git a/tests/python3.test b/tests/python3.test
new file mode 100755 (executable)
index 0000000..a406522
--- /dev/null
@@ -0,0 +1,53 @@
+#! /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
This page took 0.039641 seconds and 5 git commands to generate.