Unix Technical Forum

CFLAGS or CXXFLAGS in SlackBuild

This is a discussion on CFLAGS or CXXFLAGS in SlackBuild within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> In most SlackBuild scripts there are following lines: CFLAGS="$SLKCFLAGS" \ ../configure \ $ARCH-slackware-linux But what if the application being ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 12:59 PM
Guybrush Threepwood
 
Posts: n/a
Default CFLAGS or CXXFLAGS in SlackBuild

In most SlackBuild scripts there are following lines:

CFLAGS="$SLKCFLAGS" \
../configure \
$ARCH-slackware-linux

But what if the application being compiled is written in C++. Does the C++
compiler pick upo the CFLAGS? Or is it necessary to specify CXXFLAGS?
And why isn't there an export of the CFLAGS necessary?

--
"Don't worry about people stealing your ideas. If your ideas are any
good, you'll have to ram them down people's throats."
-- Howard Aiken

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 01:00 PM
Olive
 
Posts: n/a
Default Re: CFLAGS or CXXFLAGS in SlackBuild

Guybrush Threepwood wrote:
> In most SlackBuild scripts there are following lines:
>
> CFLAGS="$SLKCFLAGS" \
> ./configure \
> $ARCH-slackware-linux
>
> But what if the application being compiled is written in C++. Does the C++
> compiler pick upo the CFLAGS? Or is it necessary to specify CXXFLAGS?


The build script for applications that are written in c++ use the
CXXFLAGS (see for example source/xap/xpdf/xpdf.SlackBuild). These
variables are usually documented by running ./configure --help

> And why isn't there an export of the CFLAGS necessary?
>


The backslash character means that the shell have to consider that it is
a single line; exactly as you type:

CFLAGS="$SLKCFLAGS" ./configure

The syntax

FOO=hello command

run the "command" by putting the variable FOO in its environment. It
does not put it in the environement of the commands that are run afterwards.

Olive


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 01:01 PM
Guybrush Threepwood
 
Posts: n/a
Default Re: CFLAGS or CXXFLAGS in SlackBuild

On Thu, 24 Nov 2005 16:55:56 +0100, Olive wrote:

> Guybrush Threepwood wrote:
>> In most SlackBuild scripts there are following lines:
>>
>> CFLAGS="$SLKCFLAGS" \
>> ./configure \
>> $ARCH-slackware-linux
>>
>> But what if the application being compiled is written in C++. Does the
>> C++ compiler pick upo the CFLAGS? Or is it necessary to specify
>> CXXFLAGS?

>
> The build script for applications that are written in c++ use the CXXFLAGS
> (see for example source/xap/xpdf/xpdf.SlackBuild). These variables are
> usually documented by running ./configure --help
>


When running ./configure --help I get this as last lines:

Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CXXCPP C++ preprocessor
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags

Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for
example)


> Olive


--
"Don't worry about people stealing your ideas. If your ideas are any
good, you'll have to ram them down people's throats."
-- Howard Aiken

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 01:01 PM
Olive
 
Posts: n/a
Default Re: CFLAGS or CXXFLAGS in SlackBuild

Guybrush Threepwood wrote:
> On Thu, 24 Nov 2005 16:55:56 +0100, Olive wrote:
>
>
>>Guybrush Threepwood wrote:
>>
>>>In most SlackBuild scripts there are following lines:
>>>
>>>CFLAGS="$SLKCFLAGS" \
>>>./configure \
>>> $ARCH-slackware-linux
>>>
>>>But what if the application being compiled is written in C++. Does the
>>>C++ compiler pick upo the CFLAGS? Or is it necessary to specify
>>>CXXFLAGS?

>>
>>The build script for applications that are written in c++ use the CXXFLAGS
>>(see for example source/xap/xpdf/xpdf.SlackBuild). These variables are
>>usually documented by running ./configure --help
>>

>
>
> When running ./configure --help I get this as last lines:
>
> Some influential environment variables:
> CC C compiler command
> CFLAGS C compiler flags
> LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
> nonstandard directory <lib dir>
> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
> headers in a nonstandard directory <include dir>
> CPP C preprocessor
> CXX C++ compiler command
> CXXFLAGS C++ compiler flags
> CXXCPP C++ preprocessor
> F77 Fortran 77 compiler command
> FFLAGS Fortran 77 compiler flags
>
> Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for
> example)


These flags are not directly used by the compiler but the Makefile use
it to pass command line option to the compiler. Simply run make and you
will see how the compiler is called. I think that this help is generic
and documents some flags even when it is not needed. For example in the
../configure --help of gimp-2.2.8; I see reference to flags to be passed
to the Fortran compiler and I am sure gimp does not use Fortran.

Olive


>
>
>
>>Olive

>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 01:01 PM
Guybrush Threepwood
 
Posts: n/a
Default Re: CFLAGS or CXXFLAGS in SlackBuild

On Fri, 25 Nov 2005 17:57:01 +0100, Olive wrote:

> Guybrush Threepwood wrote:
>>
>> When running ./configure --help I get this as last lines:
>>
>> Some influential environment variables:
>> CC C compiler command
>> CFLAGS C compiler flags
>> LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
>> nonstandard directory <lib dir>
>> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
>> headers in a nonstandard directory <include dir>
>> CPP C preprocessor
>> CXX C++ compiler command
>> CXXFLAGS C++ compiler flags
>> CXXCPP C++ preprocessor
>> F77 Fortran 77 compiler command FFLAGS Fortran 77
>> compiler flags
>>
>> Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for
>> example)

>
> These flags are not directly used by the compiler but the Makefile use it
> to pass command line option to the compiler. Simply run make and you will
> see how the compiler is called. I think that this help is generic and
> documents some flags even when it is not needed. For example in the
> ./configure --help of gimp-2.2.8; I see reference to flags to be passed to
> the Fortran compiler and I am sure gimp does not use Fortran.
>
> Olive


So I just look if the compiler(s) gets called with the options I like, and
if not, I alter the variables?

--
"Don't worry about people stealing your ideas. If your ideas are any
good, you'll have to ram them down people's throats."
-- Howard Aiken

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 01:01 PM
olive
 
Posts: n/a
Default Re: CFLAGS or CXXFLAGS in SlackBuild

Guybrush Threepwood wrote:
> On Fri, 25 Nov 2005 17:57:01 +0100, Olive wrote:
>
>
>>Guybrush Threepwood wrote:
>>
>>>When running ./configure --help I get this as last lines:
>>>
>>>Some influential environment variables:
>>> CC C compiler command
>>> CFLAGS C compiler flags
>>> LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
>>> nonstandard directory <lib dir>
>>> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
>>> headers in a nonstandard directory <include dir>
>>> CPP C preprocessor
>>> CXX C++ compiler command
>>> CXXFLAGS C++ compiler flags
>>> CXXCPP C++ preprocessor
>>> F77 Fortran 77 compiler command FFLAGS Fortran 77
>>> compiler flags
>>>
>>>Does this mean that CFLAGS and CXXFLAGS are both to be set to -02 (for
>>>example)

>>
>>These flags are not directly used by the compiler but the Makefile use it
>>to pass command line option to the compiler. Simply run make and you will
>>see how the compiler is called. I think that this help is generic and
>>documents some flags even when it is not needed. For example in the
>>./configure --help of gimp-2.2.8; I see reference to flags to be passed to
>>the Fortran compiler and I am sure gimp does not use Fortran.
>>
>>Olive

>
>
> So I just look if the compiler(s) gets called with the options I like, and
> if not, I alter the variables?
>


Simply yes. Of course, if you need something more special, you will need
to alter the Makefile.

Olive
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:43 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com