aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authoranthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-29 19:55:46 +0000
committeranthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-29 19:55:46 +0000
commit73e4e4ec57dc56d3e936e59970ed3e203ae3706a (patch)
treea237754edb7b4ba47c91bd513be8ef9b0b68d4a6 /contrib
parent2a767a2f5bda84809d737a9bc5364d36eec5264f (diff)
update astxs utility to allow auto load/unload and url compile
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2822 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/astxs31
1 files changed, 31 insertions, 0 deletions
diff --git a/contrib/scripts/astxs b/contrib/scripts/astxs
index 663617ecd..3529f976c 100755
--- a/contrib/scripts/astxs
+++ b/contrib/scripts/astxs
@@ -95,6 +95,27 @@ if($args{print}) {
my($base,$ext);
my $cfile = $args{plain}->[0];
+
+
+if($cfile =~ /http:\/\/.*?\/([^\/]+)$/) {
+
+ my $f = $1;
+ if(! -d "/tmp/astbld") {
+ mkdir("/tmp/astbld");
+ }
+ my $pwd = `pwd`;
+ chomp $pwd;
+ chdir("/tmp/astbld");
+ system("/bin/rm $f");
+ system("wget $cfile");
+ chdir($pwd);
+ $cfile = "/tmp/astbld/$f";
+
+
+}
+
+
+
if($cfile) {
($base,$ext) = $cfile =~ /^([^\.]+)\.(.)/;
}
@@ -109,6 +130,16 @@ $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);
if($args{install} and $vars{MODULES_DIR}) {
+ my $file = "${base}.so";
+ my ($mod) = $file =~ /([^\/]*)$/;
+
+ if($args{autoload}) {
+ $bad = esystem("/usr/sbin/asterisk -rx 'unload $mod'");
+ }
$bad = esystem("/bin/cp -p ${base}.so $vars{MODULES_DIR}") if(!$bad);
+
+ if($args{autoload}) {
+ $bad = esystem("/usr/sbin/asterisk -rx 'load $mod'");
+ }
}