From dd8b56a2ab62dd59b0a8103c071a482adce10ec3 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Wed, 15 Feb 2012 22:16:47 +0100 Subject: [PATCH] configure: add option to set the config option prefix Signed-off-by: "Yann E. MORIN" --- configure.ac | 14 ++++++++++++++ libs/parser/Makefile.am | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b8d8894..062bbb9 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,19 @@ AC_ARG_ENABLE( [package_name=$enableval])]) AC_SUBST([package_name], [${package_name=$PACKAGE_NAME}]) +AC_ARG_ENABLE( + [config-prefix], + [AS_HELP_STRING( + [--enable-config-prefix=PREFIX], + [the prefix to the config option (default=CONFIG_)])], + [AS_CASE( + ["$enableval"], + [*" "*],[AC_MSG_ERROR([config prefix can not contain spaces: '$enableval'])], + [yes], [config_prefix=CONFIG_], + [no], [config_prefix=], + [config_prefix=$enableval])]) +AC_SUBST([config_prefix], [${config_prefix-CONFIG_}]) + #---------------------------------------- # Options to selectively enable/disable frontends # All are selected by default @@ -333,6 +346,7 @@ AC_OUTPUT AC_MSG_NOTICE([Configured with:]) AC_MSG_NOTICE([- package name: '$package_name']) +AC_MSG_NOTICE([- config prefix: '$config_prefix']) AC_MSG_NOTICE([- frontends:]) AS_IF([test "$enable_conf" = "yes"], [AC_MSG_NOTICE([ - conf: yes])], diff --git a/libs/parser/Makefile.am b/libs/parser/Makefile.am index 5e25765..a3862be 100644 --- a/libs/parser/Makefile.am +++ b/libs/parser/Makefile.am @@ -6,7 +6,8 @@ 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) include_HEADERS = expr.h lkc.h lkc_proto.h -- 2.39.5