summaryrefslogtreecommitdiff
path: root/make/calcdep.pl
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-27 14:37:04 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-27 14:37:04 +0000
commitd7ee3683a4d6d76113161be9754c007dee37d288 (patch)
tree0d2e5e69de71020e02d4a0b0d12299b86d7ec2f6 /make/calcdep.pl
parent934d9a6a184b7a8600fcda30e012ba6f29f17b64 (diff)
Fix modules/extra symlinks when calculating dependencies
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11769 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make/calcdep.pl')
-rwxr-xr-xmake/calcdep.pl23
1 files changed, 17 insertions, 6 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl
index 05199569c..7d424f4e3 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -42,18 +42,29 @@ END
}
my @modlist;
- for my $file (<commands/*.cpp>, <modules/*.cpp>) {
+ for my $file (<commands/*.cpp>) {
my $out = find_output $file;
dep_cpp $file, $out;
push @modlist, $out;
}
opendir my $moddir, 'modules';
- for my $dir (readdir $moddir) {
- next unless $dir =~ /^m_/ && -d "modules/$dir";
- if (dep_dir "modules/$dir") {
- mkdir "$build/obj/$dir";
- push @modlist, "modules/$dir.so";
+ for my $file (readdir $moddir) {
+ next if $file =~ /^\./;
+ if (-e "modules/extra/$file" && !-l "modules/$file") {
+ # Incorrect symlink?
+ print "Replacing symlink for $file found in modules/extra\n";
+ rename "modules/$file", "modules/$file~";
+ symlink "extra/$file", "modules/$file";
+ }
+ if ($file =~ /^m_/ && -d "modules/$file" && dep_dir "modules/$file") {
+ mkdir "$build/obj/$file";
+ push @modlist, "modules/$file.so";
+ }
+ if ($file =~ /^m_.*\.cpp$/) {
+ my $out = find_output "modules/$file";
+ dep_cpp "modules/$file", $out;
+ push @modlist, $out;
}
}