From 6fa3b210e4feb8f4bfa5f179a39a19b5e7a1e5a4 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 4 Mar 2012 00:09:19 +0100 Subject: [PATCH] configure: allow $ in package name The package-name can contain the names of symbols, like '$FOO', which get replaced by their actual value just after parse-time. Signed-off-by: "Yann E. MORIN" --- configure.ac | 8 +++++++- libs/parser/Makefile.am | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d7f0a2f..ce3393f 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,13 @@ AC_ARG_ENABLE( ["$enableval"], [yes], [package_name=$PACKAGE_NAME], [no], [package_name=], - [package_name=$enableval])]) + [# Escape the $ signs, otherwise they would get munged by make + # Also, append a space at the end, to separate the package + # name from the literal 'Configuration' + package_name="$( echo "$enableval" \ + |sed -r -e 's/\$/\\$$/g;' \ + -e 's/$/ /;' \ + )"])]) AC_SUBST([package_name], [${package_name=$PACKAGE_NAME}]) AC_ARG_ENABLE( diff --git a/libs/parser/Makefile.am b/libs/parser/Makefile.am index a3862be..c6f68cc 100644 --- a/libs/parser/Makefile.am +++ b/libs/parser/Makefile.am @@ -6,7 +6,7 @@ dist_EXTRA_libkconfigparser_la_SOURCES = \ hconf.gperf lconf.l \ confdata.c menu.c symbol.c util.c \ expr.c expr.h lkc.h lkc_proto.h -libkconfigparser_la_CPPFLAGS = -DPACKAGE=\"$(package_name)\" \ +libkconfigparser_la_CPPFLAGS = -DPACKAGE="\"$(package_name)\"" \ -DCONFIG_=\"$(config_prefix)\" libkconfigparser_la_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION) -- 2.39.5