]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Fix shared library support in 32-bit mode on FreeBSD/powerpc64.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Aug 2024 13:52:05 +0000 (15:52 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Aug 2024 13:52:05 +0000 (15:52 +0200)
Patch from <https://savannah.gnu.org/patch/index.php?10469>.

* m4/libtool.m4: On FreeBSD, fix shlibpath_var.

m4/libtool.m4

index ea4d35963ac77808ccea4e853baf06d1aa47e1e5..c0340e0212f4443faaae5b6071e3b2357f342930 100644 (file)
@@ -2699,7 +2699,21 @@ freebsd* | dragonfly* | midnightbsd*)
       need_version=yes
       ;;
   esac
-  shlibpath_var=LD_LIBRARY_PATH
+  case $host_cpu in
+    powerpc64)
+      # On FreeBSD bi-arch platforms, a different variable is used for 32-bit
+      # binaries.  See <https://man.freebsd.org/cgi/man.cgi?query=ld.so>.
+      AC_COMPILE_IFELSE(
+        [AC_LANG_SOURCE(
+           [[int test_pointer_size[sizeof (void *) - 5];
+           ]])],
+        [shlibpath_var=LD_LIBRARY_PATH],
+        [shlibpath_var=LD_32_LIBRARY_PATH])
+      ;;
+    *)
+      shlibpath_var=LD_LIBRARY_PATH
+      ;;
+  esac
   case $host_os in
   freebsd2.*)
     shlibpath_overrides_runpath=yes