From 19487dbebc520450e457472b97d9e7bcd5160c00 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 11 Nov 2009 00:17:07 +0000 Subject: Allow static build of inspircd without module support git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12083 e03df62e-2008-0410-955e-edbf42e46eb7 --- make/calcdep.pl | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) (limited to 'make/calcdep.pl') diff --git a/make/calcdep.pl b/make/calcdep.pl index 81a7759d3..587bd64de 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -3,7 +3,7 @@ use strict; use warnings; use POSIX qw(getcwd); -sub find_output($); +sub find_output; sub gendep($); sub dep_cpp($$); sub dep_dir($); @@ -28,6 +28,16 @@ sub run() { open MAKE, '>real.mk' or die "Could not write real.mk: $!"; chdir "$ENV{SOURCEPATH}/src"; + if ($ENV{PURE_STATIC}) { + run_static(); + } else { + run_dynamic(); + } + close MAKE; +} + +sub run_dynamic() { + my $build = $ENV{BUILDPATH}; print MAKE <, , , , + , , "threadengines/threadengine_pthread.cpp") { + my $out = find_output $file, 1; + dep_cpp $file, $out; + next if $file =~ m#^socketengines/# && $file ne "socketengines/$ENV{SOCKETENGINE}.cpp"; + push @deps, $out; + } + + my $core_mk = join ' ', @deps; + print MAKE < + +inspircd: bin/inspircd + +.PHONY: all bad-target inspircd + +END +} + +sub find_output { + my($file, $static) = @_; my($path,$base) = $file =~ m#^((?:.*/)?)([^/]+)\.cpp# or die "Bad file $file"; if ($path eq 'modules/' || $path eq 'commands/') { - return "modules/$base.so"; + return $static ? "obj/$base.o" : "modules/$base.so"; } elsif ($path eq '' || $path eq 'modes/' || $path =~ /^[a-z]+engines\/$/) { return "obj/$base.o"; } elsif ($path =~ m#modules/(m_.*)/#) { -- cgit v1.2.3