summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-18 17:39:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-18 17:39:13 +0000
commita1ecef8e7ceeb547389f2554ca6d537079f6894b (patch)
treec1a5167230aff08efb82888e38a76de05f2f5160
parent802abc2bff1052062d77cf99109115db768193fd (diff)
Stuff to detect split modules in dirs - not tested yet
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6369 e03df62e-2008-0410-955e-edbf42e46eb7
-rwxr-xr-xconfigure60
1 files changed, 47 insertions, 13 deletions
diff --git a/configure b/configure
index dcf3d2aa3..5a3015fb3 100755
--- a/configure
+++ b/configure
@@ -1174,6 +1174,7 @@ EOENT
print "done\n";
}
}
+
print MODLIST "{0}};\n\n#endif\n";
close(MODLIST);
}
@@ -1214,26 +1215,59 @@ EOF
my $crud = "";
foreach $i (@modlist) {
- ###
- # Write Entry to the MakeFile
- ###
- $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
- $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
- $deps = getdependencies("src/modules/m_".$i.".cpp");
-
- #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
-
- print FILEHANDLE <<EOCHEESE;
+ ###
+ # Write Entry to the MakeFile
+ ###
+ $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
+ $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+ $deps = getdependencies("src/modules/m_".$i.".cpp");
+
+ #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
+
+ print FILEHANDLE <<EOCHEESE;
m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps
\$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
\$(CC) -pipe \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
EOCHEESE
- $crud = $crud . " install -m \$(INSTMODE) m_$i.so \$(MODPATH)\n";
+ $crud = $crud . " install -m \$(INSTMODE) m_$i.so \$(MODPATH)\n";
###
- # End Write Entry to the MakeFile
- ###
+ # End Write Entry to the MakeFile
+ ###
}
+
+ opendir(DIRHANDLE, "src/modules");
+ foreach $name (sort readdir(DIRHANDLE)) {
+ if ($name =~ /^m_(.+?)$/) {
+ $crapola = "";
+ $crap2 = "ar r $name.a ";
+ $crap3 = "";
+ # A module made of multiple files, in a dir, e.g. src/modules/m_spanningtree/
+ if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
+ print FILEHANDLE "$name.a: ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps";
+ foreach $fname (sort readdir(MDIRHANDLE)) {
+ if ($fname =~ /\.cpp$/) {
+ $cmflags = getcompilerflags("src/modules/$name/$fname");
+ $liflags = getlinkerflags("src/modules/$name/$fname");
+ $deps = getdependencies("src/modules/$name/$fname");
+ print FILEHANDLE " $name/$fname";
+ $crapola = $crapola . " \$(CC) -pipe -I../../../include \$(FLAGS) $cmflags -export-dynamic -c $name/$fname\n";
+ $oname = $fname;
+ $oname =~ s/\.cpp$/.o/g;
+ $crap2 = $crap2 . " $name/$oname";
+ $crap3 = $crap3 . " $name/$fname";
+ }
+ }
+ print FILEHANDLE "\n$crapola\n";
+ print FILEHANDLE "$name.so: $name.a ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h$crap3\n $crap2\n";
+ print FILEHANDLE " ranlib $name.a$crap3\n";
+ print FILEHANDLE " \$(CC) -pipe $liflags -shared -o $name.so $name.a\n";
+ closedir(MDIRHANDLE);
+ }
+ }
+ }
+ closedir(DIRHANDLE);
+
print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud;
}