Unix Technical Forum

Storing CFLAGS and other compiler settings in Slackware

This is a discussion on Storing CFLAGS and other compiler settings in Slackware within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I know there's a file in /etc for gentoo that lets one keep their cflags settings stored so they ...


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-19-2008, 02:39 PM
r_jensen11
 
Posts: n/a
Default Storing CFLAGS and other compiler settings in Slackware

I know there's a file in /etc for gentoo that lets one keep their
cflags settings stored so they don't have to keep on manually
entering them each time they want to compile a new program. I also
know that I did something like this once in Slack, but I just don't
remember how to do it now (had to reformat, System Tools apparently
doesn't like to properly resize ReiserFS partitions....)

Anyway, what I've done so far is creat a file called ~/.bash_profile
for one of my users, and here's what's in that file:

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="march=pentium4 -O3 -pipe -fomit-frame-pointer"
export CHOST
export CFLAGS
export CXXFLAGS

since I'm on a P4 computer, I'm trying to optimize this puppy for my
architecture. Now is there anything else I have to do? Keep in mind
that all I've done is create this file, nothing more.

Thanks for the help

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 02:39 PM
Thomas Ronayne
 
Posts: n/a
Default Re: Storing CFLAGS and other compiler settings in Slackware

You could stick these in /etc/profile and they'll be available to anyone
who logs in, always.

r_jensen11 wrote:

>I know there's a file in /etc for gentoo that lets one keep their
>cflags settings stored so they don't have to keep on manually
>entering them each time they want to compile a new program. I also
>know that I did something like this once in Slack, but I just don't
>remember how to do it now (had to reformat, System Tools apparently
>doesn't like to properly resize ReiserFS partitions....)
>
>Anyway, what I've done so far is creat a file called ~/.bash_profile
>for one of my users, and here's what's in that file:
>
>CHOST="i686-pc-linux-gnu"
>CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
>CXXFLAGS="march=pentium4 -O3 -pipe -fomit-frame-pointer"
>export CHOST
>export CFLAGS
>export CXXFLAGS
>
>since I'm on a P4 computer, I'm trying to optimize this puppy for my
>architecture. Now is there anything else I have to do? Keep in mind
>that all I've done is create this file, nothing more.
>
>Thanks for the help
>
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 02:40 PM
Stuart Winter
 
Posts: n/a
Default Re: Storing CFLAGS and other compiler settings in Slackware

On 11 Aug 2004 18:12:43 -0500, r_jensen11@yahoo-dot-com.no-spam.invalid wrote:

> CHOST="i686-pc-linux-gnu"


Do you really have a toolchain called this or do you have i486-slackware-linux?
In most configure scripts they will work out that what you have specified is crap
and will default to using the generic tool names, but you won't be lucky all
of the time.

> CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"


There is a reason -O3 isn't used everywhere - it's because sometimes it causes
the compiler to crash (although IME this usually happens when building for
non x86). When Patrick considers -O3 'safe' for a particular piece of software
he uses it.

--
Stuart Winter
www.interlude.org.uk & www.armedslack.org
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 10:48 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