]> git.sur5r.net Git - kconfig-frontends/blobdiff - configure.ac
configure: add option to set the /package/ name
[kconfig-frontends] / configure.ac
index 7f7569e3c2bdd0cc9aa14906db316d732b4ba76d..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
@@ -78,7 +94,6 @@ AC_SUBST([enable_qconf], [${enable_qconf:-auto}])
 
 #----------------------------------------
 # Some program checks
-AC_PROG_RANLIB
 AC_PROG_LEX
 AC_PROG_YACC
 AC_CHECK_PROGS(
@@ -118,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])
@@ -136,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" ],
@@ -148,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])
@@ -167,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" ],
@@ -263,6 +286,16 @@ AM_CONDITIONAL(
     [COND_lxdialog],
     [test "$need_lxdialog" = "yes"])
 
+#---------------------------------------------------------------------------
+# Prepare libtool
+LT_INIT([disable-static])
+
+#----------------------------------------
+# Get the version to apply to the parser shared library
+AC_SUBST(
+    [KCONFIGPARSER_LIB_VERSION],
+    [m4_esyscmd_s([./scripts/version.sh --plain])])
+
 #----------------------------------------
 # Finalise
 AC_CONFIG_FILES([
@@ -280,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])])
@@ -295,3 +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([  - shared: yes, versioned $KCONFIGPARSER_LIB_VERSION])],
+      [AC_MSG_NOTICE([  - shared: no])])
+AC_MSG_NOTICE([  - static: $enable_static])