X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=ded314ea441a48a42879b243318961353c658700;hb=b86fe63a3a368d304632a3dfcba77048315c9241;hp=3c50fcd7d5e8aeb6b4171d10bf76fc4311030494;hpb=8692ce1b65bd38c41f36fdbb7fa2000b1ce03639;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 3c50fcd7d..ded314ea4 100755 --- a/configure +++ b/configure @@ -41,7 +41,7 @@ use Getopt::Long; use make::configure; use make::utilities; -our ($opt_use_gnutls, $opt_use_openssl, $opt_nointeractive, $opt_socketengine, $opt_freebsd_port, +our ($opt_use_gnutls, $opt_use_openssl, $opt_nointeractive, $opt_socketengine, $opt_system, $opt_uid, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir, $opt_data_dir, $opt_log_dir); @@ -61,7 +61,6 @@ GetOptions ( 'enable-openssl' => \$opt_use_openssl, 'disable-interactive' => \$opt_nointeractive, 'socketengine=s' => \$opt_socketengine, - 'enable-freebsd-ports-openssl' => \$opt_freebsd_port, 'prefix=s' => \$opt_base_dir, 'config-dir=s' => \$opt_config_dir, 'module-dir=s' => \$opt_module_dir, @@ -99,8 +98,7 @@ our $interactive = !( (defined $opt_use_openssl) || (defined $opt_system) || (defined $opt_uid) || - (defined $opt_use_gnutls) || - (defined $opt_freebsd_port) + (defined $opt_use_gnutls) ); our $topdir = getcwd(); @@ -149,28 +147,8 @@ if (defined $opt_data_dir) { if (defined $opt_log_dir) { $config{LOG_DIR} = $opt_log_dir; } -chomp($config{HAS_GNUTLS} = `pkg-config --modversion gnutls 2>/dev/null`); # GNUTLS Version. - -if (defined $opt_freebsd_port) -{ - chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); - chomp($config{HAS_OPENSSL_PORT} = `pkg-config --modversion openssl 2>/dev/null`); - $config{USE_FREEBSD_BASE_SSL} = "n"; -} -else -{ - if ($^O eq "freebsd") - { - # default: use base ssl - chomp($config{HAS_OPENSSL} = `openssl version | cut -d ' ' -f 2`); # OpenSSL version, freebsd specific - chomp($config{HAS_OPENSSL_PORT} = `pkg-config --modversion openssl 2>/dev/null`); # Port version, may be different - } - else - { - chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); # Openssl version, others - $config{HAS_OPENSSL_PORT} = ""; - } -} +chomp($config{HAS_GNUTLS} = `pkg-config --modversion gnutls 2>/dev/null`); +chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); chomp(our $gnutls_ver = $config{HAS_GNUTLS}); chomp(our $openssl_ver = $config{HAS_OPENSSL}); @@ -246,43 +224,24 @@ print "Running non-interactive configure...\n" unless $interactive; print "Checking for cache from previous configure... "; print ($cache_loaded ? "found\n" : "not found\n"); -print "Checking whether clock_gettime() is available... "; -if (test_file($config{CXX}, "clock_gettime.cpp", "-lrt")) { - $config{HAS_CLOCK_GETTIME} = "true"; - print "yes\n"; -} else { - $config{HAS_CLOCK_GETTIME} = "false"; - print "no\n"; -} +$config{HAS_CLOCK_GETTIME} = run_test 'clock_gettime()', test_file($config{CXX}, 'clock_gettime.cpp', '-lrt'); +$config{HAS_EVENTFD} = run_test 'eventfd()', test_file($config{CXX}, 'eventfd.cpp'); -print "Checking whether eventfd() is available... "; -if (test_file($config{CXX}, "eventfd.cpp")) { - $config{HAS_EVENTFD} = "true"; - print "yes\n"; -} else { - $config{HAS_EVENTFD} = "false"; - print "no\n"; +if ($config{HAS_EPOLL} = run_test 'epoll', test_header($config{CXX}, 'sys/epoll.h')) { + $config{SOCKETENGINE} ||= 'epoll'; } -print "Checking whether epoll is available... "; -$config{HAS_EPOLL} = test_header($config{CXX}, "sys/epoll.h"); -print $config{HAS_EPOLL} ? "yes\n" : "no\n"; -$config{SOCKETENGINE} ||= "epoll" if $config{HAS_EPOLL}; - -print "Checking whether Kqueue is available... "; -$config{HAS_KQUEUE} = test_file($config{CXX}, "kqueue.cpp"); -print $config{HAS_KQUEUE} ? "yes\n" : "no\n"; -$config{SOCKETENGINE} ||= "kqueue" if $config{HAS_KQUEUE}; +if ($config{HAS_KQUEUE} = run_test 'kqueue', test_file($config{CXX}, 'kqueue.cpp')) { + $config{SOCKETENGINE} ||= 'kqueue'; +} -print 'Checking whether Solaris IOCP is available... '; -$config{HAS_PORTS} = test_header($config{CXX}, 'port.h'); -print $config{HAS_PORTS} ? "yes\n" : "no\n"; -$config{SOCKETENGINE} ||= "ports" if $config{HAS_PORTS}; +if ($config{HAS_PORTS} = run_test 'Solaris IOCP', test_header($config{CXX}, 'port.h')) { + $config{SOCKETENGINE} ||= 'ports'; +} -print 'Checking whether poll is available... '; -$config{HAS_POLL} = test_header($config{CXX}, 'poll.h'); -print $config{HAS_POLL} ? "yes\n" : "no\n"; -$config{SOCKETENGINE} ||= "poll" if $config{HAS_POLL}; +if ($config{HAS_POLL} = run_test 'poll', test_header($config{CXX}, 'poll.h')) { + $config{SOCKETENGINE} ||= 'poll'; +} # Select is available on all platforms $config{HAS_SELECT} = 1; @@ -421,28 +380,6 @@ STOP $config{SOCKETENGINE} = "select"; } - $config{USE_FREEBSD_BASE_SSL} = "n"; - $config{USE_FREEBSD_PORTS_SSL} = "n"; - if ($config{HAS_OPENSSL_PORT} ne "") - { - $config{USE_FREEBSD_PORTS_SSL} = "y"; - print "I have detected the OpenSSL FreeBSD port installed on your system,\n"; - print "version \e[1;32m".$config{HAS_OPENSSL_PORT}."\e[0m. Your base system OpenSSL is version \e[1;32m".$openssl_ver."\e[0m.\n\n"; - yesno('USE_FREEBSD_PORTS_SSL', "Do you want to use the FreeBSD ports version?"); - print "\n"; - $config{USE_FREEBSD_BASE_SSL} = "y" if ($config{USE_FREEBSD_PORTS_SSL} eq "n"); - - if ($config{USE_FREEBSD_BASE_SSL} eq "n") - { - # update to port version - $openssl_ver = $config{HAS_OPENSSL_PORT}; - } - } - else - { - $config{USE_FREEBSD_BASE_SSL} = "y" if ($^O eq "freebsd"); - } - $config{USE_SSL} = "n"; if ($config{HAS_GNUTLS} eq "y" || $config{HAS_OPENSSL} eq "y") @@ -484,12 +421,12 @@ symlink "extra/m_regex_posix.cpp", "src/modules/m_regex_posix.cpp"; if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y")) { - print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n"; + print "Sorry, but i couldn't detect gnutls. Make sure pkg-config is in your path.\n"; exit 1; } if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y")) { - print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n"; + print "Sorry, but i couldn't detect openssl. Make sure pkg-config is in your path.\n"; exit 1; } @@ -550,7 +487,7 @@ if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) { print "Skipping SSL Certificate generation, SSL support is not available.\n\n"; } -depcheck(); +getmodules(); writefiles(); makecache(); dumphash(); @@ -668,10 +605,10 @@ sub writefiles { EOF - if ($config{HAS_EVENTFD} eq 'true') { + if ($config{HAS_EVENTFD}) { print FILEHANDLE "#define HAS_EVENTFD\n"; } - if ($config{HAS_CLOCK_GETTIME} eq 'true') { + if ($config{HAS_CLOCK_GETTIME}) { print FILEHANDLE "#define HAS_CLOCK_GETTIME\n"; } @@ -751,15 +688,6 @@ EOF chmod 0755, 'inspircd'; } -sub depcheck -{ - getmodules(); - for my $mod (@modlist) { - getcompilerflags("src/modules/m_$mod.cpp"); - getlinkerflags("src/modules/m_$mod.cpp"); - } -} - # Routine to list out the extra/ modules that have been enabled. # Note: when getting any filenames out and comparing, it's important to lc it if the # file system is not case-sensitive (== Epoc, MacOS, OS/2 (incl DOS/DJGPP), VMS, Win32 @@ -823,7 +751,7 @@ EXTRA: for my $extra (@extras) { for my $extra (keys(%extras)) { next unless $extras{$extra} =~ m/enabled/; # only process enabled extras. my $abs_extra = File::Spec->catfile($abs_srcdir, "extra", $extra); - my @deps = split / +/, getdependencies($abs_extra); + my @deps = split /\s+/, get_property($abs_extra, 'ModDep'); for my $dep (@deps) { if (exists($extras{$dep})) { my $ref = \$extras{$dep}; # Take reference. @@ -870,7 +798,7 @@ sub enable_extras (@) { next; } # Get dependencies, and add them to be processed. - my @deps = split / +/, getdependencies($extrapath); + my @deps = split /\s+/, get_property($extrapath, 'ModDep'); for my $dep (@deps) { next if scalar(grep { $_ eq $dep } (@extras)) > 0; # Skip if we're going to be enabling it anyway. if (!-e "src/modules/$dep" && !-e "include/$dep") { @@ -906,7 +834,7 @@ EXTRA: for my $extra (@extras) { } # Check if anything needs this. for my $file (@files) { - my @deps = split / +/, getdependencies("src/modules/extra/$file"); + my @deps = split /\s+/, get_property("src/modules/extra/$file", 'ModDep'); # File depends on this extra... if (scalar(grep { $_ eq $extra } @deps) > 0) { # And is both enabled and not about to be disabled.