From dc7fd7b7bafa287dad8dd54df9b4814ef6a9f16c Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Fri, 12 Jan 2018 19:04:19 +0000 Subject: [PATCH] Add .la file removal to LFS and BLFS scripts --- BLFS/gen_pkg_book.sh | 5 ++- BLFS/xsl/gen_config.xsl | 7 ++++ BLFS/xsl/scripts.xsl | 17 +++++++++ Config.in | 7 ++++ LFS/lfs.xsl | 57 +++++++++++++++++++++++++--- LFS/master.sh | 4 +- common/libs/func_book_parser | 2 + common/libs/func_install_blfs | 1 + common/libs/func_validate_configs.sh | 2 +- jhalfs | 1 + 10 files changed, 94 insertions(+), 9 deletions(-) diff --git a/BLFS/gen_pkg_book.sh b/BLFS/gen_pkg_book.sh index f978074..16341d1 100755 --- a/BLFS/gen_pkg_book.sh +++ b/BLFS/gen_pkg_book.sh @@ -50,6 +50,7 @@ parse_configuration() { # optDependency=* | \ MAIL_SERVER=* | \ WRAP_INSTALL=* | \ + DEL_LA_FILES=* | \ SUDO=* ) eval ${REPLY} # Define/set a global variable.. continue ;; esac @@ -69,13 +70,14 @@ parse_configuration() { # DEP_LEVEL=$optDependency SUDO=${SUDO:-n} WRAP_INSTALL=${WRAP_INSTALL:-n} + DEL_LA_FILES=${DEL_LA_FILES:-n} } #--------------------------# validate_configuration() { # #--------------------------# local -r dotSTR=".................." - local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL" + local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL DEL_LA_FILES" local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' local config_param local -i index @@ -189,6 +191,7 @@ rm -rf scripts xsltproc --xinclude --nonet \ --stringparam sudo "$SUDO" \ --stringparam wrap-install "$WRAP_INSTALL" \ + --stringparam del-la-files "$DEL_LA_FILES" \ -o ./scripts/ ${MakeScripts} \ ${BookXml} # Make the scripts executable. diff --git a/BLFS/xsl/gen_config.xsl b/BLFS/xsl/gen_config.xsl index 9a4f2a0..d2c66ec 100644 --- a/BLFS/xsl/gen_config.xsl +++ b/BLFS/xsl/gen_config.xsl @@ -68,6 +68,13 @@ config WRAP_INSTALL between "wrapInstall '" and "' ; packInstall" functions, where wrapInstall is used to set up a LD_PRELOAD library (for example using porg), and packInstall makes the package tarball + +config DEL_LA_FILES + bool "Remove libtool .la files after package installation" + default y + help + This option should be active on any system mixing libtool + and meson build systems. ImageMagick .la files are preserved. diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl index 663a488..ba38e3e 100644 --- a/BLFS/xsl/scripts.xsl +++ b/BLFS/xsl/scripts.xsl @@ -25,9 +25,20 @@ "porg style" package management --> + + + + + + +for libdir in /lib /usr/lib $(find /opt -name lib); do + find $libdir -name \*.la ! -path \*ImageMagick\* -delete +done + + @@ -431,6 +442,12 @@ wrapInstall ' + + + + + ' packInstall diff --git a/Config.in b/Config.in index dde3c56..aa2b717 100644 --- a/Config.in +++ b/Config.in @@ -931,6 +931,13 @@ depends !BOOK_BLFS default n depends on !BOOK_CLFS3 + config DEL_LA_FILES + bool "Remove libtool .la files + default y + help + #-- Remove files libxxx.la installed by libtool. For a rationale + # see https://blog.flameeyes.eu/tags/lafiles/ + config NO_PROGRESS_BAR bool "DO NOT use/display progress_bar " default n diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl index f0d4bb0..ec17ac7 100644 --- a/LFS/lfs.xsl +++ b/LFS/lfs.xsl @@ -44,6 +44,12 @@ + + + + + + @@ -232,11 +238,11 @@ esac (not(@revision) or @revision=$revision)]/userinput[@remap = 'install']"/> + @@ -417,10 +423,15 @@ exit - - - - || true + + + + + @@ -480,7 +491,7 @@ exit - + @@ -881,6 +892,40 @@ DNS= + + + + + + + + + + + + + + # + + + + + + + # + + + || true + + + + + + + + diff --git a/LFS/master.sh b/LFS/master.sh index b6186b5..2643367 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -85,7 +85,9 @@ chapter5_Makefiles() { # *expect) [[ "${TEST}" = "0" ]] && continue ;; # *dejagnu) [[ "${TEST}" = "0" ]] && continue ;; # *check) [[ "${TEST}" = "0" ]] && continue ;; - *stripping) [[ "${STRIP}" = "n" ]] && continue ;; +# We now do that in LFS.xsl, because stripping.xml contains other cleaning +# instructions +# *stripping) [[ "${STRIP}" = "n" ]] && continue ;; *glibc) [[ "${TEST}" = "3" ]] && \ sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;; esac diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser index 16818ce..bb53e31 100644 --- a/common/libs/func_book_parser +++ b/common/libs/func_book_parser @@ -170,6 +170,8 @@ extract_commands() { # --stringparam testsuite "$TEST" \ --stringparam bomb-testsuite "$BOMB_TEST" \ --stringparam vim-lang "$VIMLANG" \ + --stringparam strip "$STRIP" \ + --stringparam del-la-files "$DEL_LA_FILES" \ --stringparam full-locale "$FULL_LOCALE" \ --stringparam timezone "$TIMEZONE" \ --stringparam page "$PAGE" \ diff --git a/common/libs/func_install_blfs b/common/libs/func_install_blfs index 9b3a583..d8ee939 100644 --- a/common/libs/func_install_blfs +++ b/common/libs/func_install_blfs @@ -131,6 +131,7 @@ MAIL_SERVER=sendmail optDependency=2 SUDO=n WRAP_INSTALL=$WRAP_INSTALL +DEL_LA_FILES=$DEL_LA_FILES EOF # Generates the scripts for the blfs tools dependencies (in ./scripts) diff --git a/common/libs/func_validate_configs.sh b/common/libs/func_validate_configs.sh index 819758e..9cf7ea7 100644 --- a/common/libs/func_validate_configs.sh +++ b/common/libs/func_validate_configs.sh @@ -41,7 +41,7 @@ inline_doc local -r CLFS3_book="$BOOK_common $BOOK_clfsX PLATFORM MIPS_LEVEL" # Build Settings by book - local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL" + local -r LFS_build="$BUILD_chroot VIMLANG DEL_LA_FILES $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL" local -r HLFS_build="$BUILD_chroot $BUILD_common" local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common" local -r CLFS2_build="STRIP VIMLANG $BUILD_common" diff --git a/jhalfs b/jhalfs index 4a81c3a..97687ed 100755 --- a/jhalfs +++ b/jhalfs @@ -129,6 +129,7 @@ BOMB_TEST=${BOMB_TEST:-n} STRIP=${STRIP:=n} REPORT=${REPORT:=n} VIMLANG=${VIMLANG:-n} +DEL_LA_FILES=${DEL_LA_FILES:-n} FULL_LOCALE=${FULL_LOCALE:-n} GRSECURITY_HOST=${GRSECURITY_HOST:-n} CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}