Changeset f4302700


Ignore:
Timestamp:
03/04/2021 09:56:47 AM (3 years ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.0, 11.1, 11.2, 11.3, 12.0, 12.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
f3634b6
Parents:
5d2965c
Message:

CFLAGS/CPPFLAGS cleanup

Move -I and -D into CPPFLAGS, and for others use ${CFLAGS:--O2 -g} to
prevent from building "non-optimized" binary.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24334 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
15 edited

Legend:

Unmodified
Added
Removed
  • general/prog/clisp.xml

    r5d2965c rf4302700  
    113113
    114114<screen><userinput remap="pre">case $(uname -m) in
    115     i?86) export CFLAGS+=-falign-functions=4 ;;
     115    i?86) export CFLAGS="${CFLAGS:--O2 -g} -falign-functions=4" ;;
    116116esac</userinput></screen>
    117117
  • gnome/applications/evince.xml

    r5d2965c rf4302700  
    129129    </para>
    130130
    131 <screen><userinput remap="pre">export CFLAGS="$CFLAGS -I/opt/texlive/&texlive-year;/include" &amp;&amp;
    132 export CXXFLAGS="$CXXFLAGS -I/opt/texlive/&texlive-year;/include" &amp;&amp;
     131<screen><userinput remap="pre">export CPPFLAGS="-I/opt/texlive/&texlive-year;/include" &amp;&amp;
    133132export LDFLAGS="$LDFLAGS -L/opt/texlive/&texlive-year;/lib"</userinput></screen>
    134133
     
    175174    -->
    176175
    177 <!-- When moving to Meson, I installed the whole texlive suite from source.
    178      I was able to verify that this is no longer required. I'm assuming it was
    179      one of evince-3.36.3 or texlive-2020 that fixed this.
    180     <para>
    181       <parameter>CFLAGS="$CFLAGS ..." CXXFLAGS="$CXXFLAGS ..." LDFLAGS="$LDFLAGS ..."</parameter>: If
     176    <para>
     177      <parameter>CPPFLAGS="..." LDFLAGS="$LDFLAGS ..."</parameter>: If
    182178      <application>TeXLive</application> has been installed in
    183179      <filename class="directory">/opt/texlive-&texlive-year;</filename> the
     
    188184      build.
    189185    </para>
    190 -->
     186
    191187    <para>
    192188      <parameter>-Dgtk_doc=false</parameter>: This switch disables generating
  • multimedia/libdriv/audiofile.xml

    r5d2965c rf4302700  
    103103    </para>
    104104
    105 <screen><userinput>CXXFLAGS=-std=c++98 \
     105<screen><userinput>CXXFLAGS="${CXXFLAGS:--O2 -g} -std=c++98" \
    106106./configure --prefix=/usr --disable-static &amp;&amp;
    107107
  • multimedia/libdriv/liba52.xml

    r5d2965c rf4302700  
    9494            --enable-shared \
    9595            --disable-static \
    96             CFLAGS="-g -O2 $([ $(uname -m) = x86_64 ] &amp;&amp; echo -fPIC)" &amp;&amp;
     96            CFLAGS="${CFLAGS:--g -O2} $([ $(uname -m) = x86_64 ] &amp;&amp; echo -fPIC)" &amp;&amp;
    9797make</userinput></screen>
    9898
  • multimedia/libdriv/libmusicbrainz.xml

    r5d2965c rf4302700  
    114114<screen><userinput>patch -Np1 -i ../libmusicbrainz-&libmusicbrainz-version;-missing-includes-1.patch &amp;&amp;
    115115
    116 CXXFLAGS=-std=c++98 \
     116CXXFLAGS="${CXXFLAGS:--O2 -g} -std=c++98" \
    117117./configure --prefix=/usr --disable-static &amp;&amp;
    118118make</userinput></screen>
  • multimedia/videoutils/vlc.xml

    r5d2965c rf4302700  
    231231<!--
    232232<screen><userinput>sed -i '/vlc_demux.h/a #define LUA_COMPAT_APIINTCASTS' modules/lua/vlc.h   &amp;&amp;-->
    233 <screen><userinput>export LUAC=/usr/bin/luac5.2                 &amp;&amp;
    234 export LUA_LIBS="$(pkg-config --libs lua52)" &amp;&amp;
    235 export CFLAGS="$(pkg-config --cflags lua52)" &amp;&amp;
     233<screen><userinput>export LUAC=/usr/bin/luac5.2                   &amp;&amp;
     234export LUA_LIBS="$(pkg-config --libs lua52)"   &amp;&amp;
     235export CPPFLAGS="$(pkg-config --cflags lua52)" &amp;&amp;
    236236
    237237BUILDCC=gcc ./configure --prefix=/usr    \
  • networking/netprogs/ntp.xml

    r5d2965c rf4302700  
    136136        Its a "hack" for gcc-10
    137137-->
    138 <screen><userinput>./configure CFLAGS="-O2 -g -fPIC -fcommon $CFLAGS" \
     138<screen><userinput>./configure CFLAGS="${CFLAGS:--O2 -g} -fPIC -fcommon" \
    139139            --prefix=/usr         \
    140140            --bindir=/usr/sbin    \
  • networking/netprogs/samba.xml

    r5d2965c rf4302700  
    186186    </para>
    187187
    188 <screen revision="sysv"><userinput>CFLAGS="-I/usr/include/tirpc"          \
     188<screen revision="sysv"><userinput>CPPFLAGS="-I/usr/include/tirpc"        \
    189189LDFLAGS="-ltirpc"                      \
    190190./configure                            \
     
    200200make</userinput></screen>
    201201
    202 <screen revision="systemd"><userinput>CFLAGS="-I/usr/include/tirpc"          \
     202<screen revision="systemd"><userinput>CPPFLAGS="-I/usr/include/tirpc"        \
    203203LDFLAGS="-ltirpc"                      \
    204204./configure                            \
  • postlfs/filesystems/sshfs.xml

    r5d2965c rf4302700  
    9696  <sect2 role="installation">
    9797    <title>Installation of Sshfs</title>
    98     <!--
    99     <para>
    100       If you are building on i686, <application>sshfs</application> needs
    101       an extra CFLAGS setting to be defined. This prevents an integer
    102       overflow. To do this, run the following command:
    103     </para>
    104 
    105 <screen><userinput>if [ $(uname -m) = "i686" ]; then
    106   export CFLAGS+="-D_FILE_OFFSET_BITS=64";
    107 fi</userinput></screen>
    108     -->
    10998
    11099    <para>
  • pst/sgml/openjade.xml

    r5d2965c rf4302700  
    115115    </para>
    116116
    117 <screen><userinput>export CXXFLAGS="$CXXFLAGS -fno-lifetime-dse"            &amp;&amp;
     117<screen><userinput>export CXXFLAGS="${CXXFLAGS:--O2 -g} -fno-lifetime-dse"            &amp;&amp;
    118118./configure --prefix=/usr                                \
    119119            --mandir=/usr/share/man                      \
  • server/mail/dovecot.xml

    r5d2965c rf4302700  
    135135    </para>
    136136
    137 <screen revision="sysv"><userinput>CFLAGS+=" -I/usr/include/tirpc" \
     137<screen revision="sysv"><userinput>CPPFLAGS="-I/usr/include/tirpc" \
    138138LDFLAGS+=" -ltirpc" \
    139139./configure --prefix=/usr                          \
     
    145145make</userinput></screen>
    146146
    147 <screen revision="systemd"><userinput>CFLAGS+=" -I/usr/include/tirpc" \
     147<screen revision="systemd"><userinput>CPPFLAGS="-I/usr/include/tirpc" \
    148148LDFLAGS+=" -ltirpc" \
    149149./configure --prefix=/usr                          \
     
    174174
    175175    <para>
    176       <command>CFLAGS+=...LDFLAGS+=...</command>: build with libtirpc
     176      <command>CPPFLAGS=... LDFLAGS+=...</command>: build with libtirpc
    177177      instead of the recently removed RPC code provided by GlibC.
    178178    </para>
  • x/dm/lightdm.xml

    r5d2965c rf4302700  
    262262      <command>configure</command> throws an error if it is not found on the
    263263      system. This parameter prevents the error.
    264     </para>
    265 
    266     <para>
    267       <parameter>CFLAGS=...</parameter>: those two switches ensures some
    268       warnings are not treated as errors.
    269264    </para>
    270265
  • x/lib/gtkmm2.xml

    r5d2965c rf4302700  
    116116  </sect2>
    117117
    118 <!-- as of 2.24.5, this is no longer needed. -renodr
    119   <sect2 role="commands">
    120     <title>Command Explanations</title>
    121 
    122     <para>
    123       <command>CXXFLAGS="-g -O2 -std=c++11" ./configure...</command>: while
    124       Gtkmm-&gtkmm2-version; has not yet been ported to the 2011 ISO C++
    125       standard, all its dependencies have. <command>-std=c++11</command> has
    126       to be used as an option to <command>g++</command>. We pass it into
    127       <envar>CXXFLAGS</envar> together with the default options.
    128     </para>
    129 
    130   </sect2>
    131 -->
    132 
    133118  <sect2 role="content">
    134119    <title>Contents</title>
  • xsoft/other/thunderbird.xml

    r5d2965c rf4302700  
    186186ac_add_options --with-system-nss
    187187ac_add_options --with-system-icu
    188 <!--Not with libvpx-1.8.0 or later
    189 ac_add_options - -with-system-libvpx
    190 ====
    191 These do not seem to be needed any more
    192 # Set CFLAGS and CXXFLAGS to prevent segfaults due to aggressive
    193 # optimizations in GCC-6:
    194 export CFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
    195 export CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
    196 -->
    197188# The elf-hack causes failed installs on some machines.
    198189# It is supposed to improve startup time and it shrinks libxul.so
  • xsoft/other/tigervnc.xml

    r5d2965c rf4302700  
    179179  autoreconf -fiv  &amp;&amp;
    180180
    181   CFLAGS="$CFLAGS -I/usr/include/drm" \
     181  CPPFLAGS="-I/usr/include/drm"      \
    182182  ./configure $XORG_CONFIG            \
    183183      --disable-xwayland    --disable-dri        --disable-dmx         \
Note: See TracChangeset for help on using the changeset viewer.