X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=b5a0f7cf5fdb5a3508b5cf40c2fe40b6cc16df8e;hb=1db092e08ecaf03f1080c8d501ab17082040fec6;hp=adc05f865d04b42b2b95677de48867c6d432163b;hpb=6ded0e838fa1b173b4a37bc0369dc0f640b4c1ca;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index adc05f865..b5a0f7cf5 100755 --- a/configure +++ b/configure @@ -29,63 +29,6 @@ use make::opensslcert; # ############################################################################################### -# This is a list of all files in the core. Each cpp file is mapped to a shared object file, -# whos file extension is omitted (these can vary from system to system). - -my %filelist = ( - "channels.cpp" => "libIRCDchannels", - "mode.cpp" => "libIRCDmode", - "xline.cpp" => "libIRCDxline", - "inspstring.cpp" => "libIRCDstring", - "dns.cpp" => "libIRCDasyncdns", - "base.cpp" => "libIRCDbase", - "configreader.cpp" => "libIRCDconfigreader", - "inspsocket.cpp" => "libIRCDinspsocket", - "commands.cpp" => "libIRCDcommands", - "dynamic.cpp" => "libIRCDdynamic", - "users.cpp" => "libIRCDusers", - "modules.cpp" => "libIRCDmodules", - "wildcard.cpp" => "libIRCDwildcard", - "helperfuncs.cpp" => "libIRCDhelper", - "hashcomp.cpp" => "libIRCDhash", - "socket.cpp" => "libIRCDsocket", - "socketengine.cpp" => "libIRCDsocketengine", - "userprocess.cpp" => "libIRCDuserprocess", - "cull_list.cpp" => "libIRCDcull_list", - "command_parse.cpp" => "libIRCDcommand_parse", - "timer.cpp" => "libIRCDtimer", - "snomasks.cpp" => "libIRCDsnomasks", - "server.cpp" => "libIRCDserver", - "filelogger.cpp" => "libIRCDfilelogger", - "user_resolver.cpp" => "libIRCDuserresolver", -); - -# If you wish for a file to have special dependencies in the makefile, add an entry here. - -my %specialdeps = ( - "mode.cpp" => "\$(RELCPPFILES)", -); - -# If you wish for a file to have extra make lines (in between the compile and link steps) -# then insert them here. - -my %extrabuildlines = ( - "mode.cpp" => "\${MAKE} -C \"modes\" DIRNAME=\"src/modes\" CC=\"\$(CC)\" \$(MAKEARGS) CPPFILES=\"\$(CPPFILES)\"", -); - -# If you wish for a file to be linked against extra objects or arctives, insert them here. - -my %extraobjects = ( - "mode.cpp" => "modes/modeclasses.a" -); - -# If you wish to compile extra cpp sources into an object, define them here. -# NOTE: Certain cpp files such as the socket engines have a value auto calculated -# for this table so that their derived class is built. - -my %extrasources = ( -); - # If you wish to ignore a dependency throughout the entire core, add it here. my @ignoredeps = ( @@ -100,13 +43,45 @@ my @immutabledeps = ( "inspircd.h", ); - ############################################################################################### # # NON-EDITABLE VARIABLES # ############################################################################################### +# List of commands that make up 'make install' + +my $install_list = ""; + +# This is a list of all files in the core. Each cpp file is mapped to a shared object file, +# whos file extension is omitted (these can vary from system to system). Auto detected by +# scanning the src/*.cpp files for files containing /* $Core: */ identifiers. + +my %filelist = (); + +# If you wish for a file to have special dependencies in the makefile, add an entry here. +# Auto populated by /* $ExtraDeps: */ instruction + +my %specialdeps = (); + +# If you wish for a file to have extra make lines (in between the compile and link steps) +# then insert them here. +# Auto populated by /* $ExtraBuild: */ instruction + +my %extrabuildlines = (); + +# If you wish for a file to be linked against extra objects or arctives, insert them here. +# Auto populated by /* $ExtraObjects: */ instruction + +my %extraobjects = (); + +# If you wish to compile extra cpp sources into an object, define them here. +# NOTE: Certain cpp files such as the socket engines have a value auto calculated +# for this table so that their derived class is built. +# Auto populated by /* $ExtraSources: */ instruction + +my %extrasources = (); + GetOptions ( 'enable-gnutls' => \$opt_use_gnutls, @@ -1032,13 +1007,13 @@ sub dir_check { sub getosflags { $config{LDLIBS} = "-lstdc++"; - $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual -Wno-deprecated $config{OPTIMISATI}"; - $config{DEVELOPER} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual -Wno-deprecated -g"; + $config{FLAGS} = "-fPIC -W -pedantic $config{OPTIMISATI}"; + $config{DEVELOPER} = "-fPIC -W -pedantic -g"; $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared"; $config{MAKEPROG} = "make"; if ($config{OSNAME} =~ /darwin/i) { - $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall -Woverloaded-virtual -Wno-deprecated $config{OPTIMISATI}"; + $config{FLAGS} = "-DDARWIN -frtti -fPIC -W -pedantic $config{OPTIMISATI}"; $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup"; $config{LDLIBS} = "-ldl -lstdc++"; } @@ -1059,7 +1034,7 @@ sub getosflags { if ($config{OSNAME} =~ /Linux/i) { $config{LDLIBS} = "-ldl -lstdc++"; - $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual -Wno-deprecated $config{OPTIMISATI}"; + $config{FLAGS} = "-fPIC -W -pedantic $config{OPTIMISATI}"; $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS}); $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS}); $config{MAKEPROG} = "make"; @@ -1224,8 +1199,6 @@ EOF my $file = ""; my $exe = "inspircd"; - opendir(DIRHANDLE, $this); - # Do this once here, and cache it in the .*.inc files, # rather than attempting to read src/version.sh from # compiled code -- we might not have the source to hand. @@ -1235,14 +1208,15 @@ EOF chomp(my $revision = getrevision()); $version = "$version(r$revision)"; - my $LIBEXT = "so"; - if ($config{IS_DARWIN} eq "YES") - { - $LIBEXT = "dylib"; - } # We can actually parse any file starting with . and ending with .inc, # but right now we only parse .inspircd.inc to form './inspircd' + print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n"; + write_dynamic_makefile(); + write_dynamic_modules_makefile(); + + opendir(DIRHANDLE, $this); + foreach $name (sort readdir(DIRHANDLE)) { if ($name =~ /^\.(.+)\.inc$/) { $file = $1; @@ -1252,12 +1226,13 @@ EOF # All .name.inc files need parsing! $tmp = ""; - open(FILEHANDLE, ".$file.inc"); + open(FILEHANDLE, ".$file.inc") or die ("Can't open .$file.inc"); while () { $tmp .= $_; } close(FILEHANDLE); + print "Writing \033[1;32m$file\033[0m ...\n"; $tmp =~ s/\@CC\@/$config{CC}/; $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/; $tmp =~ s/\@FLAGS\@/$config{FLAGS}/; @@ -1268,7 +1243,6 @@ EOF $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/; $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/; $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/; - $tmp =~ s/\@LIBRARY_EXT\@/$LIBEXT/; $tmp =~ s/\@MODULES\@/$modules/; $tmp =~ s/\@STARTSCRIPT\@/$config{STARTSCRIPT}/; $tmp =~ s/\@DESTINATION\@/$config{DESTINATION}/; @@ -1276,8 +1250,8 @@ EOF $tmp =~ s/\@EXECUTABLE\@/$exe/; $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/; $tmp =~ s/\@VERSION\@/$version/; + $tmp =~ s/\@INSTALL_LIST\@/$install_list/; - print "Writing \033[1;32m$file\033[0m\n"; open(FILEHANDLE, ">$file"); print FILEHANDLE $tmp; } @@ -1286,10 +1260,6 @@ EOF # Make inspircd executable! chmod 0744, 'inspircd'; - - print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n"; - write_dynamic_makefile(); - write_dynamic_modules_makefile(); } sub write_dynamic_modules_makefile { @@ -1319,13 +1289,13 @@ EOF if ($config{OSNAME} =~ /darwin/) { print FILEHANDLE <)) + { + if ($line =~ /\/\* \$Core: (\w+) \*\//i) + { + $filelist{$name} = $1; + print "."; + } + elsif ($line =~ /\/\* \$ExtraDeps: (.*?) \*\//i) + { + $specialdeps{$name} = $1; + } + elsif ($line =~ /\/\* \$ExtraObjects: (.*?) \*\//i) + { + $extraobjects{$name} = $1; + } + elsif ($line =~ /\/\* \$ExtraBuild: (.*?) \*\//i) + { + $extrabuildlines{$name} = $1; + } + elsif ($line =~ /\/\* \$ExtraSources: (.*?) \*\//i) + { + $extrasources{$name} = $1; + } + elsif ($line =~ /\/\* \$If: (\w+) \*\//i) + { + if (($config{$1} !~ /y/i) and ($config{$1} ne "1")) + { + # Skip to 'endif' + while (chomp($line = )) + { + die ("\$If buildsystem instruction within another \$If in file src/$name") if ($line =~ /\/\* \$If: (\w+) \*\//i); + last if ($line =~ /\/\* \$EndIf \*\//i); + } + } + } + } + close CPP; + } + } + closedir(DIRHANDLE); + print " done!\n"; $freebsd4libs = $config{CRAQ}; @@ -1498,6 +1533,7 @@ sub write_dynamic_makefile { { $all = $all . $filelist{$cpp} . "." . $libraryext . " "; $all_libsonly = $all_libsonly . $filelist{$cpp} . "." . $libraryext . " "; + $install_list = $install_list . " -install -m \$(INSTMODE) src/" . $filelist{$cpp} . "." . $libraryext . " \$(LIBPATH)\n"; } $all = $all . "moo inspircd\n";