LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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,227

Rep: Reputation: 86
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
Member
 
Registered: Feb 2009
Posts: 406

Rep: Reputation: 137Reputation: 137
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,227

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

Rep: Reputation: 137Reputation: 137
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,227

Original Poster
Rep: Reputation: 86
Ok.

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

Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 11:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration