aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08/ncurses.xml
diff options
context:
space:
mode:
Diffstat (limited to 'chapter08/ncurses.xml')
-rw-r--r--chapter08/ncurses.xml26
1 files changed, 19 insertions, 7 deletions
diff --git a/chapter08/ncurses.xml b/chapter08/ncurses.xml
index b51099001..e8d286b6d 100644
--- a/chapter08/ncurses.xml
+++ b/chapter08/ncurses.xml
@@ -105,7 +105,9 @@
These wide-character libraries are usable in both multibyte and
traditional 8-bit locales, while normal libraries work properly
only in 8-bit locales. Wide-character and normal libraries are
- source-compatible, but not binary-compatible.</para>
+ source-compatible, but not binary-compatible: an application must
+ be recompiled with the proper preprocessor definitions before
+ being linked against the wide-character libraries.</para>
</listitem>
</varlistentry>
@@ -138,15 +140,25 @@ install -vm755 dest/usr/lib/libncursesw.so.&ncurses-version; /usr/lib
rm -v dest/usr/lib/libncursesw.so.&ncurses-version;
cp -av dest/* /</userinput></screen>
- <para>Many applications still expect the linker to be able to find
- non-wide-character Ncurses libraries. Trick such applications into linking with
- wide-character libraries by means of symlinks and linker scripts:</para>
+ <para>For applications looking up 8-bit Ncurses libraries via
+ <command>pkg-config</command>, create several symlinks so
+ <command>pkg-config</command> will output the information of the
+ wide-character Ncurses libraries instead. This is safe because
+ <command>pkg-config</command> also provides the <envar>CFLAGS</envar>,
+ including the preprocessor definitions needed to ensure the application
+ code compiled with the same ABI as the wide-character libraries:</para>
+
+ <!-- For apps directly using -lncurses w/o querying pkg-config, we
+ must tell them to use -D_XOPEN_SOURCE=600 and -lncursesw explicitly
+ to avoid an ABI mismatch. We shall handle them case by case. -->
<screen><userinput remap="install">for lib in ncurses form panel menu ; do
- rm -vf /usr/lib/lib${lib}.so
- echo "INPUT(-l${lib}w)" &gt; /usr/lib/lib${lib}.so
ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
done</userinput></screen>
+<!--
+
+ commented out because using libncursesw.so for libcurses.so is unsafe,
+ and there shouldn't be "old" apps searching for "libcursesw".
<para>Finally, make sure that old applications that look for
<filename class="libraryfile">-lcurses</filename> at build time are still
@@ -155,7 +167,7 @@ done</userinput></screen>
<screen><userinput remap="install">rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so</userinput></screen>
-
+-->
<para>If desired, install the Ncurses documentation:</para>
<screen><userinput remap="install">cp -v -R doc -T /usr/share/doc/ncurses-&ncurses-version;</userinput></screen>