]> Savannah Git Hosting - gnulib.git/commitdiff
build-to-host.m4: Add one more convenience macro.
authorBruno Haible <bruno@clisp.org>
Fri, 11 Oct 2024 15:41:11 +0000 (17:41 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 11 Oct 2024 15:41:11 +0000 (17:41 +0200)
* m4/build-to-host.m4 (gl_BUILD_TO_HOST_DATADIR): New macro.

ChangeLog
m4/build-to-host.m4

index 0b47332948000a54a41b65cd287f031a6e1c02c3..517236fa6b6cb7fea501994aa6d71f3c869662b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-11  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        csharpcomp-script: Handle directories with spaces correctly.
index 2cff934f6356b13602856a4024b4b341c53403ee..c416bca3256c43d451b6d53be6fe8ce2f5315e1a 100644 (file)
@@ -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],
 [