X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=2948e0b40a67461de3ce24c143732267c0bc089c;hb=e3df3b9d267cb3839db268ff6d0be389c45ebf6d;hp=887c58afeeed871ecfa5788981af303d76399c69;hpb=f652bca3365bcbaaa1f6fd8d0b39b0ba98b35436;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 887c58afe..2948e0b40 100755 --- a/configure +++ b/configure @@ -380,8 +380,11 @@ if (defined $opt_away) $config{MAX_AWAY} = $opt_away; } -$config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/; -$config{HAS_OPENSSL} = $1; +if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/) { + $config{HAS_OPENSSL} = $1; +} else { + $config{HAS_OPENSSL} = ""; +} if ($config{GCCVER} eq "") { print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n"; @@ -546,7 +549,7 @@ $has_kqueue = 0; $fail = 0; open(KQUEUE, ")) { + while (defined(my $line = )) { chomp($line); # try and find the delcaration of: # int kqueue(void); @@ -643,7 +646,7 @@ $config{HAS_EPOLL} = $has_epoll; $config{HAS_KQUEUE} = $has_kqueue; printf "Checking for libgnutls... "; -if (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y")) { +if (defined($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y"))) { print "yes\n"; $config{HAS_GNUTLS} = "y"; } else { @@ -652,7 +655,7 @@ if (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y")) { } printf "Checking for openssl... "; -if (($config{HAS_OPENSSL}) || ($config{HAS_OPENSSL} eq "y")) { +if (defined($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL}) || ($config{HAS_OPENSSL} eq "y"))) { print "yes\n"; $config{HAS_OPENSSL} = "y"; } else { @@ -1044,16 +1047,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 -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"; 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) { @@ -1071,8 +1075,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"; @@ -1091,7 +1095,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"; } @@ -1366,14 +1370,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 - \$(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 - \$(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"; @@ -1396,9 +1400,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 " \$(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 " \$(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); @@ -1424,7 +1428,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 . " \$(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++; } @@ -1539,14 +1543,17 @@ sub write_dynamic_makefile } elsif ($line =~ /\/\* \$If: (\w+) \*\//i) { - if (($config{$1} !~ /y/i) and ($config{$1} ne "1")) + if (defined $config{$1}) { - # Skip to 'endif' - while (defined($line = )) + if (($config{$1} !~ /y/i) and ($config{$1} ne "1")) { - chomp($line); - die ("\$If buildsystem instruction within another \$If in file $dir/$name") if ($line =~ /\/\* \$If: (\w+) \*\//i); - last if ($line =~ /\/\* \$EndIf \*\//i); + # Skip to 'endif' + while (defined($line = )) + { + chomp($line); + die ("\$If buildsystem instruction within another \$If in file $dir/$name") if ($line =~ /\/\* \$If: (\w+) \*\//i); + last if ($line =~ /\/\* \$EndIf \*\//i); + } } } } @@ -1594,13 +1601,13 @@ sub write_dynamic_makefile if ($config{IS_DARWIN} eq "YES") { $libraryext = "dylib"; - $othercrap = " \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp\n \$(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 = " \$(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) @@ -1673,15 +1680,15 @@ EOM } } print FH $thislib . ": $cpp $deps ". (defined($specialdeps{$cpp}) ? $specialdeps{$cpp} : "") . "\n"; - print FH " \$(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 " \$(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); @@ -1707,17 +1714,17 @@ ITEM foreach my $cmd (@cmdlist) { print FH <