X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=781b098a6844716122b5a71d3ee31f4aa758b394;hb=fe7aa4267324f23d3fbd6c7adb642927896b3305;hp=904f1c7f5d096f97fbc2264b13e083f839bc8901;hpb=eedce11c9606f24d339d8055fd9d0f995b4e0951;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 904f1c7f5..781b098a6 100755 --- a/configure +++ b/configure @@ -483,14 +483,98 @@ 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"); + print "Conflicted files: " . join ", ", @conflicted; + exit 1; + } + 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 +1022,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 +1131,10 @@ our $SHARED = ""; sub getosflags { + # Beware: Linux sets it's own cflags below for some retarded reason $config{LDLIBS} = "-pthread -lstdc++"; - $config{FLAGS} = "-fPIC -Wall $config{OPTIMISATI}"; - $config{DEVELOPER} = "-fPIC -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 +1160,7 @@ sub getosflags { if ($config{OSNAME} =~ /Linux/i) { $config{LDLIBS} = "-ldl -lstdc++ -pthread"; - $config{FLAGS} = "-fPIC -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 +1237,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 +1284,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); } @@ -1369,14 +1455,14 @@ EOCHEESE { print FILEHANDLE " 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 - ../../make/run-cc.pl \$(CC) -pipe -I../../include \$(NICEFLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp + \@../../make/run-cc.pl \$(CC) -pipe -I../../include \$(NICEFLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp " } else { print FILEHANDLE " 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 - ../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp + \@../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) $cmflags \$(PICLDFLAGS) $liflags -export-dynamic -o m_$i.so m_$i.cpp "; } $install_list = $install_list . " install -m \$(INSTMODE) src/modules/m_$i.so \$(MODPATH)\n"; @@ -1399,9 +1485,9 @@ m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/ch print "Composing Makefile rules for directory \e[1;32m$name\e[0m... (\e[1;32m$mfcount files found\e[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 " ../../make/run-cc.pl \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) $mliflags -bundle -o $name.so $mobjs\n"; + print FILEHANDLE " \@../../make/run-cc.pl \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) $mliflags -bundle -o $name.so $mobjs\n"; } else { - print FILEHANDLE " ../../make/run-cc.pl \$(CC) -pipe \$(FLAGS) -shared $mliflags -o $name.so $mobjs\n"; + print FILEHANDLE " \@../../make/run-cc.pl \$(CC) -pipe \$(FLAGS) -shared $mliflags -o $name.so $mobjs\n"; } print FILEHANDLE "\n$mfrules\n"; closedir(MDIRHANDLE); @@ -1427,7 +1513,7 @@ sub read_module_directory { my $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 . " ../../make/run-cc.pl \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $reldpath/$oname -c $reldpath/$fname\n\n"; + $mfrules = $mfrules . " \@../../make/run-cc.pl \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $reldpath/$oname -c $reldpath/$fname\n\n"; $mobjs = $mobjs . " $reldpath/$oname"; $mfcount++; } @@ -1592,7 +1678,6 @@ sub write_dynamic_makefile my $all = "all: "; my $all_libsonly = ""; - my $libraryext = ""; my $othercrap = ""; my $RPATH = ""; @@ -1600,13 +1685,13 @@ sub write_dynamic_makefile if ($config{IS_DARWIN} eq "YES") { $libraryext = "dylib"; - $othercrap = " ../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n ../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o " + $othercrap = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n \@../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o " } else { $libraryext = "so"; $RPATH = "-Wl,--rpath -Wl,$config{LIBRARY_DIR}" unless defined $opt_disablerpath; - $othercrap = " ../make/run-cc.pl \$(CC) -pipe -I../include $RPATH \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; + $othercrap = " \@../make/run-cc.pl \$(CC) -pipe -I../include $RPATH \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; } foreach my $cpp (sort keys %filelist) @@ -1679,15 +1764,15 @@ EOM } } print FH $thislib . ": $cpp $deps ". (defined($specialdeps{$cpp}) ? $specialdeps{$cpp} : "") . "\n"; - print FH " ../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c $rawcpp\n"; + print FH " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c $rawcpp\n"; if (exists($extrabuildlines{$cpp})) { print FH " " . $extrabuildlines{$cpp} . "\n"; } - print FH " ../make/run-cc.pl \$(CC) -pipe $libcrap -o " . $thislib . " " . $objs . "\n\n"; + print FH " \@../make/run-cc.pl \$(CC) -pipe $libcrap -o " . $thislib . " " . $objs . "\n\n"; } - print FH "moo:\n \${MAKE} -C \"commands\" DIRNAME=\"src/commands\" CC=\"\$(CC)\" \$(MAKEARGS)\n\n"; + print FH "moo:\n \@\${MAKE} -C \"commands\" DIRNAME=\"src/commands\" CC=\"\$(CC)\" \$(MAKEARGS)\n\n"; # close main makefile close(FH); @@ -1713,17 +1798,10 @@ ITEM foreach my $cmd (@cmdlist) { print FH <