The following commit has been merged in the master branch:
commit c7dc2bf66393a546e1189e74a65292af336835cb
Author: Guillem Jover <guil...@debian.org>
Date:   Thu Mar 11 23:43:17 2010 +0100

    build: Allow disabling Unicode support
    
    This affects only dselect ncurses support for now.
    
    Based-on-patch-by: Yuri Vasilevski <yvasi...@gentoo.org>

diff --git a/debian/changelog b/debian/changelog
index 843e0b1..af0157c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -178,6 +178,8 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     Based on a patch by Marc-Jano Knopp <pub_br_debian....@marc-jano.de>.
     Closes: #383869
   * Honour LINGUAS environment variable when installing translated man pages.
+  * Allow disabling at configure time Unicode ncurses support for dselect.
+    Based on a patch by Yuri Vasilevski <yvasi...@gentoo.org>.
 
   [ Modestas Vainius ]
   * Implement symbol patterns (Closes: #563752). From now on, it is possible to
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index febb1e5..50ff5ff 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -88,17 +88,32 @@ if test "x$with_selinux" != "xno"; then
 fi
 ])# DPKG_LIB_SELINUX
 
+# _DPKG_CHECK_LIB_CURSES_NARROW
+# -----------------------------
+# Check for narrow curses library.
+AC_DEFUN([_DPKG_CHECK_LIB_CURSES_NARROW], [
+AC_CHECK_LIB([ncurses], [initscr],
+  [CURSES_LIBS="${CURSES_LIBS:+$CURSES_LIBS }-lncurses"],
+  [AC_CHECK_LIB([curses], [initscr],
+     [CURSES_LIBS="${CURSES_LIBS:+$CURSES_LIBS }-lcurses"],
+     [AC_MSG_WARN([no curses library found])])])])
+])# DPKG_CHECK_LIB_CURSES_NARROW
+
 # DPKG_LIB_CURSES
 # ---------------
 # Check for curses library.
-AC_DEFUN([DPKG_LIB_CURSES],
-[AC_ARG_VAR([CURSES_LIBS], [linker flags for curses library])dnl
-AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses/ncurses.h ncurses.h curses.h \
-                  ncursesw/term.h ncurses/term.h term.h])
-AC_CHECK_LIB([ncursesw], [initscr], [CURSES_LIBS="${CURSES_LIBS:+$CURSES_LIBS 
}-lncursesw"],
-       [AC_CHECK_LIB([ncurses], [initscr], 
[CURSES_LIBS="${CURSES_LIBS:+$CURSES_LIBS }-lncurses"],
-               [AC_CHECK_LIB([curses], [initscr], 
[CURSES_LIBS="${CURSES_LIBS:+$CURSES_LIBS }-lcurses"],
-                       [AC_MSG_WARN([no curses library found])])])])
+AC_DEFUN([DPKG_LIB_CURSES], [
+AC_REQUIRE([DPKG_UNICODE])
+AC_ARG_VAR([CURSES_LIBS], [linker flags for curses library])dnl
+AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h curses.h ncurses/term.h term.h])
+if test "x$USE_UNICODE" = "xyes"; then
+  AC_CHECK_HEADERS([ncursesw/ncurses.h ncursesw/term.h])
+  AC_CHECK_LIB([ncursesw], [initscr],
+    [CURSES_LIBS="${CURSES_LIBS:+$CURSES_LIBS }-lncursesw"],
+    [_DPKG_CHECK_LIB_CURSES_NARROW()])
+else
+  _DPKG_CHECK_LIB_CURSES_NARROW()
+fi
 ])# DPKG_LIB_CURSES
 
 # DPKG_LIB_SSD
diff --git a/m4/dpkg-unicode.m4 b/m4/dpkg-unicode.m4
new file mode 100644
index 0000000..1af7bf0
--- /dev/null
+++ b/m4/dpkg-unicode.m4
@@ -0,0 +1,21 @@
+# Copyright © 1995-2003, 2005-2006 Free Software Foundation, Inc.
+# Copyright © 2009 Yuri Vasilevski <yvasi...@gentoo.org>
+# Copyright © 2010 Guillem Jover <guil...@debian.org>
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# DPKG_UNICODE()
+# --------------
+# Add configure option to disable Unicode support.
+AC_DEFUN([DPKG_UNICODE], [
+  AC_MSG_CHECKING([whether Unicode is requested])
+  dnl Default: Unicode is enabled.
+  AC_ARG_ENABLE([unicode],
+    [AS_HELP_STRING([--disable-unicode],
+                    [do not use Unicode (wide chars) support])],
+    [USE_UNICODE=$enableval], [USE_UNICODE=yes])
+  AC_MSG_RESULT($USE_UNICODE)
+  AC_SUBST(USE_UNICODE)
+]) # DPKG_UNICODE

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to