summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-23 16:37:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-23 16:37:03 +0000
commitd00fc6f9bf3beca11b2e4a744aaecb119e617540 (patch)
tree865c16d8dcde860b5d9b44e874c3af1c98537780 /configure
parenta02baa51d398d6a06cbe6caebd1ab4901229fbb9 (diff)
Add $ModDep: special comment, similar to $CompileFlags and $LinkerFlags.
$ModDep allows a module to specify headers it depends on, e.g. all of the headers which use u_listmode.h now do this: /* $ModDep: ../../include/u_listmode.h */ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5534 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure19
1 files changed, 17 insertions, 2 deletions
diff --git a/configure b/configure
index 6336af807..8af40ef10 100755
--- a/configure
+++ b/configure
@@ -1403,6 +1403,19 @@ sub getlinkerflags {
return undef;
}
+sub getdependencies {
+ my ($file) = @_;
+ open(FLAGS, $file);
+ while (<FLAGS>) {
+ if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) {
+ close(FLAGS);
+ return $1;
+ }
+ }
+ close(FLAGS);
+ return undef;
+}
+
sub resolve_directory {
use File::Spec;
return File::Spec->rel2abs($_[0]);
@@ -1483,12 +1496,13 @@ HEADER
if ($i !~ /_static$/) {
$cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
$liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+ $deps = getdependencies("src/modules/m_".$i.".cpp");
###
# Write Entry to the Makefile
###
print FILEHANDLE <<EOCHEESE;
-m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h
+m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
\$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
mv .m_$i\_static.o ../m_$i.o
@@ -1556,8 +1570,9 @@ EOF
###
$cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
$liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+ $deps = getdependencies("src/modules/m_".$i.".cpp");
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
+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) \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra