]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
build: derive the location of default config file from $sysconfdir
authorDaiki Ueno <ueno@gnu.org>
Thu, 30 Oct 2025 05:12:54 +0000 (14:12 +0900)
committerDaiki Ueno <ueno@gnu.org>
Thu, 30 Oct 2025 05:12:54 +0000 (14:12 +0900)
Previously we hard-coded "/etc" as part of the path of the default
configuration file. It is more palatable to respect the --sysconfdir
configure option and locate the file there.

Per recommendation at [1], the path is expanded at "make" time, not at
"configure" time.

1. https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Installation-Directory-Variables.html

Signed-off-by: Daiki Ueno <ueno@gnu.org>
configure.ac
lib/Makefile.am

index b7aa758cd0ca5624c026f69f29039640a0ab38db..5cee87dd360c6062b922cae36056660235e46f4c 100644 (file)
@@ -944,7 +944,7 @@ fi
 AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
   ["$unbound_root_key_file"], [The DNSSEC root key file])
 
-system_config_file="/etc/gnutls/config"
+system_config_file='${sysconfdir}/gnutls/config'
 AC_ARG_WITH(system-priority-file, AS_HELP_STRING([--with-system-priority-file],
                                  [specify the system-wide config file (set empty to disable)]),
             system_config_file="$withval"
@@ -956,8 +956,7 @@ if test -z "${system_config_file}";then
        AC_DEFINE([DISABLE_SYSTEM_CONFIG], 1, [Whether to disable system configuration])
 fi
 
-AC_DEFINE_UNQUOTED([SYSTEM_PRIORITY_FILE],
-  ["$system_config_file"], [The system-wide gnutls configuration file])
+AC_SUBST([system_config_file])
 
 AC_ARG_WITH(default-priority-string, AS_HELP_STRING([--with-default-priority-string],
                                  [specify the default priority string used by gnutls_set_default_priority (default is NORMAL)]),
index 49e7bcf5aa141b04b3d125456e534c7a47da092e..e059371584d4a0ad0305bca6a328f25e6a7da578 100644 (file)
@@ -39,6 +39,7 @@ include $(top_srcdir)/lib/common.mk
 
 AM_CPPFLAGS +=                                 \
        -DLOCALEDIR=\"$(localedir)\"            \
+       -DSYSTEM_PRIORITY_FILE=\"$(system_config_file)\" \
        -I$(srcdir)/../gl                       \
        -I$(builddir)/../gl                     \
        -I$(builddir)/includes                  \