summaryrefslogtreecommitdiff
path: root/make/install-extras.pl
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:05:18 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:05:18 +0000
commit94d5c29f63f806f0c1de5d8eda2ae98d268b84f1 (patch)
tree643776eacefeda67c715b00edbbcc76c7dd6fffd /make/install-extras.pl
parent944d154befc9e27b121d221074f4b24af500011b (diff)
./configure fixes: -modupdate is no longer needed, -update no longer forces a full rebuild
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11560 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make/install-extras.pl')
-rwxr-xr-xmake/install-extras.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/make/install-extras.pl b/make/install-extras.pl
new file mode 100755
index 000000000..f0e2dd0e2
--- /dev/null
+++ b/make/install-extras.pl
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $mode = shift;
+my %installed;
+
+for my $dir (qw(src src/modules)) {
+ opendir(DIRHANDLE, $dir);
+ for my $file (sort readdir(DIRHANDLE)) {
+ next unless $file =~ /\.cpp$/;
+ open CPP, '<', "$dir/$file" or die "Can't open $dir/$file to scan it: $!";
+ while (<CPP>) {
+ if (/\/\* \$CopyInstall: (\S+) (\S+) \*\//i) {
+ my($ifile, $idir) = ($1,$2);
+ next if exists $installed{$1.' '.$2};
+ $installed{$1.' '.$2}++;
+ $idir =~ s/\$\(([^)]+)\)/$ENV{$1}/eg;
+ if ($mode eq 'install') {
+ system "install $ifile $idir";
+ } else {
+ $ifile =~ s/.*\///g;
+ system "rm $idir/$ifile";
+ }
+ }
+ }
+ }
+ closedir(DIRHANDLE);
+}