Re: [PATCH] Shorter object file names under subdir-objects

Mathieu Lirzin <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <[email protected]>
Mathieu Lirzin <[email protected]> writes:

> See attached patch for more details.  It adds a test which passes on
> current 'minor' branch but fails when applied on top of your patch.  The
> intent is to allow you to reproduce the issue.

Here is the missing attachment:


-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37
0001-Test-that-should-pass.patch (text/x-diff, 2.3 KB)
From 970d46d60e65e4c64e7ba6d4f0afa38c6f8620fe Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <[email protected]>
Date: Thu, 13 Apr 2017 14:19:15 +0200
Subject: [PATCH] Test that should pass.

---
 t/list-of-tests.mk        |  1 +
 t/subobj-objname-clash.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 t/subobj-objname-clash.sh

diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 1e9f86f48..1a8302805 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1063,6 +1063,7 @@ t/subobjname.sh \
 t/subobj-clean-pr10697.sh \
 t/subobj-clean-lt-pr10697.sh \
 t/subobj-indir-pr13928.sh \
+t/subobj-objname-clash.sh \
 t/subobj-vpath-pr13928.sh \
 t/subobj-pr13928-more-langs.sh \
 t/subpkg.sh \
diff --git a/t/subobj-objname-clash.sh b/t/subobj-objname-clash.sh
new file mode 100644
index 000000000..e747037f0
--- /dev/null
+++ b/t/subobj-objname-clash.sh
@@ -0,0 +1,58 @@
+#! /bin/sh
+# Copyright (C) 1996-2017 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, see <http://www.gnu.org/licenses/>.
+
+# Make sure that object names don't clash when using subdir-objects.
+
+. test-init.sh
+
+mkdir -p src
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects foreign
+noinst_PROGRAMS = foo
+foo_SOURCES = src/foo.c
+foo_CPPFLAGS = -DVAL=0
+include src/local.mk
+END
+
+cat > src/local.mk << 'END'
+noinst_PROGRAMS += src/foo
+src_foo_CPPFLAGS = -DVAL=1
+src_foo_SOURCES = src/foo.c
+END
+
+cat > src/foo.c << 'END'
+int
+main ()
+{
+  return VAL;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+./foo || fail_ "./foo should return 0"
+./src/foo && fail_ "./src/foo should return 1"
+$MAKE clean
-- 
2.11.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.