Jeff Erickson
Jeff Erickson

Reputation: 3893

Force GCC to ignore certain flags?

I am trying to find a way to get GCC to temporarily ignore -arch ppc and -arch i386 flags. Does anyone have a method for accomplishing this? I have read about ways to force flags, like writing shell scripts called GCC and putting them in your path above the real GCC, but I'm looking for the opposite. My want for accomplishing this is to potentially solve this problem:

R-Perl Install Problems with GCC 4.0: How do you remove unnecessary -arch flags

Thanks for your help!

Upvotes: 1

Views: 788

Answers (1)

flolo
flolo

Reputation: 15526

You could do it the same way: write a wrapper script but instead of passing all flags, go through them and remove the arch flag. This can look like this:

#!/bin/bash
gcc ${@/-arch=i386}

(here maybe some fine tuning is necessary: when you have to remove multiple options introduce a help variable and make the changes step by step).

EDIT: Removed other suggestion.

Upvotes: 2

Related Questions