From: Bruno Haible Date: Fri, 11 Oct 2024 15:41:11 +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=886aa98d74e04c1c132f0a17ef3ee30e1e08ded2;p=gnulib.git build-to-host.m4: Add one more convenience macro. * m4/build-to-host.m4 (gl_BUILD_TO_HOST_DATADIR): New macro. --- diff --git a/ChangeLog b/ChangeLog index 0b47332948..517236fa6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-10-11 Bruno Haible + + build-to-host.m4: Add one more convenience macro. + * m4/build-to-host.m4 (gl_BUILD_TO_HOST_DATADIR): New macro. + 2024-10-10 Bruno Haible csharpcomp-script: Handle directories with spaces correctly. diff --git a/m4/build-to-host.m4 b/m4/build-to-host.m4 index 2cff934f63..c416bca325 100644 --- a/m4/build-to-host.m4 +++ b/m4/build-to-host.m4 @@ -1,5 +1,5 @@ # build-to-host.m4 -# serial 4 +# serial 5 dnl Copyright (C) 2023-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -107,6 +107,27 @@ AC_DEFUN_ONCE([gl_BUILD_TO_HOST_BINDIR], prefix="${gl_saved_prefix}" ]) +dnl Defines datadir_c and datadir_c_make, +dnl where datadir = $(datarootdir) +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_DATADIR], +[ + dnl Find the final value of datadir. + gl_saved_prefix="${prefix}" + gl_saved_datarootdir="${datarootdir}" + gl_saved_datadir="${datadir}" + dnl Unfortunately, prefix gets only finally determined at the end of + dnl configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + eval datarootdir="$datarootdir" + eval datadir="$datadir" + gl_BUILD_TO_HOST([datadir]) + datadir="${gl_saved_datadir}" + datarootdir="${gl_saved_datarootdir}" + prefix="${gl_saved_prefix}" +]) + dnl Defines libdir_c and libdir_c_make. AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBDIR], [