LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-10-2012, 01:30 PM   #1
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Question Sbopkg : building a queue file with CFLAGS and CXXFLAGS set.


Hi.

I wonder how to build a queue file without having to edit each slackbuild to include custom CFLAGS and CXXFLAGS.

Do i simply need to make an export ?
 
Old 03-10-2012, 02:52 PM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
you can export your own SLKCFLAGS and export ARCH to soemthing that is not handled by default int the slackbuild files or use sed to replace SLKCFLAGS to what you want
 
Old 03-10-2012, 03:46 PM   #3
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
Is SLKCFLAGS the sbo env variable ?
 
Old 03-11-2012, 11:07 AM   #4
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
look at the build scripts

normaly you have something like this
Code:
if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi
and later
Code:
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
... whatever
so you may prefer sed cause as you see it is possible that there will be default values if ARCH is unknown and than you have no chance to overwrite/set your own (SLKC/C/CXX)FLAGS

this is somehow a bug in my opinion,
better would be for example
SLKCFLAGS=${SLKCFLAGS:-"-O2 -march=i486 -mtune=i686"}

but I never cared about that cause for these binaries where my own flags are important I have my own buildscripts anyway
and it is the way how slackbuilds are written, so I think this will never change, but since they are all equal, sed -i is your friend
 
Old 03-11-2012, 10:24 PM   #5
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Original Poster
Rep: Reputation: 100Reputation: 100
Ok.

I wondered about this because, as you said, all Slackbuilds have not the same options.

Thank you.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dount on Queue files and Sbopkg vikrang Slackware 5 07-02-2011 06:02 AM
[SOLVED] Compile error when building SBOPKG for libsoup vdemuth Slackware 2 01-02-2011 01:35 PM
SBOpkg honor's CFLAGS but then they're replaced with i486 arch flags? = :( Holering Slackware 8 10-11-2010 11:08 PM
[ANNOUNCE] SBo/Sbopkg comprehensive queue archive Mauro Giachero Slackware 17 03-05-2010 11:24 AM
[SOLVED] Is this how you set CFLAGS and other Make options? agi93 Slackware 6 01-02-2010 02:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration