]> git.sur5r.net Git - kconfig-frontends/commitdiff
configure: allow $ in package name
authorYann E. MORIN" <yann.morin.1998@free.fr>
Sat, 3 Mar 2012 23:09:19 +0000 (00:09 +0100)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Sat, 3 Mar 2012 23:09:19 +0000 (00:09 +0100)
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" <yann.morin.1998@free.fr>
configure.ac
libs/parser/Makefile.am

index d7f0a2fc69b8840909bdd1c1dc665d7752d46dd4..ce3393ff98af3312769c25a7e5aa02da3afbb32b 100644 (file)
@@ -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(
index a3862bead016634cc914d26587f9381978bfa3fa..c6f68cc3ec20c361610f532672a68300a1953e92 100644 (file)
@@ -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)