Changeset dc7fd7b


Ignore:
Timestamp:
01/12/2018 07:04:19 PM (6 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
ablfs-more, legacy, trunk
Children:
2e1c1c3
Parents:
5637b53
Message:

Add .la file removal to LFS and BLFS scripts

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • BLFS/gen_pkg_book.sh

    r5637b53 rdc7fd7b  
    5151      MAIL_SERVER=*   | \
    5252      WRAP_INSTALL=*  | \
     53      DEL_LA_FILES=*  | \
    5354      SUDO=*  )  eval ${REPLY} # Define/set a global variable..
    5455                      continue ;;
     
    7071  SUDO=${SUDO:-n}
    7172  WRAP_INSTALL=${WRAP_INSTALL:-n}
     73  DEL_LA_FILES=${DEL_LA_FILES:-n}
    7274}
    7375
     
    7678#--------------------------#
    7779  local -r dotSTR=".................."
    78   local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL"
     80  local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER WRAP_INSTALL DEL_LA_FILES"
    7981  local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
    8082  local config_param
     
    190192         --stringparam sudo "$SUDO" \
    191193         --stringparam wrap-install "$WRAP_INSTALL" \
     194         --stringparam del-la-files "$DEL_LA_FILES" \
    192195         -o ./scripts/ ${MakeScripts} \
    193196         ${BookXml}
  • BLFS/xsl/gen_config.xsl

    r5637b53 rdc7fd7b  
    6969                where wrapInstall is used to set up a LD_PRELOAD library (for
    7070                example using porg), and packInstall makes the package tarball
     71
     72config  DEL_LA_FILES
     73        bool "Remove libtool .la files after package installation"
     74        default y
     75        help
     76                This option should be active on any system mixing libtool
     77                and meson build systems. ImageMagick .la files are preserved.
    7178</xsl:text>
    7279  </xsl:template>
  • BLFS/xsl/scripts.xsl

    r5637b53 rdc7fd7b  
    2626  <xsl:param name="wrap-install" select="'n'"/>
    2727
     28  <!-- Remove libtool .la files -->
     29  <xsl:param name="del-la-files" select="'y'"/>
     30
    2831  <!-- Build as user (y) or as root (n)? -->
    2932  <xsl:param name="sudo" select="'y'"/>
    3033
     34<!-- simple instructions for removing .la files. -->
     35  <xsl:variable name="la-files-instr">
     36
     37for libdir in /lib /usr/lib $(find /opt -name lib); do
     38  find $libdir -name \*.la ! -path \*ImageMagick\* -delete
     39done
     40
     41</xsl:variable>
    3142  <xsl:template match="/">
    3243    <xsl:apply-templates select="//sect1"/>
     
    432443          <xsl:apply-templates mode="root"/>
    433444          <xsl:if test="not(following-sibling::screen[1][@role='root'])">
     445            <xsl:if test="$del-la-files = 'y' and
     446                          ancestor::sect2[@role='installation']">
     447              <xsl:call-template name="output-root">
     448                <xsl:with-param name="out-string" select="$la-files-instr"/>
     449              </xsl:call-template>
     450            </xsl:if>
    434451            <xsl:if test="$wrap-install = 'y' and
    435452                          ancestor::sect2[@role='installation']">
  • Config.in

    r5637b53 rdc7fd7b  
    932932        depends on !BOOK_CLFS3
    933933
     934    config    DEL_LA_FILES
     935        bool "Remove libtool .la files
     936        default y
     937        help
     938            #-- Remove files libxxx.la installed by libtool. For a rationale
     939            #   see https://blog.flameeyes.eu/tags/lafiles/
     940
    934941    config    NO_PROGRESS_BAR
    935942        bool "DO NOT use/display progress_bar "
  • LFS/lfs.xsl

    r5637b53 rdc7fd7b  
    4545  <xsl:param name="vim-lang" select="'n'"/>
    4646 
     47  <!-- Should we strip excutables and libraries? -->
     48  <xsl:param name='strip' select="'n'"/>
     49
     50  <!-- Should we remove .la files after chapter 5 and chapter 6? -->
     51  <xsl:param name='del-la-files' select="'y'"/>
     52
    4753  <!-- Time zone -->
    4854  <xsl:param name="timezone" select="'GMT'"/>
     
    233239                            @revision=$revision)]/userinput[@remap = 'install']"/>
    234240    <xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
    235                   $pkgmngt = 'y' and
    236241                  descendant::screen[not(@role) or
    237242                                     @role != 'nodump']/userinput[
    238243                                                       @remap='install']">
    239244      <xsl:choose>
     245        <xsl:when test="$pkgmngt='n'"/>
    240246        <xsl:when test="$wrap-install='y'">
    241247          <xsl:if test="../@id = 'ch-system-man-pages'">
     
    418424      </xsl:when>
    419425<!-- End of test instructions -->
    420       <!-- Don't stop on strip run -->
    421       <xsl:when test="contains(string(),'strip ')">
    422         <xsl:apply-templates/>
    423         <xsl:text> || true&#xA;</xsl:text>
     426<!-- If the instructions contain "strip ", it may mean they contain also .la
     427     file removal (and possibly other clean up). We therefore call a template
     428     to comment them out appropriately and also to not stop if stripping
     429     fails. -->
     430      <xsl:when test="contains(string(),'strip ') or
     431                      contains(string(),'\*.la')">
     432        <xsl:call-template name="comment-strip">
     433          <xsl:with-param name="instructions" select="string()"/>
     434        </xsl:call-template>
    424435      </xsl:when>
    425436<!-- Package management -->
     
    481492          </xsl:otherwise>
    482493        </xsl:choose>
    483       </xsl:when>
     494      </xsl:when> <!-- @remap='install' -->
    484495      <!-- if package management, we should make an independant package for
    485496           tzdata. -->
     
    882893  </xsl:template>
    883894
     895  <xsl:template name="comment-strip">
     896    <xsl:param name="instructions" select="''"/>
     897    <xsl:choose>
     898      <xsl:when test="contains($instructions,'&#xA;')">
     899        <xsl:call-template name="comment-strip">
     900          <xsl:with-param name="instructions"
     901                          select="substring-before($instructions,'&#xA;')"/>
     902        </xsl:call-template>
     903        <xsl:call-template name="comment-strip">
     904          <xsl:with-param name="instructions"
     905                          select="substring-after($instructions,'&#xA;')"/>
     906        </xsl:call-template>
     907      </xsl:when>
     908      <xsl:when test="contains($instructions,'\*.la')">
     909        <xsl:if test="$del-la-files='n'">
     910          <xsl:text># </xsl:text>
     911        </xsl:if>
     912        <xsl:value-of select="$instructions"/>
     913        <xsl:text>&#xA;</xsl:text>
     914      </xsl:when>
     915      <xsl:when test="contains($instructions,'strip ')">
     916        <xsl:if test="$strip='n'">
     917          <xsl:text># </xsl:text>
     918        </xsl:if>
     919        <xsl:value-of select="$instructions"/>
     920        <xsl:text> || true&#xA;</xsl:text>
     921      </xsl:when>
     922      <xsl:otherwise>
     923        <xsl:value-of select="$instructions"/>
     924        <xsl:text>&#xA;</xsl:text>
     925      </xsl:otherwise>
     926    </xsl:choose>
     927  </xsl:template>
     928
    884929  <xsl:template name="comment-test">
    885930    <xsl:param name="instructions" select="''"/>
  • LFS/master.sh

    r5637b53 rdc7fd7b  
    8686#      *dejagnu)   [[ "${TEST}" = "0" ]] && continue ;;
    8787#      *check)     [[ "${TEST}" = "0" ]] && continue ;;
    88       *stripping) [[ "${STRIP}" = "n" ]] && continue ;;
     88# We now do that in LFS.xsl, because stripping.xml contains other cleaning
     89# instructions
     90#      *stripping) [[ "${STRIP}" = "n" ]] && continue ;;
    8991      *glibc)     [[ "${TEST}" = "3" ]] && \
    9092                  sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
  • common/libs/func_book_parser

    r5637b53 rdc7fd7b  
    171171                 --stringparam bomb-testsuite "$BOMB_TEST"    \
    172172                 --stringparam vim-lang       "$VIMLANG"      \
     173                 --stringparam strip          "$STRIP"        \
     174                 --stringparam del-la-files   "$DEL_LA_FILES" \
    173175                 --stringparam full-locale    "$FULL_LOCALE"  \
    174176                 --stringparam timezone       "$TIMEZONE"     \
  • common/libs/func_install_blfs

    r5637b53 rdc7fd7b  
    132132SUDO=n
    133133WRAP_INSTALL=$WRAP_INSTALL
     134DEL_LA_FILES=$DEL_LA_FILES
    134135EOF
    135136
  • common/libs/func_validate_configs.sh

    r5637b53 rdc7fd7b  
    4242
    4343  # Build Settings by book
    44   local -r   LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL"
     44  local -r   LFS_build="$BUILD_chroot VIMLANG DEL_LA_FILES $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL"
    4545  local -r  HLFS_build="$BUILD_chroot         $BUILD_common"
    4646  local -r  CLFS_build="$BUILD_chroot VIMLANG $BUILD_common"
  • jhalfs

    r5637b53 rdc7fd7b  
    130130REPORT=${REPORT:=n}
    131131VIMLANG=${VIMLANG:-n}
     132DEL_LA_FILES=${DEL_LA_FILES:-n}
    132133FULL_LOCALE=${FULL_LOCALE:-n}
    133134GRSECURITY_HOST=${GRSECURITY_HOST:-n}
Note: See TracChangeset for help on using the changeset viewer.