]> Savannah Git Hosting - gnulib.git/commitdiff
build-to-host.m4: Add one more convenience macro.
authorBruno Haible <bruno@clisp.org>
Thu, 26 Sep 2024 00:42:45 +0000 (02:42 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 26 Sep 2024 00:42:45 +0000 (02:42 +0200)
* m4/build-to-host.m4 (gl_BUILD_TO_HOST_PKGLIBEXECDIR): New macro.

ChangeLog
m4/build-to-host.m4

index c42d59d1896dc878b783450f872f39efe93a8594..a794c383ef285328dbce6ccec3aa81ddc126f0c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-09-25  Bruno Haible  <bruno@clisp.org>
+
+       build-to-host.m4: Add one more convenience macro.
+       * m4/build-to-host.m4 (gl_BUILD_TO_HOST_PKGLIBEXECDIR): New macro.
+
 2024-09-25  Bruno Haible  <bruno@clisp.org>
 
        relocatable-lib-lgpl: Add support for mingw builds on Cygwin hosts.
index 1e9a8161b52b608c604433aa573361203b4c9843..2cff934f6356b13602856a4024b4b341c53403ee 100644 (file)
@@ -223,3 +223,30 @@ AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBDIR],
   exec_prefix="${gl_saved_exec_prefix}"
   prefix="${gl_saved_prefix}"
 ])
+
+dnl Defines pkglibexecdir_c and pkglibexecdir_c_make,
+dnl where pkglibexecdir = $(libexecdir)/$(PACKAGE)
+AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBEXECDIR],
+[
+  dnl Find the final value of pkglibexecdir.
+  gl_saved_prefix="${prefix}"
+  gl_saved_exec_prefix="${exec_prefix}"
+  gl_saved_libexecdir="${libexecdir}"
+  gl_saved_pkglibexecdir="${pkglibexecdir}"
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    exec_prefix='${prefix}'
+  fi
+  eval exec_prefix="$exec_prefix"
+  eval libexecdir="$libexecdir"
+  eval pkglibexecdir="$pkglibexecdir"
+  gl_BUILD_TO_HOST([pkglibexecdir])
+  pkglibexecdir="${gl_saved_pkglibexecdir}"
+  libexecdir="${gl_saved_libexecdir}"
+  exec_prefix="${gl_saved_exec_prefix}"
+  prefix="${gl_saved_prefix}"
+])