The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to build a string in shell script nkosaraju Shell Programming and Scripting 8 07-17-2008 12:29 PM
Build script for all shells vino Shell Programming and Scripting 9 04-14-2005 12:25 AM
I want to build a script mewalter Shell Programming and Scripting 7 10-14-2002 01:27 AM
Script Build mewalter Shell Programming and Scripting 3 07-09-2002 05:30 PM
I want to build a script mewalter Shell Programming and Scripting 2 07-01-2002 06:32 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-07-2008
madpenguin madpenguin is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 13
autoresolving 'native' in build script

Greets. I have a build system that comprises of one parent script and about 150 children to build Gnome. I have a file that is sourced at the top of every script to gather variables needed for the build. In this variables file, CFLAGS are set.

What I would like to do is do a quick check somewhere for the use of -march=native. If found, I'd like to translate native into a static CPU opt to use for the package name ($ARCH). This is on Slackware BTW. Having a package named "foo-1.2.3-native-1.tgz" doesn't really tell you what $ARCH the package is for.....

Haven't thought of how I'm going to actually implement this yet so all build scripts have it available, but right now, I had a quick C file compilation in mind, supplying gcc with the verbose flag and then grep for the $ARCH? Eh..... I don't know. Sounds a little sloppy maybe. Especially if I had to do that for each child.

Anyone have any cool idea's for this? Thanks all.
  #2 (permalink)  
Old 10-12-2008
madpenguin madpenguin is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 13
Not the prettiest of things but works....

Code:
echo "main(){}" > test.c
gcc -v -march=native -o test test.c 2>cpu
ARCH=$(cat cpu | grep -o "march=.*" | sed -e 's/ .*//' -e 's/march=//')
echo $ARCH
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0