[Users] Specifying CFLAGS during building

Chris Schrauben chrisretusn at gmail.com
Thu Jul 26 04:56:44 CEST 2018


On Thu, 26 Jul 2018 00:24:56 +0300
Removed GDPR <removed-gdpr at example.com> wrote:

> Hi,
> 
> I am using the attached short bash script to build CM
> from git source.
> 
> Recently I read about CFLAGS. My question is: where is
> the right place to specify CFLAGS in this script?
> Currently I have added them before autogen.sh but I
> don't know if that is correct.
> 
> Also - where can one read more about the various
> configure options? (--enable/--disable-something)
> 
> --
> George

Two ways to do this.
======
export CFLAGS="-O2 -pipe -march=native"
export CXXFLAGS="${CFLAGS}"

echo "█ Run configure"
./autogen.sh
./configure \
======

echo "█ Run configure"
./autogen.sh
CFLAGS="-O2 -pipe -march=native" \
CXXFLAGS="${CFLAGS}" \
./configure \
======

I use the second most often in my build scripts. Build scripts is the
Slackware way. <grin> 

Chris



More information about the Users mailing list