AUTHOR: Ken Moffat DATE: 2006-12-10 LICENSE: This document is licensed under the same license as the LFS book, since it merely explains how to apply information from that book to CLFS: Copyright (c) 1999-2006, Gerard Beekmans All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions in any form must retain the above copyright notice, this list of conditions and the following disclaimer * Neither the name of "Linux From Scratch" nor the names of its contributors may be used to endorse or promote products derived from this material without specific prior written permission * Any material derived from Linux From Scratch must contain a reference to the "Linux From Scratch" project THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SYNOPSIS: building ncursesw on clfs-1.0 DESCRIPTION: Using ncursesw on clfs. PREREQUISITES: This document describes changes to the build of clfs-1.0.0, so it should be used while you are building clfs. It is targetted at ncurses version 5.5. HINT: Why ___ Internationalisation is a wonderful thing, in that it lets people decipher text in other languages. The only realistic way to deal with multiple character encodings is to use UTF-8 and an xterm (or equivalent). My personal experience is that the "extra" characters, even the British £ (pound sterling) do not work on the console in UTF-8. For people who use X, having the ncursesw libraries sometimes helps (e.g. mutt in an xterm can display a _lot_ more characters instead of garbling them, so I can see who sent mails). If you are installing a server which you will access from a console, this is not for you. But, if you intend to access it from an xterm, and use a UTF-8 locale, this may help. Summary - if you use a UTF-8 locale, you probably want to do this. What this doesn't address _________________________ This doesn't help when you try to display man pages written with UTF-8 glyphs (UTF-8 characters, if you will). I assume ncursesw is a prerequisite to using groff-utf8, but I haven't attempted to prove that. However, most languages are lacking in man pages. 32-bit and pure64 _________________ For 32-bit, configure ncursesw as follows - CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \ ./configure --prefix=/usr --libdir=/lib \ --with-shared --without-debug --enable-widec in other words, add --enable-widec For pure64 configure without BUILD32, just ./configure --prefix=/usr --libdir=/lib \ --with-shared --without-debug --enable-widec then for either build and install as normal make make install Now we need to move some of the wide libraries to /usr/lib mv -v /lib/lib{panelw,menuw,formw,ncursesw,ncurses++w}.a /usr/lib and ensure the .so versions are in /usr/lib rm -v /lib/lib{ncursesw,menuw,panelw,formw,cursesw}.so ln -svf ../../lib/libncursesw.so.5 /usr/lib/libcursesw.so ln -svf ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so ln -svf ../../lib/libmenuw.so.5 /usr/lib/libmenuw.so ln -svf ../../lib/libpanelw.so.5 /usr/lib/libpanelw.so ln -svf ../../lib/libformw.so.5 /usr/lib/libformw.so now fix the permissions chmod -v 755 /lib/lib{panelw,menuw,formw,ncursesw}.so.5.5 and now apply the LFS solution for the non-wide libraries, by replacing them with commands to use the wide versions, and symlink the static versions. for lib in curses ncurses form panel menu ; do \ rm -vf /usr/lib/lib${lib}.so >>$LOG 2>&1 ; \ echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; \ ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \ done fix up libncurses++.a ln -sfv libncurses++w.a /usr/lib/libncurses++.a and ensure applications using -lcurses will work rm -vf /usr/lib/libcursesw.so echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so ln -sfv libncurses.so /usr/lib/libcurses.so ln -sfv libncursesw.a /usr/lib/libcursesw.a ln -sfv libncurses.a /usr/lib/libcurses.a n32 on mips64 _____________ I don't have one of these, so I can't confirm what to do. I presume the normal methods of building n32 should work. 64-bit on multilib __________________ Configure with the --enable-widec switch CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \ ./configure --prefix=/usr --libdir=/lib64 \ --with-shared --without-debug --enable-widec build and install in the normal way make make install do an equivalent move to /usr/lib64 mv -v /lib64/lib{panelw,menuw,formw,ncursesw,ncurses++w}.a /usr/lib64 rm -v /lib64/lib{ncursesw,menuw,panelw,formw,cursesw}.so ln -svf ../../lib64/libncursesw.so.5 /usr/lib64/libcursesw.so ln -svf ../../lib64/libncursesw.so.5 /usr/lib64/libncursesw.so ln -svf ../../lib64/libmenuw.so.5 /usr/lib64/libmenuw.so ln -svf ../../lib64/libpanelw.so.5 /usr/lib64/libpanelw.so ln -svf ../../lib64/libformw.so.5 /usr/lib64/libformw.so now fix the permissions chmod -v 755 /lib64/lib{panelw,menuw,formw,ncursesw}.so.5.5 fix up the non-wide versions for lib in curses ncurses form panel menu ; do \ rm -vf /usr/lib64/lib${lib}.so ; \ echo "INPUT(-l${lib}w)" >/usr/lib64/lib${lib}.so ; \ ln -sfv lib${lib}w.a /usr/lib64/lib${lib}.a ; \ done ln -sfv libncurses++w.a /usr/lib64/libncurses++.a and again make -lcurses work rm -vf /usr/lib64/libcursesw.so echo "INPUT(-lncursesw)" >/usr/lib64/libcursesw.so ln -sfv libncurses.so /usr/lib64/libcurses.so ln -sfv libncursesw.a /usr/lib64/libcursesw.a ln -sfv libncurses.a /usr/lib64/libcurses.a Reviewing what you did ______________________ When I started trying to use ncursesw on clfs, I made several errors. Some of these showed up quickly (procps failed to build, a library was "too short"). Other errors took a lot longer to appear (when I was building my desktop, e.g. in aspell). To try to give you an easier passage to ncursesw, here is a list of the files installed. On 32-bit and pure64 you should have the following libraries from ncurses. You should be able to work out what is in the short libraries which aren't symlinks (e.g. /usr/lib/libcursesw.so). Obviously, the size of your binaries may not match the size of mine. /lib: lrwxrwxrwx 1 root root 15 2006-11-21 19:45 libformw.so.5 -> libformw.so.5.5 -rwxr-xr-x 1 root root 62392 2006-11-21 19:45 libformw.so.5.5 lrwxrwxrwx 1 root root 15 2006-11-21 19:45 libmenuw.so.5 -> libmenuw.so.5.5 -rwxr-xr-x 1 root root 31057 2006-11-21 19:45 libmenuw.so.5.5 lrwxrwxrwx 1 root root 18 2006-11-21 19:45 libncursesw.so.5 -> libncursesw.so.5.5 -rwxr-xr-x 1 root root 334734 2006-11-21 19:45 libncursesw.so.5.5 lrwxrwxrwx 1 root root 16 2006-11-21 19:45 libpanelw.so.5 -> libpanelw.so.5.5 -rwxr-xr-x 1 root root 12794 2006-11-21 19:45 libpanelw.so.5.5 /usr/lib: lrwxrwxrwx 1 root root 12 2006-11-21 19:45 libcurses.a -> libncurses.a lrwxrwxrwx 1 root root 13 2006-11-21 19:45 libcurses.so -> libncurses.so lrwxrwxrwx 1 root root 13 2006-11-21 19:45 libcursesw.a -> libncursesw.a -rw-r--r-- 1 root root 18 2006-11-21 19:45 libcursesw.so lrwxrwxrwx 1 root root 10 2006-11-21 19:45 libform.a -> libformw.a -rw-r--r-- 1 root root 15 2006-11-21 19:45 libform.so -rw-r--r-- 1 root root 84688 2006-11-21 19:45 libformw.a lrwxrwxrwx 1 root root 23 2006-11-21 19:45 libformw.so -> ../../lib/libformw.so.5 lrwxrwxrwx 1 root root 10 2006-11-21 19:45 libmenu.a -> libmenuw.a -rw-r--r-- 1 root root 15 2006-11-21 19:45 libmenu.so -rw-r--r-- 1 root root 44028 2006-11-21 19:45 libmenuw.a lrwxrwxrwx 1 root root 23 2006-11-21 19:45 libmenuw.so -> ../../lib/libmenuw.so.5 lrwxrwxrwx 1 root root 13 2006-11-21 19:45 libncurses.a -> libncursesw.a lrwxrwxrwx 1 root root 15 2006-11-21 19:45 libncurses++.a -> libncurses++w.a -rw-r--r-- 1 root root 18 2006-11-21 19:45 libncurses.so -rwxr-xr-x 1 root root 128922 2006-11-21 19:45 libncurses++w.a -rw-r--r-- 1 root root 471310 2006-11-21 19:45 libncursesw.a lrwxrwxrwx 1 root root 26 2006-11-21 19:45 libncursesw.so -> ../../lib/libncursesw.so.5 lrwxrwxrwx 1 root root 11 2006-11-21 19:45 libpanel.a -> libpanelw.a -rw-r--r-- 1 root root 16 2006-11-21 19:45 libpanel.so -rw-r--r-- 1 root root 18348 2006-11-21 19:45 libpanelw.a lrwxrwxrwx 1 root root 24 2006-11-21 19:45 libpanelw.so -> ../../lib/libpanelw.so.5 On multilib, you should also have the following: /lib64: lrwxrwxrwx 1 root root 15 2006-11-21 19:47 libformw.so.5 -> libformw.so.5.5 -rwxr-xr-x 1 root root 79233 2006-11-21 19:47 libformw.so.5.5 lrwxrwxrwx 1 root root 15 2006-11-21 19:47 libmenuw.so.5 -> libmenuw.so.5.5 -rwxr-xr-x 1 root root 37439 2006-11-21 19:47 libmenuw.so.5.5 lrwxrwxrwx 1 root root 18 2006-11-21 19:47 libncursesw.so.5 -> libncursesw.so.5.5 -rwxr-xr-x 1 root root 449178 2006-11-21 19:47 libncursesw.so.5.5 lrwxrwxrwx 1 root root 16 2006-11-21 19:47 libpanelw.so.5 -> libpanelw.so.5.5 -rwxr-xr-x 1 root root 15403 2006-11-21 19:47 libpanelw.so.5.5 /usr/lib64: lrwxrwxrwx 1 root root 12 2006-11-21 19:47 libcurses.a -> libncurses.a lrwxrwxrwx 1 root root 13 2006-11-21 19:47 libcurses.so -> libncurses.so lrwxrwxrwx 1 root root 13 2006-11-21 19:47 libcursesw.a -> libncursesw.a -rw-r--r-- 1 root root 18 2006-11-21 19:47 libcursesw.so lrwxrwxrwx 1 root root 10 2006-11-21 19:47 libform.a -> libformw.a -rw-r--r-- 1 root root 15 2006-11-21 19:47 libform.so -rw-r--r-- 1 root root 129980 2006-11-21 19:47 libformw.a lrwxrwxrwx 1 root root 25 2006-11-21 19:47 libformw.so -> ../../lib64/libformw.so.5 lrwxrwxrwx 1 root root 10 2006-11-21 19:47 libmenu.a -> libmenuw.a -rw-r--r-- 1 root root 15 2006-11-21 19:47 libmenu.so -rw-r--r-- 1 root root 68126 2006-11-21 19:47 libmenuw.a lrwxrwxrwx 1 root root 25 2006-11-21 19:47 libmenuw.so -> ../../lib64/libmenuw.so.5 lrwxrwxrwx 1 root root 13 2006-11-21 19:47 libncurses.a -> libncursesw.a lrwxrwxrwx 1 root root 15 2006-11-21 19:47 libncurses++.a -> libncurses++w.a -rw-r--r-- 1 root root 18 2006-11-21 19:47 libncurses.so -rwxr-xr-x 1 root root 169658 2006-11-21 19:47 libncurses++w.a -rw-r--r-- 1 root root 767574 2006-11-21 19:47 libncursesw.a lrwxrwxrwx 1 root root 28 2006-11-21 19:47 libncursesw.so -> ../../lib64/libncursesw.so.5 lrwxrwxrwx 1 root root 11 2006-11-21 19:47 libpanel.a -> libpanelw.a -rw-r--r-- 1 root root 16 2006-11-21 19:47 libpanel.so -rw-r--r-- 1 root root 27740 2006-11-21 19:47 libpanelw.a lrwxrwxrwx 1 root root 26 2006-11-21 19:47 libpanelw.so -> ../../lib64/libpanelw.so.5 ACKNOWLEDGEMENTS: _________________ The original work to build ncursesw on LFS is by Alexander Patrakov. I have altered his instructions to match the slightly different way in which we build CLFS, and omitted the instructions for dealing with any binary applications linked agaisnt a non-wide-character ncurses library. CHANGELOG: __________ 2006-12-10 First version The home page for this hint is at http://www.kenmoffat.uklinux.net/hints/