]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: Test trailing slash in destination
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Thu, 24 Oct 2024 17:43:03 +0000 (20:43 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Fri, 25 Oct 2024 13:19:17 +0000 (16:19 +0300)
This test is added to ensure path comparisons pass when
installing to a destination, specifically when there is a
trailing slash in the destination.

* tests/destdir.at: Add test for trailing slash in destination.

tests/destdir.at

index f109f149c044a05df07d645f1358990a266df3f7..df0d8ba85a6e064912db15128f80db78deff0cf5 100644 (file)
@@ -137,4 +137,45 @@ fi
 
 AT_CLEANUP
 
+AT_SETUP([trailing slash in destination])
+AT_KEYWORDS([libtool])
+
+AT_DATA([configure.ac],
+[[
+AC_INIT([foo], [0])
+AM_INIT_AUTOMAKE([foreign])
+AC_PROG_CC
+LT_INIT
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_MACRO_DIRS([m4])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.am],
+[[
+lib_LTLIBRARIES = libbase.la
+libbase_la_SOURCES = foo.c
+# Path with trailing slash for test
+bardir = /usr/lib/bar/extensions/
+bar_LTLIBRARIES = foo.la
+foo_la_SOURCES = foo.c
+foo_la_LDFLAGS = -module -avoid-version
+foo_la_LIBADD = libbase.la
+]])
+
+AT_DATA([foo.c],
+[[
+int unused;
+]])
+
+LT_AT_LIBTOOLIZE([--force --copy --install])
+LT_AT_AUTORECONF([--force --verbose --install])
+LT_AT_CONFIGURE([])
+# Use local 'tmp' directory as destination
+sysroot=`pwd`/tmp
+AT_CHECK([$MAKE], [0], [ignore], [ignore])
+AT_CHECK([$MAKE install DESTDIR=$sysroot], [0], [ignore], [ignore])
+
+AT_CLEANUP
+
 m4_popdef([_LT_DIRSETUP])