X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=c228e33119f805ce9c0904447c4877e8d6d50eaf;hb=056682a6e1746306117a7f3e820e8c4ea37f722a;hp=72719a4783d2e98321cbd43632c37b9f6b99f084;hpb=9dbd7d10ac81c6445c58f4abb4f0eff240a8f9d2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 72719a478..c228e3311 100755 --- a/configure +++ b/configure @@ -98,7 +98,7 @@ our %extraobjects = (); our %extrasources = (); our ($opt_use_gnutls, $opt_rebuild, $opt_use_openssl, $opt_nointeractive, $opt_nick_length, - $opt_chan_length, $opt_maxclients, $opt_ports, $opt_epoll, $opt_kqueue, $opt_noports, + $opt_chan_length, $opt_ports, $opt_epoll, $opt_kqueue, $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_disablerpath, $opt_ipv6, $opt_ipv6links, $opt_noipv6links, $opt_ident, $opt_quit, $opt_topic, $opt_maxbuf, $opt_kick, $opt_gecos, $opt_away, $opt_modes, $opt_disable_debug, $opt_maxchans, @@ -123,7 +123,6 @@ GetOptions ( 'disable-interactive' => \$opt_nointeractive, 'with-nick-length=i' => \$opt_nick_length, 'with-channel-length=i' => \$opt_chan_length, - 'with-max-clients=i' => \$opt_maxclients, 'enable-ports' => \$opt_ports, 'enable-epoll' => \$opt_epoll, 'enable-kqueue' => \$opt_kqueue, @@ -181,7 +180,6 @@ our $non_interactive = ( (defined $opt_away) || (defined $opt_gecos) || (defined $opt_kick) || - (defined $opt_maxclients) || (defined $opt_modes) || (defined $opt_topic) || (defined $opt_quit) || @@ -324,8 +322,6 @@ if (defined $opt_noipv6links) { $config{SUPPORT_IP6LINKS} = "n"; } -chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit -chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue $config{OSNAME} = $^O; # Operating System Name @@ -391,12 +387,6 @@ if ($config{GCCVER} eq "") { exit; } -our $fd_scan_fail = ""; -if (!$config{MAX_CLIENT_T}) { - $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default' - $fd_scan_fail = "true"; # Used Later -} - # Get and Set some important vars.. getmodules(); @@ -483,14 +473,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\n", (($coredirchanged || $configurechanged) ? "" : "mod"); + print "Conflicted files: " . join ", ", @conflicted . "\n"; + 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"); } @@ -503,18 +577,6 @@ print ((!getcache()) ? "not found\n" : "found\n"); print "Checking operating system version... "; print getosflags() . "\n"; -if (defined $opt_maxclients) -{ - $config{MAX_CLIENT} = $opt_maxclients; -} - -if (!$config{MAX_CLIENT}) { - # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this - # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go - # higher than the found value" :)) - $config{MAX_CLIENT} = $config{MAX_CLIENT_T}; -} - printf "Checking if stdint.h exists... "; $config{HAS_STDINT} = "true"; our $fail = 0; @@ -718,7 +780,6 @@ a new value. Please note: You will \e[1mHAVE\e[0m to read the docs dir, otherwise you won't have a config file! Your operating system is: \e[1;32m$config{OSNAME}\e[0m ($wholeos) -Maximum file descriptors: \e[1;32m$config{MAX_CLIENT_T}\e[0m Your InspIRCd revision ID is \e[1;32mr$rev\e[0m STOP if ($rev eq "r0") { @@ -832,11 +893,6 @@ should NOT be used. You should probably specify a newer compiler.\n\n"; print "of the 'maximum number of clients' setting which may be different on\n"; print "different servers on the network.\n\n"; - # File Descriptor Settings.. - promptnumeric("number of clients at any one time", "MAX_CLIENT_T"); - $config{MAX_CLIENT} = $config{MAX_CLIENT_T}; - $config{MAX_DESCRIPTORS} = $config{MAX_CLIENT_T}; - promptnumeric("length of nicknames", "NICK_LENGT"); promptnumeric("length of channel names", "CHAN_LENGT"); promptnumeric("number of mode changes in one line", "MAXI_MODES"); @@ -938,10 +994,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,16 +1103,17 @@ our $SHARED = ""; sub getosflags { - $config{LDLIBS} = "-lstdc++"; - $config{FLAGS} = "-fPIC -Wall $config{OPTIMISATI}"; - $config{DEVELOPER} = "-fPIC -Wall -g"; + # Beware: Linux sets it's own cflags below for some retarded reason + $config{LDLIBS} = "-pthread -lstdc++"; + $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}"; + $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g"; $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared" unless defined $opt_disablerpath; $config{MAKEPROG} = "make"; if ($config{OSNAME} =~ /darwin/i) { $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall $config{OPTIMISATI}"; $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup"; - $config{LDLIBS} = "-ldl -lstdc++"; + $config{LDLIBS} = "-ldl -pthread -lstdc++"; } if ($config{OSNAME} =~ /OpenBSD/i) { @@ -1074,8 +1131,8 @@ sub getosflags { } if ($config{OSNAME} =~ /Linux/i) { - $config{LDLIBS} = "-ldl -lstdc++"; - $config{FLAGS} = "-fPIC -Wall $config{OPTIMISATI}"; + $config{LDLIBS} = "-ldl -lstdc++ -pthread"; +# $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"; @@ -1094,7 +1151,7 @@ sub getosflags { # rt = POSIX realtime extensions # resolv = inet_aton only (why isnt this in nsl?!) $config{MAKEPROG} = "gmake"; - $config{LDLIBS} .= " -lsocket -lnsl -lrt -lresolv"; + $config{LDLIBS} .= " -lsocket -lnsl -lrt -lresolv -pthread"; return "Solaris"; } @@ -1136,10 +1193,7 @@ sub writefiles { #define MOD_PATH "$config{MODULE_DIR}" #define VERSION "$version" #define REVISION "$revision2" -#define MAXCLIENTS $config{MAX_CLIENT} -#define MAXCLIENTS_S "$config{MAX_CLIENT}" #define SOMAXCONN_S "$config{_SOMAXCONN}" -#define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS} #define NICKMAX $NL #define CHANMAX $CL #define MAXMODES $config{MAXI_MODES} @@ -1152,6 +1206,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 +1253,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 +1424,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 +1454,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 +1482,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 +1647,6 @@ sub write_dynamic_makefile my $all = "all: "; my $all_libsonly = ""; - my $libraryext = ""; my $othercrap = ""; my $RPATH = ""; @@ -1600,13 +1654,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 +1733,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 +1767,10 @@ ITEM foreach my $cmd (@cmdlist) { print FH <