automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: PR/369: built python files not installed


From: Alexandre Duret-Lutz
Subject: FYI: PR/369: built python files not installed
Date: 10 Oct 2002 20:21:46 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

I'm installing this on HEAD and branch-1-7.

2002-10-10  Alexandre Duret-Lutz  <address@hidden>

        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'.

Index: lib/am/python.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/python.am,v
retrieving revision 1.15
diff -u -r1.15 python.am
--- lib/am/python.am    8 Jul 2002 19:41:23 -0000       1.15
+++ lib/am/python.am    10 Oct 2002 18:15:43 -0000
@@ -31,16 +31,18 @@
        @$(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: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.448
diff -u -r1.448 Makefile.am
--- tests/Makefile.am   10 Oct 2002 17:37:38 -0000      1.448
+++ tests/Makefile.am   10 Oct 2002 18:15:43 -0000
@@ -317,6 +317,7 @@
 proginst.test \
 python.test \
 python2.test \
+python3.test \
 ranlib.test \
 recurs.test \
 recurs2.test \
Index: tests/python3.test
===================================================================
RCS file: tests/python3.test
diff -N tests/python3.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/python3.test  10 Oct 2002 18:15:45 -0000
@@ -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

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]