libtool-patches
[Top][All Lists]
Advanced

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

Re: detect identical deplibs


From: Ralf Wildenhues
Subject: Re: detect identical deplibs
Date: Fri, 30 Sep 2005 17:03:54 +0200
User-agent: Mutt/1.5.11

Hi Peter,

[ If this requires more discussion, I guess we should stop spamming Jeff
and Brian more. ]

* Peter O'Gorman wrote on Fri, Sep 30, 2005 at 04:28:27PM CEST:
> Ralf Wildenhues wrote:
> |
> | The patch below does not change libtool behavior but adds a test
> | exposing the issue.  Fixing the actual failure may be a bit hairy, and
> | I'm not sure we should fix the `-Lsub -la' case, so I'm not going for it
> | right away.
> |
> | OK to apply?
> 
> I thought we'd agreed to avoid having to use autotools if possible in
> the new test suite. I don't see a requirement in these tests for
> automake/autoconf...

Good point.  It even makes the test source smaller, and much faster.  :)
Here's a new version (also removed the duplicate identical references).
OK to apply?

Cheers,
Ralf

        * tests/deplibs-ident.at: New file with XFAIL test to expose
        wrong multiple listing of a deplib on the command line.
        * Makefile.am, tests/testsuite.at: Updated.
        Reported by Brian Barrett <address@hidden>.

--- /dev/null   2005-08-03 12:45:51.659987528 +0200
+++ tests/deplibs-ident.at      2005-09-30 16:55:26.000000000 +0200
@@ -0,0 +1,64 @@
+# Hand crafted tests for GNU Libtool.                         -*- Autotest -*-
+# Copyright 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+
+AT_BANNER([Detecting identical deplibs.])
+
+
+## ----------------------------------------------- ##
+## Different relative paths within the build tree. ##
+## ----------------------------------------------- ##
+
+AT_SETUP([build tree relpaths])
+
+mkdir a a/b c
+echo 'int c() { return 0; }' > c/libcee.c
+AT_CHECK([$LIBTOOL --mode=compile $CC $CFLAGS -c c/libcee.c -o 
c/libcee.lo],[0],[ignore],[ignore])
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o c/libcee.la c/libcee.lo 
-rpath /nowhere],
+        [0],[ignore],[ignore])
+
+depl_1=../c/libcee.la
+depl_2=`pwd`/c/libcee.la
+depl_3="-L../c -lcee"
+
+(
+  cd a
+  for i in 1 2 3; do
+    eval depend_on_c=\"\$depl_$i\"
+    echo "extern int c(void); int a$i() { return c(); }" > liba$i.c
+    AT_CHECK([$LIBTOOL --mode=compile $CC $CFLAGS -c 
liba$i.c],[0],[ignore],[ignore])
+    AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba$i.la liba$i.lo 
$depend_on_c -rpath /nowhere],
+          [0],[ignore],[ignore])
+  done
+)
+
+AT_DATA([a/b/b.c],
+[[extern int a1(void), a2(void), a3(void), c(void);
+int main() { return a1() + a2() + a3() + c(); }
+]])
+
+(
+  cd a/b
+  AT_CHECK([$CC $CFLAGS -c b.c],[0],[ignore],[ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o b b.o ../liba1.la 
../liba2.la ../liba3.la ../../c/libcee.la -rpath /nowhere],
+          [0],[stdout],[ignore])
+  AT_CHECK([$EGREP 'cee.*cee' stdout], 1, [ignore], [ignore])
+  AT_XFAIL_IF(:) dnl This is currently broken in libtool
+)
+
+AT_CLEANUP
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/Makefile.am,v
retrieving revision 1.167
diff -u -r1.167 Makefile.am
--- Makefile.am 30 Sep 2005 00:46:52 -0000      1.167
+++ Makefile.am 30 Sep 2005 10:11:15 -0000
@@ -472,6 +483,7 @@
                  tests/libtoolize.at \
                  tests/old-m4-iface.at \
                  tests/standalone.at \
+                 tests/deplibs-ident.at \
                  tests/stresstest.at \
                  tests/link-order.at \
                  tests/convenience.at \
Index: tests/testsuite.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v
retrieving revision 1.21
diff -u -r1.21 testsuite.at
--- tests/testsuite.at  30 Sep 2005 00:46:52 -0000      1.21
+++ tests/testsuite.at  30 Sep 2005 10:11:16 -0000
@@ -108,5 +121,7 @@
 m4_include([template.at])
 # Behaviour of LT_OUTPUT
 m4_include([early-libtool.at])
+# identical deplibs
+m4_include([deplibs-ident.at])
 # stress test
 m4_include([stresstest.at])




reply via email to

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