X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=e3c460496a6c1df138cb5a8e6908ae2712da898a;hb=122660bd290687b19b7f5b2831e82e55be3b437c;hp=8bcfcbe6405439caf63372aebb1c6e02aeec87ae;hpb=d0d36795e807cf72295c6e73813e0c2daa0a71e7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 8bcfcbe64..e3c460496 100755 --- a/configure +++ b/configure @@ -484,14 +484,14 @@ if ($has_epoll) { if ($line =~ /GNU C Library .* version (.*?) /) { $libcv = $1; - $libcv =~ /([0-9\.\-])+/; + $libcv =~ /(\d+\.\d+)/; $libcv = $1; } elsif ($line =~ /Compiled on a Linux (.*?\..*?)\.* system/) { $kernelv = $1; # Fix for some retarded libc builds, strip off >> and << etc. - $kernelv =~ /([0-9\.])+/; + $kernelv =~ /(\d+\.\d+)/; $kernelv = $1; } } @@ -960,6 +960,7 @@ sub getosflags { if ($config{OSNAME} =~ /OpenBSD/i) { $config{MAKEPROG} = "gmake"; + $config{LDLIBS} = $config{LDLIBS} . " -lunwind"; chomp($foo = `eg++ -dumpversion | cut -c 1`); # theyre running the package version of gcc (eg++)... detect it and set up its version numbers. # if theyre not running this, configure lets the build continue but they probably wont manage to @@ -1274,34 +1275,21 @@ EOCHEESE opendir(DIRHANDLE, "src/modules"); foreach $name (sort readdir(DIRHANDLE)) { if ($name =~ /^m_(.+?)$/) { - $crapola = ""; - $crap3 = ""; + $mfrules = ""; + $mobjs = ""; $mliflags = ""; + $mfcount = 0; # A module made of multiple files, in a dir, e.g. src/modules/m_spanningtree/ if (opendir(MDIRHANDLE, "src/modules/$name") != 0) { - my $i = 0; - print FILEHANDLE "$name.so: ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h"; - foreach $fname (sort readdir(MDIRHANDLE)) { - if ($fname =~ /\.cpp$/) { - $cmflags = getcompilerflags("src/modules/$name/$fname"); - $mliflags = $mliflags . " " . getlinkerflags("src/modules/$name/$fname"); - $deps = getdependencies("src/modules/$name/$fname"); - $oname = $fname; - $oname =~ s/\.cpp$/.o/g; - print FILEHANDLE " $name/$oname"; - $crapola = $crapola . "$name/$oname: $name/$fname ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps\n"; - $crapola = $crapola . " \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $name/$oname -c $name/$fname\n\n"; - $crap3 = $crap3 . " $name/$oname"; - $i++; - } - } - print "Composing Makefile rules for directory \033[1;32m$name\033[0m... (\033[1;32m$i files found\033[0m)\n"; + read_module_directory("src/modules/$name", $name); + print "Composing Makefile rules for directory \033[1;32m$name\033[0m... (\033[1;32m$mfcount files found\033[0m)\n"; + print FILEHANDLE "$name.so: ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $mobjs\n"; if ($config{IS_DARWIN} eq "YES") { - print FILEHANDLE "\n \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle -o $name.so $crap3\n"; + print FILEHANDLE " \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) $mliflags -bundle -o $name.so $mobjs\n"; } else { - print FILEHANDLE "\n \$(CC) -pipe \$(FLAGS) -shared $mliflags -o $name.so $crap3\n"; + print FILEHANDLE " \$(CC) -pipe \$(FLAGS) -shared $mliflags -o $name.so $mobjs\n"; } - print FILEHANDLE "\n$crapola\n"; + print FILEHANDLE "\n$mfrules\n"; closedir(MDIRHANDLE); $crud = $crud . " install -m \$(INSTMODE) $name.so \$(MODPATH)\n"; } @@ -1312,6 +1300,31 @@ EOCHEESE print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud; } +sub read_module_directory { + my ($dpath, $reldpath) = @_; + + if (opendir(MDIRHANDLE, $dpath) == 0) { + return; + } + + foreach $fname (sort readdir(MDIRHANDLE)) { + if ($fname =~ /\.cpp$/) { + $cmflags = getcompilerflags("$dpath/$fname"); + $mliflags = $mliflags . " " . getlinkerflags("$dpath/$fname"); + $deps = getdependencies("$dpath/$fname"); + $oname = $fname; + $oname =~ s/\.cpp$/.o/g; + $mfrules = $mfrules . "$reldpath/$oname: $reldpath/$fname ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps\n"; + $mfrules = $mfrules . " \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $reldpath/$oname -c $reldpath/$fname\n\n"; + $mobjs = $mobjs . " $reldpath/$oname"; + $mfcount++; + } + elsif ((-d "$dpath/$fname") && !($fname eq ".") && !($fname eq "..")) { + read_module_directory($dpath."/".$fname, $reldpath."/".$fname); + } + } +} + sub write_dynamic_makefile { my $i = 0;