[csw-maintainers] issue when trying to provide a python binding
Dagobert Michelsen
dam at opencsw.org
Fri May 8 21:16:01 CEST 2009
Hi Ben,
Am 08.05.2009 um 20:51 schrieb Ben Walton:
> The ruby build fails with studio but passes with with gcc. It's an
> issue of the (somewhat nasty) way that Makefiles are generated for
> some of the extensions (without auto*). These are done on the fly, so
> it wasn't a simple post-configure step. It ends up passing flags to
> ld that ld doesn't like. I wasn't able to nail it down, but didn't
> fight it too hard, either.
James gave me an incredibly useful advice: Interpose execution
and rewrite arguments. For example to rewrite arguments to cc
and CC you can write this (taken from
http://gar.svn.sourceforge.net/viewvc/gar/csw/mgar/pkg/flac/trunk/Makefile
> include gar/category.mk
>
> CC := $(abspath ./bin/cc)
> CXX := $(abspath ./bin/CC)
and then have heavy hacking (here, includes to relative pathes
are reordered to be before include to absolute pathes):
> ::::::::::::::
> bin/CC
> ::::::::::::::
> #!/opt/csw/bin/perl -w
>
> use strict;
>
> my @oargs;
>
> my @includes = grep { /^-I/ } @ARGV;
> @includes = ((grep { /^-I[^\/]/ } @includes),(grep { /^-I[\/]/ }
> @includes));
> my @argswoincludes = grep { !/^-I/ } @ARGV;
>
> foreach (@ARGV) {
> if( /^-I/ ) {
> push @oargs, @includes, @argswoincludes;
> last;
> }
> push @oargs, shift @argswoincludes;
> }
>
> my $cc = "/opt/studio/SOS11/SUNWspro/bin/" . ($0 =~ /cc/ ? "cc" :
> "CC");
>
> print "$cc ", join( " ", @oargs ), "\n";
> exec( $cc, @oargs );
You could poke around stuff for "ld" also, of course...
Best regards
-- Dago
More information about the maintainers
mailing list