]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Make cmd_whowas act like a module, remove special handling
[user/henk/code/inspircd.git] / configure
index dc7d113916196938c0f5d6c380d57ac292d1b9a6..32ac8f40fa19a7e58bb24702c88d90c897a94698 100755 (executable)
--- a/configure
+++ b/configure
@@ -47,8 +47,6 @@ use Getopt::Long;
 # Utility functions for our buildsystem
 use make::utilities;
 use make::configure;
-use make::gnutlscert;
-use make::opensslcert;
 
 ###############################################################################################
 #
@@ -102,8 +100,8 @@ GetOptions (
        'list-extras' => sub { list_extras; exit 0; }, # This, --enable-extras, and --disable-extras are for non-interactive managing.
        'enable-extras=s@' => \@opt_enableextras, # ^
        'disable-extras=s@' => \@opt_disableextras, # ^
-       'generate-openssl-cert' => sub { make_openssl_cert(); exit(0); },
-       'generate-gnutls-cert' => sub { make_gnutls_cert(); exit(0); }
+       'generate-openssl-cert' => sub { exec './tools/genssl openssl'; },
+       'generate-gnutls-cert' => sub { exec './tools/genssl gnutls'; }
 );
 
 if (scalar(@opt_enableextras) + scalar(@opt_disableextras) > 0) {
@@ -152,11 +150,11 @@ $config{BASE_DIR} = $config{ME}."/run";
 
 if (defined $opt_base_dir) {
        $config{BASE_DIR} = $opt_base_dir;
-} elsif (defined $opt_system || defined $opt_uid) {
+} elsif (defined $opt_system) {
        $config{BASE_DIR} = '/var/lib/inspircd';
 }
 
-if (defined $opt_system || defined $opt_uid) {
+if (defined $opt_system) {
        $config{UID} = $opt_uid || 'ircd';
        $config{CONFIG_DIR}      = '/etc/inspircd';
        $config{MODULE_DIR}      = '/usr/lib/inspircd';
@@ -165,7 +163,7 @@ if (defined $opt_system || defined $opt_uid) {
        $config{DATA_DIR}        = '/var/inspircd';
        $config{LOG_DIR}         = '/var/log/inspircd';
 } else {
-       $config{UID} = $<;
+       $config{UID} = $opt_uid || $<;
        $config{CONFIG_DIR}      = resolve_directory($config{BASE_DIR}."/conf");        # Configuration Directory
        $config{MODULE_DIR}      = resolve_directory($config{BASE_DIR}."/modules");     # Modules Directory
        $config{BINARY_DIR}      = resolve_directory($config{BASE_DIR}."/bin");         # Binary Directory
@@ -273,7 +271,7 @@ $exec = $config{CC} . " -dumpversion | cut -c 3";
 chomp($config{GCCMINOR}                = `$exec`);
 $config{MAXBUF}                        = "512";                                # Max buffer size
 
-if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/) {
+if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)(?:[a-z])?(?:\-[a-z][0-9])?/) {
        $config{HAS_OPENSSL} = $1;
 } else {
        $config{HAS_OPENSSL} = "";
@@ -692,7 +690,7 @@ if ($config{USE_GNUTLS} eq "y") {
 * few times and get that HD going :) Then answer the        *
 * Questions which follow. If you are unsure, just hit enter *
 *************************************************************\n\n";
-                       $failed = make_gnutls_cert();
+                       $failed = system "./tools/genssl gnutls";
                        if ($failed) {
                                print "\n\e[1;32mCertificate generation failed!\e[0m\n\n";
                        } else {
@@ -726,7 +724,7 @@ if ($config{USE_OPENSSL} eq "y") {
 * Generating the certificates may take some time, go grab a *
 * coffee, or something.                                            *
 *************************************************************\n\n";
-                       make_openssl_cert();
+                       system "./tools/genssl openssl";
                        print "\nCertificate generation complete, copying to config directory... ";
                        File::Copy::move("key.pem", "$config{CONFIG_DIR}/key.pem") or print STDERR "Could not copy key.pem!\n";
                        File::Copy::move("cert.pem", "$config{CONFIG_DIR}/cert.pem") or print STDERR "Could not copy cert.pem!\n";
@@ -904,15 +902,6 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n";
                if ($config{GCCVER} >= 3) {
                        print FILEHANDLE "#define GCC3\n";
                }
-               if (
-                       (($config{GCCVER} == 4) && ($config{GCCMINOR} >= 3))
-                               ||
-                       ($config{GCCVER} > 4)
-                               || # HACK: temporary fix for non-GCC (i.e. clang) builds
-                       ($config{CC} !~ /gcc/)
-               ) {
-                       print FILEHANDLE "#define HASHMAP_DEPRECATED\n";
-               }
                if ($config{HAS_STRLCPY} eq "true") {
                        print FILEHANDLE "#define HAS_STRLCPY\n";
                }