]> git.sur5r.net Git - kconfig-frontends/commitdiff
configure: add option to set the /package/ name
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue, 14 Feb 2012 18:59:53 +0000 (19:59 +0100)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Tue, 14 Feb 2012 18:59:53 +0000 (19:59 +0100)
Allow users to define the package name at ./configure time.
The default "linux" is because kconfig comes from the Linux kernel.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
configure.ac
libs/parser/Makefile.am

index 2396271d182ba25d2df0ba9377a4cd6d7692c6d7..e5e7badc30cbff26b4fc3434255e141653570901 100644 (file)
@@ -42,6 +42,22 @@ AC_CHECK_FUNCS([ gettimeofday mkdir regcomp setlocale uname ])
 # End of the autoscan-detected stuff
 #---------------------------------------------------------------------------
 
+#----------------------------------------
+# Set misc options
+# Although there is a default (="linux") in the code, we do provide
+# a default here, to get a consistent autostuff behavior
+AC_ARG_ENABLE(
+    [package-name],
+    [AS_HELP_STRING(
+        [--enable-package-name],
+        [set the package name (default=kconfig-frontends)])],
+    [AS_CASE(
+        ["$enableval"],
+        [yes], [package_name=$PACKAGE_NAME],
+        [no],  [package_name=],
+               [package_name=$enableval])])
+AC_SUBST([package_name], [${package_name=$PACKAGE_NAME}])
+
 #----------------------------------------
 # Options to selectively enable/disable frontends
 # All are selected by default
@@ -297,6 +313,7 @@ AC_CONFIG_FILES([
 AC_OUTPUT
 
 AC_MSG_NOTICE([Configured with:])
+AC_MSG_NOTICE([- package name: '$package_name'])
 AC_MSG_NOTICE([- frontends:])
 AS_IF([test "$enable_conf" = "yes"],
       [AC_MSG_NOTICE([  - conf:  yes])],
index 8e0602acceeb28cefbd5bd327e66205f2b0ddda4..5e25765ad166842a845fb8ea727cbfff02527515 100644 (file)
@@ -6,6 +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_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION)
 
 include_HEADERS = expr.h lkc.h lkc_proto.h