From f8b27abcda6fd5beaaf3f57ae31da4878b5aca0e Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Wed, 29 Jun 2022 14:08:29 +0200 Subject: [PATCH] Generate shared C++ bindings for ncurses Presently we let the build system generate static C++ bindings, and then we remove them. Note that we could also prevent generating any C++ binding, since nothing in LFS/BLFS use them, but it seems to me that generating the shared ones is closer to what is done for other packages. --- chapter01/changelog.xml | 10 +++++++++ chapter06/ncurses.xml | 46 ++++++++++++++++++++++++++++--------- chapter08/ncurses.xml | 50 ++++++++++++++++++++++++++++++----------- 3 files changed, 82 insertions(+), 24 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index c1ac5a88c..73d614768 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,16 @@ appropriate for the entry or if needed the entire day's listitem. --> + + 2022-06-29 + + + [pierre] - Generate shared C++ bindings for ncurses, instead + of generating and then removing the static ones. + + + + 2022-06-14 diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index 34426d4b7..d9457c081 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -65,9 +65,10 @@ popd --mandir=/usr/share/man \ --with-manpage-format=normal \ --with-shared \ + --without-normal \ + --with-cxx-shared \ --without-debug \ --without-ada \ - --without-normal \ --disable-stripping \ --enable-widec @@ -83,6 +84,37 @@ popd + + --with-shared + + This makes Ncurses build and install shared C libraries. + + + + + --without-normal + + This prevents Ncurses building and installing static C + libraries. + + + + + --without-debug + + This prevents Ncurses building and installing debug + libraries. + + + + + --with-cxx-shared + + This makes Ncurses build and install shared C++ bindings. It + also prevents it building and installing static C++ bindings. + + + --without-ada @@ -115,14 +147,6 @@ popd - - --without-normal - - This switch disables building and installing most static libraries. - - - - Compile the package: @@ -133,12 +157,12 @@ popd make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so - + The meaning of the install options: diff --git a/chapter08/ncurses.xml b/chapter08/ncurses.xml index 64e7c7653..31cd65a6c 100644 --- a/chapter08/ncurses.xml +++ b/chapter08/ncurses.xml @@ -48,6 +48,7 @@ --with-shared \ --without-debug \ --without-normal \ + --with-cxx-shared \ --enable-pc-files \ --enable-widec \ --with-pkg-config-libdir=/usr/lib/pkgconfig @@ -56,16 +57,33 @@ The meaning of the new configure options: - --enable-widec + --with-shared - This switch causes wide-character libraries (e.g., libncursesw.so.&ncurses-version;) - to be built instead of normal ones (e.g., libncurses.so.&ncurses-version;). - 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. + This makes Ncurses build and install shared C libraries. + + + + + --without-normal + + This prevents Ncurses building and installing static C + libraries. + + + + + --without-debug + + This prevents Ncurses building and installing debug + libraries. + + + + + --with-cxx-shared + + This makes Ncurses build and install shared C++ bindings. It + also prevents it building and installing static C++ bindings. @@ -78,10 +96,16 @@ - --without-normal + --enable-widec - This switch disables building and installing most static libraries. - + This switch causes wide-character libraries (e.g., libncursesw.so.&ncurses-version;) + to be built instead of normal ones (e.g., libncurses.so.&ncurses-version;). + 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. @@ -112,7 +136,7 @@ make DESTDIR=$PWD/dest install install -vm755 dest/usr/lib/libncursesw.so.&ncurses-version; /usr/lib -rm -v dest/usr/lib/{libncursesw.so.&ncurses-version;,libncurses++w.a} +rm -v dest/usr/lib/libncursesw.so.&ncurses-version; cp -av dest/* / Many applications still expect the linker to be able to find