X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=21e283ef85fe2336fd2a862f4ef0b4088a984094;hb=9a2481ebf1109adc4b626414108d92674793cd5d;hp=3470ec24f6c1d9569a28f39c4189ce394d8f5376;hpb=5db1d322be106c8462dc691072f9415dc0766ed4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 3470ec24f..21e283ef8 100755 --- a/configure +++ b/configure @@ -483,14 +483,96 @@ sub svnupdate open(FH,"<.svn/entries") or $fail = 1; if ($fail) { print "This is not an SVN copy of InspIRCd.\n"; - exit; + exit 1; } else { close(FH); } - system("svn update"); - system("perl configure -update"); + open my $fd, "-|", "svn update"; + my $configurechanged = 0; # Needs ./configure -update + my $coredirchanged = 0; # Needs ./configure -update + my $moduledirchanged = 0; # Needs ./configure -modupdate + my $rootincchanged = 0; + my @conflicted = (); + while (defined(my $line = <$fd>)) + { + my ($action, $file); + print $line; + $line =~ m/^([ADUCG])\s+(.*)$/ or next; + ($action, $file) = ($1, $2); + if ($action eq "C") + { + push @conflicted, $file; + if ($file eq "configure") + { + $configurechanged = 1; + } + elsif ($file =~ m#^src/modules#) + { + $moduledirchanged = 1; + } + elsif ($file =~ m#^src/#) + { + $coredirchanged = 1; + } + elsif ($file =~ m/^\..*\.inc$/) + { + $rootincchanged = 1; + } + } + elsif ($action eq "U" || $action eq "G") + { + if ($file eq "configure") + { + $configurechanged = 1; + } + elsif ($file =~ m/^\..*\.inc$/) + { + $rootincchanged = 1; + } + } + elsif ($action eq "A" || $action eq "D") + { + if ($file =~ m#^src/modules#) + { + $moduledirchanged = 1; + } + elsif ($file =~ m#^src/#) + { + $coredirchanged = 1; + } + } + } + unless (close $fd) # close() waits for exit and returns false if the command failed + { + if ($! == 0) + { + print STDERR "Problem updating from SVN, please check above for errors\n"; + } + else + { + print STDERR "Failed to run SVN: $!\n"; + } + exit 1; + } + if (scalar(@conflicted) > 0) + { + print STDERR "\e[0;33;1mERROR:\e[0m You have local modifications which conflicted with the updates from SVN\n"; + printf STDERR "Configure is not able to complete the update. Please resolve these conflicts, then run ./configure -%supdate", (($coredirchanged || $configurechanged) ? "" : "mod"); + } + if ($configurechanged || $coredirchanged) + { + system("perl configure -update"); + } + elsif ($moduledirchanged || $rootincchanged) + { + system("perl configure -modupdate"); + } + else + { + print "No need to update Makefiles.\n"; + } if (defined $opt_rebuild) { system("make install"); } @@ -938,10 +1020,10 @@ makecache(); print "\n\n"; print "To build your server with these settings, please type '\e[1;32m$config{MAKEPROG}\e[0m' now.\n"; if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) { - print "Please remember that to enable \e[1;32mSSL support\e[0m you must\n"; - print "load the required modules in your config. This configure process\n"; - print "has just prepared these modules to be compiled for you, and has not\n"; - print "configured them to be compiled into the core of the ircd.\n"; + print "Please note: for \e[1;32mSSL support\e[0m you will need to load required\n"; + print "modules in your config. This configure script has added those modules to the\n"; + print "build process. For more info please refer to:\n"; + print "\e[1;32mhttp://www.inspircd.org/wiki/Installation_From_Tarball\e[0m\n"; } print "*** \e[1;32mRemember to edit your configuration files!!!\e[0m ***\n\n\n"; if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) { @@ -1047,9 +1129,10 @@ our $SHARED = ""; sub getosflags { + # Beware: Linux sets it's own cflags below for some retarded reason $config{LDLIBS} = "-pthread -lstdc++"; - $config{FLAGS} = "-fPIC -Wshadow -Wall $config{OPTIMISATI}"; - $config{DEVELOPER} = "-fPIC -Wshadow -Wall -g"; + $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}"; + $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -g"; $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared" unless defined $opt_disablerpath; $config{MAKEPROG} = "make"; @@ -1075,7 +1158,7 @@ sub getosflags { if ($config{OSNAME} =~ /Linux/i) { $config{LDLIBS} = "-ldl -lstdc++ -pthread"; - $config{FLAGS} = "-fPIC -Wshadow -Wall $config{OPTIMISATI}"; + $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}"; $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS}); $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS}); $config{MAKEPROG} = "make"; @@ -1152,6 +1235,7 @@ sub writefiles { #define OPTIMISATION $config{OPTIMITEMP} #define LIBRARYDIR "$config{LIBRARY_DIR}" #define SYSTEM "$incos" + EOF print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; @@ -1198,7 +1282,7 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; print FILEHANDLE "#define USE_SELECT\n"; $se = "socketengine_select"; } - print FILEHANDLE "\n#endif\n"; + print FILEHANDLE "\n#include \"threadengines/threadengine_pthread.h\"\n\n#endif\n"; close(FILEHANDLE); } @@ -1592,7 +1676,6 @@ sub write_dynamic_makefile my $all = "all: "; my $all_libsonly = ""; - my $libraryext = ""; my $othercrap = ""; my $RPATH = ""; @@ -1713,17 +1796,10 @@ ITEM foreach my $cmd (@cmdlist) { print FH <