From: Bruno Haible Date: Thu, 26 Sep 2024 00:42:45 +0000 (+0200) Subject: build-to-host.m4: Add one more convenience macro. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=99ddb8cef8f6f61adf3a571348b875d86a5368eb;p=gnulib.git build-to-host.m4: Add one more convenience macro. * m4/build-to-host.m4 (gl_BUILD_TO_HOST_PKGLIBEXECDIR): New macro. --- diff --git a/ChangeLog b/ChangeLog index c42d59d189..a794c383ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-09-25 Bruno Haible + + 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 relocatable-lib-lgpl: Add support for mingw builds on Cygwin hosts. diff --git a/m4/build-to-host.m4 b/m4/build-to-host.m4 index 1e9a8161b5..2cff934f63 100644 --- a/m4/build-to-host.m4 +++ b/m4/build-to-host.m4 @@ -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}" +])