X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=a13f59c8135372c9a246135c0b989e4ff5ca4353;hb=e7310ca2f66d2e267efc62deca53a8b534bdd0eb;hp=001cf0ddec84b0dca352cafe5ac3e18e80acb280;hpb=e281922d55e302bd823be89895006239248505e3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 001cf0dde..a13f59c81 100755 --- a/configure +++ b/configure @@ -49,9 +49,10 @@ my @immutabledeps = ( # ############################################################################################### -# List of commands that make up 'make install' +# List of commands that make up 'make install' and 'make deinstall' my $install_list = ""; +my $uninstall_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 @@ -97,6 +98,7 @@ GetOptions ( 'disable-ports' => \$opt_noports, 'disable-epoll' => \$opt_noepoll, 'disable-kqueue' => \$opt_nokqueue, + 'disable-rpath' => \$opt_disablerpath, 'enable-ipv6' => \$opt_ipv6, 'enable-remote-ipv6' => \$opt_ipv6links, 'disable-remote-ipv6' => \$opt_noipv6links, @@ -351,7 +353,7 @@ getmodules(); sub clean { - system("rm -rf .config.cache"); + unlink(".config.cache"); } sub update @@ -367,7 +369,7 @@ sub update exit 0; } else { # We've Loaded the cache file and all our variables.. - print "Updating Files..\n"; + print "Updating files...\n"; getosflags(); if ($opt_disable_debug == 1) { @@ -404,7 +406,7 @@ sub modupdate exit 0; } else { # We've Loaded the cache file and all our variables.. - print "Updating Files..\n"; + print "Updating files...\n"; getosflags(); $has_epoll = $config{HAS_EPOLL}; $has_ports = $config{HAS_PORTS}; @@ -592,7 +594,7 @@ $config{HAS_EPOLL} = $has_epoll; $config{HAS_KQUEUE} = $has_kqueue; printf "Checking for libgnutls... "; -if (($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS} >= 1.2) || ($config{HAS_GNUTLS} eq "y"))) { +if (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y")) { print "yes\n"; $config{HAS_GNUTLS} = "y"; } else { @@ -601,7 +603,7 @@ if (($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS} >= 1.2) || ($config{HAS_GNUTL } printf "Checking for openssl... "; -if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPENSSL} eq "y"))) { +if (($config{HAS_OPENSSL}) || ($config{HAS_OPENSSL} eq "y")) { print "yes\n"; $config{HAS_OPENSSL} = "y"; } else { @@ -1007,13 +1009,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"; - $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared"; + $config{FLAGS} = "-fPIC -Wall -pedantic $config{OPTIMISATI}"; + $config{DEVELOPER} = "-fPIC -Wall -pedantic -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 -Woverloaded-virtual -Wno-deprecated $config{OPTIMISATI}"; + $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall -pedantic $config{OPTIMISATI}"; $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup"; $config{LDLIBS} = "-ldl -lstdc++"; } @@ -1034,7 +1036,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 -Wall -pedantic $config{OPTIMISATI}"; $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS}); $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS}); $config{MAKEPROG} = "make"; @@ -1166,7 +1168,7 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; #ifndef __CONFIGURATION_SOCKETENGINE__ #define __CONFIGURATION_SOCKETENGINE__ -#include "$se.h" +#include "socketengines/$se.h" #endif EOF @@ -1188,6 +1190,7 @@ EOF if (opendir(MDIRHANDLE, "src/modules/$name") != 0) { closedir(MDIRHANDLE); $modules .= "$name.so "; + $uninstall_list = $uninstall_list . " -rm \$(MODULES)/$name.so\n"; } } } @@ -1211,9 +1214,9 @@ EOF # 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(); + print "Writing \033[1;32mMakefiles\033[0m\n"; write_dynamic_modules_makefile(); + write_dynamic_makefile(); opendir(DIRHANDLE, $this); @@ -1251,6 +1254,7 @@ EOF $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/; $tmp =~ s/\@VERSION\@/$version/; $tmp =~ s/\@INSTALL_LIST\@/$install_list/; + $tmp =~ s/\@UNINSTALL_LIST\@/$uninstall_list/; open(FILEHANDLE, ">$file"); print FILEHANDLE $tmp; @@ -1289,13 +1293,13 @@ EOF if ($config{OSNAME} =~ /darwin/) { print FILEHANDLE <)) + if ($name =~ /\.cpp$/) { - 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) + open (CPP, "<$dir/$name") or die("Can't open $dir/$name to scan it! oh bugger"); + print "."; + while (chomp($line = )) { - if (($config{$1} !~ /y/i) and ($config{$1} ne "1")) + if ($line =~ /\/\* \$Core: (\w+) \*\//i) + { + $filelist{$name} = $1; + } + 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 $dir/$name") if ($line =~ /\/\* \$If: (\w+) \*\//i); + last if ($line =~ /\/\* \$EndIf \*\//i); + } + } + } + elsif ($line =~ /\/\* \$Install: (.*?) \*\//i) + { + if (!exists($existing_install_list{$1})) + { + $existing_install_list{$1} = 1; + $idir = (split(' ',$1))[1]; + $ifile = (split(' ',$1))[0]; + $install_list = $install_list . " -install -m \$(INSTMODE) $1\n"; + $ifile =~ s/.*\///g; + $uninstall_list = $uninstall_list . " -rm $idir/$ifile\n"; + } + } + elsif ($line =~ /\/\* \$CopyInstall: (.*?) \*\//i) { - # Skip to 'endif' - while (chomp($line = )) + if (!exists($existing_install_list{$1})) { - die ("\$If buildsystem instruction within another \$If in file src/$name") if ($line =~ /\/\* \$If: (\w+) \*\//i); - last if ($line =~ /\/\* \$EndIf \*\//i); + $existing_install_list{$1} = 1; + $idir = (split(' ',$1))[1]; + $ifile = (split(' ',$1))[0]; + $install_list = $install_list . " -cp $1\n"; + $ifile =~ s/.*\///g; + $uninstall_list = $uninstall_list . " -rm $idir/$ifile\n"; } } } + close CPP; } - close CPP; } + closedir(DIRHANDLE); + print " done!\n"; } - closedir(DIRHANDLE); - print " done!\n"; $freebsd4libs = $config{CRAQ}; @@ -1512,7 +1556,8 @@ sub write_dynamic_makefile else { $libraryext = "so"; - $othercrap = " \$(CC) -pipe -I../include -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) "; + $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) "; } foreach my $cpp (sort keys %filelist) @@ -1520,6 +1565,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"; + $uninstall_list = $uninstall_list . " -rm \$(LIBPATH)/" . $filelist{$cpp} . "." . $libraryext . "\n"; } $all = $all . "moo inspircd\n"; @@ -1561,7 +1607,14 @@ EOM } else { - $libcrap = "-Wl,--rpath -Wl," . $config{LIBRARY_DIR} . " -shared"; + if (defined $opt_disablerpath) + { + $libcrap = " -shared"; + } + else + { + $libcrap = "-Wl,--rpath -Wl," . $config{LIBRARY_DIR} . " -shared"; + } } $deps = calcdeps("src/$cpp"); if (exists($extrasources{$cpp}))