From d7ee3683a4d6d76113161be9754c007dee37d288 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 27 Sep 2009 14:37:04 +0000 Subject: Fix modules/extra symlinks when calculating dependencies git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11769 e03df62e-2008-0410-955e-edbf42e46eb7 --- make/calcdep.pl | 23 +++++++++++++++++------ 1 file 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 (, ) { + for my $file () { 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; } } -- cgit v1.2.3