You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1011 B
53 lines
1011 B
#!@l_prefix@/bin/perl |
|
|
|
my $cc = '@CC@'; |
|
my $cflags = '@CFLAGS@'; |
|
my $cppflags = '@CPPFLAGS@'; |
|
my $ldflags = '@LDFLAGS@'; |
|
|
|
my @args = (); |
|
my @incs = (); |
|
my @libs = (); |
|
|
|
for (my $i = 0; $i < @ARGV; $i++) { |
|
if ($ARGV[$i] eq "-I") { |
|
push(@incs, $ARGV[$i++]); |
|
push(@incs, $ARGV[$i]); |
|
} |
|
elsif ($ARGV[$i] =~ m/^-I.+/) { |
|
push(@incs, $ARGV[$i]) |
|
} |
|
elsif ($ARGV[$i] eq "-L") { |
|
push(@libs, $ARGV[$i++]); |
|
push(@libs, $ARGV[$i]); |
|
} |
|
elsif ($ARGV[$i] =~ m/^-L.+/) { |
|
push(@libs, $ARGV[$i]) |
|
} |
|
else { |
|
push(@args, $ARGV[$i]) |
|
} |
|
} |
|
|
|
my @ARGV = ($cc); |
|
foreach my $arg (split(/\s+/, $cflags)) { |
|
push(@ARGV, $arg) |
|
} |
|
foreach my $arg (@incs) { |
|
push(@ARGV, $arg) |
|
} |
|
foreach my $arg (split(/\s+/, $cppflags)) { |
|
push(@ARGV, $arg) |
|
} |
|
foreach my $arg (@libs) { |
|
push(@ARGV, $arg) |
|
} |
|
foreach my $arg (split(/\s+/, $ldflags)) { |
|
push(@ARGV, $arg) |
|
} |
|
foreach my $arg (@args) { |
|
push(@ARGV, $arg) |
|
} |
|
|
|
exec { $ARGV[0] } @ARGV; |
|
|
|
|