diff options
| author | Doğan Çeçen <sepeth@fastmail.com> | 2024-12-04 12:10:11 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-12-09 23:15:45 +0100 |
| commit | dcaccc8b722cee279c00bb321baa48ae73563931 (patch) | |
| tree | c66294a7bcac452b69fe22c8695fa606be1fbb0b /nix | |
| parent | b0421cc964ce11c1e43da5ad2a8e31205539737c (diff) | |
daemon: Fix linking gcrypt when --as-needed linker arg is used
This is a followup to 8a7bd211d21f06c1234fbb82bb905d202d58f598.
As it is mentioned in autoconf manual that library names should be
specified in LIBS, not LDFLAGS. See:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Preset-Output-Variables.html#index-LDFLAGS-2
This change also brings back the save_* vars trick that was there
before. I missed in my earlier change that nix/local.mk was referring
LIBGCRYPT_* vars directly.
And, instead of CXXFLAGS, CPPFLAGS is used since the latter is probably
more correct as this is used for include dirs, therefore using
preprocessor flags.
Tested with ./configure LDFLAGS="-Wl,--as-needed" --with-libgcrypt-prefix=... combinations.
* config-daemon.ac: Set ‘LIBGCRYPT_CPPFLAGS’ instead of
‘LIBGCRYPT_CXXFLAGS’. Set ‘LIBGCRYPT_LIBS’ in addition to
‘LIBGCRYPT_LDFLAGS’. Save and restore ‘CPPFLAGS’, ‘LDFLAGS’, and ‘LIBS’
around test.
* nix/local.mk (libutil_a_CPPFLAGS): Add $(LIBGCRYPT_CPPFLAGS).
(libstore_a_CXXFLAGS): Remove $(LIBGCRYPT_CFLAGS).
(guix_daemon_LDFLAGS): New variable.
Change-Id: Iadb10e1994c9a78e2927847af2cfe5e096fbb2a8
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/local.mk | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nix/local.mk b/nix/local.mk index 8a2b2b88e86..0d23a48a024 100644 --- a/nix/local.mk +++ b/nix/local.mk | |||
| @@ -69,7 +69,8 @@ libutil_headers = \ | |||
| 69 | libutil_a_CPPFLAGS = \ | 69 | libutil_a_CPPFLAGS = \ |
| 70 | -I$(top_builddir)/nix \ | 70 | -I$(top_builddir)/nix \ |
| 71 | -I$(top_srcdir)/%D%/libutil \ | 71 | -I$(top_srcdir)/%D%/libutil \ |
| 72 | $(libformat_a_CPPFLAGS) | 72 | $(libformat_a_CPPFLAGS) \ |
| 73 | $(LIBGCRYPT_CPPFLAGS) | ||
| 73 | 74 | ||
| 74 | libstore_a_SOURCES = \ | 75 | libstore_a_SOURCES = \ |
| 75 | %D%/libstore/gc.cc \ | 76 | %D%/libstore/gc.cc \ |
| @@ -109,7 +110,7 @@ libstore_a_CPPFLAGS = \ | |||
| 109 | -DDEFAULT_CHROOT_DIRS="\"\"" | 110 | -DDEFAULT_CHROOT_DIRS="\"\"" |
| 110 | 111 | ||
| 111 | libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ | 112 | libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ |
| 112 | $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) | 113 | $(SQLITE3_CFLAGS) |
| 113 | 114 | ||
| 114 | bin_PROGRAMS = guix-daemon | 115 | bin_PROGRAMS = guix-daemon |
| 115 | 116 | ||
| @@ -122,6 +123,9 @@ guix_daemon_CPPFLAGS = \ | |||
| 122 | $(libutil_a_CPPFLAGS) \ | 123 | $(libutil_a_CPPFLAGS) \ |
| 123 | -I$(top_srcdir)/%D%/libstore | 124 | -I$(top_srcdir)/%D%/libstore |
| 124 | 125 | ||
| 126 | guix_daemon_LDFLAGS = \ | ||
| 127 | $(LIBGCRYPT_LDFLAGS) | ||
| 128 | |||
| 125 | guix_daemon_LDADD = \ | 129 | guix_daemon_LDADD = \ |
| 126 | libstore.a libutil.a libformat.a -lz \ | 130 | libstore.a libutil.a libformat.a -lz \ |
| 127 | $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) | 131 | $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) |
