]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: Add no-undefined flag based on host OS
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Tue, 11 Jun 2024 13:34:22 +0000 (16:34 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Tue, 11 Jun 2024 18:14:31 +0000 (21:14 +0300)
Without the no-undefined flag, the test will fail on Mingw and
Cygwin, so the flag will be appended for windows compilation.

* tests/bug_62343.at: Add no-undefined flag for windows-based
  compilation.

tests/bug_62343.at

index 43a74b6f766cf5dc294c44e37e91135f985e24a0..75ceafd3bbc691c0acc38296563d23b515c1a066 100644 (file)
@@ -54,7 +54,16 @@ AT_CHECK([$LIBTOOL --mode=compile --tag=CXX g++ -no-canonical-prefixes -c x.cpp]
 
 AT_CHECK([$GREP -- '-no-canonical-prefixes' stdout], [0], [ignore])
 
-AT_CHECK([$LIBTOOL --mode=link --tag=CXX g++ -no-canonical-prefixes -o libx.la -rpath /usr/lib64/ x.lo], [0], [stdout], [stderr])
+host_flags=:
+case $host_os in
+  cygwin* | mingw* | windows*)
+    host_flags=-no-undefined
+    ;;
+  *)
+    ;;
+esac
+
+AT_CHECK([$LIBTOOL --mode=link --tag=CXX g++ -no-canonical-prefixes $host_flags -o libx.la -rpath /usr/lib64/ x.lo], [0], [stdout], [stderr])
 
 AT_CHECK([$GREP -- '-no-canonical-prefixes' stdout], [0], [ignore])