diff options
author | anthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-08-25 02:41:38 +0000 |
---|---|---|
committer | anthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-08-25 02:41:38 +0000 |
commit | 39214502b228916def56cb553e80025e269f5f86 (patch) | |
tree | d9c10d09bdecbf827e6f33445c5c70d15a292021 | |
parent | 671cec77ff8c492d485719a353548dc28041907b (diff) |
some small changes to astxs utility
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3651 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | contrib/scripts/astxs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/contrib/scripts/astxs b/contrib/scripts/astxs index 36cdad350..42c143ee9 100755 --- a/contrib/scripts/astxs +++ b/contrib/scripts/astxs @@ -117,19 +117,31 @@ if($cfile =~ /http:\/\/.*?\/([^\/]+)$/) { if($cfile) { - ($base,$ext) = $cfile =~ /^([^\.]+)\.(.)/; + ($base,$ext) = $cfile =~ /^([^\.]+)\.(.+)/; } -if($ext ne "c") { +if($ext eq "so") { + unless($args{linkonly}) { + $args{installonly}++; + } +} elsif($ext ne "c") { usage "Bad Input File"; } + my $bad=0; -$bad = esystem("$vars{CC} $vars{CFLAGS} -c ${base}.c -o ${base}.o"); -$bad = esystem("$vars{CC} $vars{SOLINK} -o $vars{LDFLAGS} ${base}.so $base.o $vars{EXTOBJ}") if(!$bad); +$bad = esystem("$vars{CC} $vars{CFLAGS} -c ${base}.c -o ${base}.o") unless($args{linkonly} or $args{installonly}); +exit -1 if($bad); +exit if($args{nolink}); + + + +$vars{MAINOBJ} ||= $base.o; +$bad = esystem("$vars{CC} $vars{SOLINK} -o $vars{LDFLAGS} ${base}.so $vars{MAINOBJ} $vars{EXTOBJ}") if(!$bad and !$args{installonly}); +exit -1 if($bad); -if($args{install} and $vars{MODULES_DIR}) { +if(($args{install} or $args{installonly}) and $vars{MODULES_DIR}) { my $file = "${base}.so"; my ($mod) = $file =~ /([^\/]*)$/; |