]> git.sur5r.net Git - kconfig-frontends/blobdiff - configure.ac
configure: add option to set the /package/ name
[kconfig-frontends] / configure.ac
index f4ce2ca3c719a83063eca3a093d8136d7d29a4d6..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
@@ -117,6 +133,8 @@ AS_CASE(
 AS_IF(
     [test "$need_curses" = "yes" -o "$need_curses" = "auto"],
     [AC_SUBST([CURSES_LOC])
+     AC_SUBST([ncurses_LIBS])
+     LIBS_old="$LIBS"
      AC_CHECK_HEADERS(
         [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
         [CURSES_LOC=$ac_header; break])
@@ -135,7 +153,9 @@ AS_IF(
         [AS_IF(
             [test "$need_curses" = "yes"],
             [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
-            [has_curses=no])])])
+            [has_curses=no])])
+     ncurses_LIBS="$LIBS"
+     LIBS=$LIBS_old])
 
 AS_IF(
     [test "$has_curses" = "no" ],
@@ -147,7 +167,9 @@ AS_IF(
 
 AS_IF(
     [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"],
-    [AC_SEARCH_LIBS(
+    [AC_SUBST([ncurses_extra_LIBS])
+     LIBS_old="$LIBS"
+     AC_SEARCH_LIBS(
         [new_panel],
         [panel],
         [ac_ct_panel_lib_found=yes; break])
@@ -166,7 +188,9 @@ AS_IF(
         [AS_IF(
             [test "$need_panel_menu" = "yes"],
             [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])],
-            [has_panel_menu=no])])])
+            [has_panel_menu=no])])
+     ncurses_extra_LIBS="$LIBS"
+     LIBS=$LIBS_old])
 
 AS_IF(
     [test "$has_panel_menu" = "no" ],
@@ -289,6 +313,8 @@ 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])],
       [AC_MSG_NOTICE([  - conf:  no])])
@@ -304,9 +330,8 @@ AS_IF([test "$enable_nconf" = "yes"],
 AS_IF([test "$enable_qconf" = "yes"],
       [AC_MSG_NOTICE([  - qconf: yes])],
       [AC_MSG_NOTICE([  - qconf: no])])
+AC_MSG_NOTICE([- parser library:])
 AS_IF([test "$enable_shared" = "yes"],
-      [AC_MSG_NOTICE([  - parser shared library: yes, $KCONFIGPARSER_LIB_VERSION])],
-      [AC_MSG_NOTICE([  - parser shared library: no])])
-AS_IF([test "$enable_static" = "yes"],
-      [AC_MSG_NOTICE([  - parser static library: yes])],
-      [AC_MSG_NOTICE([  - parser static library: no])])
+      [AC_MSG_NOTICE([  - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
+      [AC_MSG_NOTICE([  - shared: no])])
+AC_MSG_NOTICE([  - static: $enable_static])