Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-11-2011, 03:10 AM   #1
LQ Newbie
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
Apple gcc: Insert include dirs between -I dirs and -isysroot dirs

So here's the deal:
I need to fake sysroot with Apple's gcc, and I'm using the -isysroot parameter to do this.
The problem is, I have a bunch of include dirs that need to go with the default system include dirs, but I can't put -I in my CFLAGS or any -I after it would get bumped back a place in search priorities.

Apple's man page says this:
-idirafter dir
Search dir for header files, but do it after all directories specified with -I and the standard
system directories have been exhausted. dir is treated as a system include directory.
But does the "system directories" here mean the real system directories or does it include my -isysroot dir? The blurb about -isysroot says it marks the specified dir as a system dir too..

Basically, I want it to go like this:
1. My includes with -I
2. Fake sysroot / extraneous default include dirs
3. Real sysroot
I also have a bunch of libs that need to be rigged the same way. Moving the files around isn't an option for me.

Is there a way to rig CFLAGS to do this or will I have to manually append -I extraneous dirs to it's correct place to every project I start?

Help would be appreciated.

PS. I'm a bit embarrassed to admit as a mere hobbyist I'm not a very savvy coder, so please excuse my stupidity if this is a dumb question. Google gave me irrelevant answers, so here I am >_>

EDIT: Nevermind.. I found -isystem.. guess I overlooked it

Last edited by f.barker; 11-11-2011 at 03:31 AM.
Old 11-11-2011, 11:19 AM   #2
LQ Guru
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
I used to constantly overlook things like this all the time :P Anyways, glad you found it. Replying to take this off of the zero-reply list.




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
GCC includes files from unexpected dirs. Why? delorean-bf Linux - Software 1 11-23-2010 04:56 PM
How to find only dirs? kornerr Linux - General 4 01-29-2006 04:04 PM
Symlink two dirs into one? neocookie Linux - General 7 05-27-2005 09:50 AM
How to see just dirs with ls? d1s4st3r Linux - Newbie 3 06-04-2004 11:45 AM
removing dirs... chrismiceli Linux - General 5 10-25-2002 06:16 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:54 PM.

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