Skip to content

Commit 80a1ebe

Browse files
committed
Define EXTERNAL_LUKS2_TOKENS_PATH even for autoconf
Meson already uses config.h here, do the seame instead of commandline define option. Expanding the variable is tricky, though...
1 parent 70a69b5 commit 80a1ebe

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ AM_CPPFLAGS = \
2525
-DLIBDIR=\""$(libdir)"\" \
2626
-DPREFIX=\""$(prefix)"\" \
2727
-DSYSCONFDIR=\""$(sysconfdir)"\" \
28-
-DVERSION=\""$(VERSION)"\" \
29-
-DEXTERNAL_LUKS2_TOKENS_PATH=\"${EXTERNAL_LUKS2_TOKENS_PATH}\"
28+
-DVERSION=\""$(VERSION)"\"
3029
AM_CFLAGS = -Wall
3130
AM_CXXFLAGS = -Wall
3231
AM_LDFLAGS =

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,17 @@ else
833833
EXTERNAL_LUKS2_TOKENS_PATH="\${libdir}/cryptsetup"
834834
fi
835835
AC_SUBST(EXTERNAL_LUKS2_TOKENS_PATH)
836+
dnl We need to define expanded EXTERNAL_LUKS2_TOKENS_PATH, but some other code can depend on prefix=NONE.
837+
dnl Pretend you do not see this hack :-)
838+
saved_prefix=$prefix
839+
saved_exec_prefix=$exec_prefix
840+
test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
841+
test "x$exec_prefix" = "xNONE" && exec_prefix="$prefix"
842+
expanded_EXTERNAL_LUKS2_TOKENS_PATH=$(eval echo "$EXTERNAL_LUKS2_TOKENS_PATH")
843+
expanded_EXTERNAL_LUKS2_TOKENS_PATH=$(eval echo "$expanded_EXTERNAL_LUKS2_TOKENS_PATH")
844+
AC_DEFINE_UNQUOTED([EXTERNAL_LUKS2_TOKENS_PATH], ["$expanded_EXTERNAL_LUKS2_TOKENS_PATH"], [path to directory with LUKSv2 external token handlers (plugins)])
845+
prefix=$saved_prefix
846+
exec_prefix=$saved_exec_prefix
836847
837848
dnl Override default LUKS format version (for cryptsetup or cryptsetup-reencrypt format actions only).
838849
AC_ARG_WITH([default_luks_format],

0 commit comments

Comments
 (0)