]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Merge branch 'master+writev'
[user/henk/code/inspircd.git] / configure
index a9a97dca53fbeb4a778552f1665b429e57f8b315..d7cf0d732917a1e02e0b6c6053933ca2d24039be 100755 (executable)
--- a/configure
+++ b/configure
@@ -39,14 +39,15 @@ use File::Spec::Functions qw(rel2abs);
 use Getopt::Long          qw(GetOptions);
 use POSIX                 qw(getgid getuid);
 
+use make::common;
 use make::configure;
 use make::console;
-use make::utilities;
 
 my ($opt_binary_dir,
     $opt_config_dir,
     $opt_data_dir,
     $opt_disable_interactive,
+    $opt_distribution_label,
     $opt_gid,
     $opt_log_dir,
     $opt_manual_dir,
@@ -70,18 +71,19 @@ GetOptions(
        'help'   => \&cmd_help,
        'update' => \&cmd_update,
 
-       'disable-interactive' => \$opt_disable_interactive,
-       'binary-dir=s'        => \$opt_binary_dir,
-       'config-dir=s'        => \$opt_config_dir,
-       'data-dir=s'          => \$opt_data_dir,
-       'gid=s'               => \$opt_gid,
-       'log-dir=s'           => \$opt_log_dir,
-       'manual-dir=s'        => \$opt_manual_dir,
-       'module-dir=s'        => \$opt_module_dir,
-       'prefix=s'            => \$opt_prefix,
-       'socketengine=s'      => \$opt_socketengine,
-       'system'              => \$opt_system,
-       'uid=s'               => \$opt_uid,
+       'disable-interactive'  => \$opt_disable_interactive,
+       'distribution-label=s' => \$opt_distribution_label,
+       'binary-dir=s'         => \$opt_binary_dir,
+       'config-dir=s'         => \$opt_config_dir,
+       'data-dir=s'           => \$opt_data_dir,
+       'gid=s'                => \$opt_gid,
+       'log-dir=s'            => \$opt_log_dir,
+       'manual-dir=s'         => \$opt_manual_dir,
+       'module-dir=s'         => \$opt_module_dir,
+       'prefix=s'             => \$opt_prefix,
+       'socketengine=s'       => \$opt_socketengine,
+       'system'               => \$opt_system,
+       'uid=s'                => \$opt_uid,
 
        # TODO: when the modulemanager rewrite is done these should be removed.
        'disable-extras=s@' => \@opt_disableextras,
@@ -106,6 +108,7 @@ our $interactive = !(
        defined $opt_config_dir ||
        defined $opt_data_dir ||
        defined $opt_disable_interactive ||
+       defined $opt_distribution_label ||
        defined $opt_gid ||
        defined $opt_log_dir ||
        defined $opt_manual_dir ||
@@ -178,6 +181,12 @@ if (defined $opt_socketengine) {
        }
 }
 
+# If the user has specified a distribution label then we use it in
+# place of the label from src/version.sh or Git.
+if (defined $opt_distribution_label) {
+       $version{LABEL} = $opt_distribution_label;
+}
+
 if (defined $opt_system) {
        $config{BASE_DIR}   = $opt_prefix     || '/var/lib/inspircd';
        $config{BINARY_DIR} = $opt_binary_dir || '/usr/sbin';
@@ -291,8 +300,8 @@ if (<src/modules/m_ssl_*.cpp> && prompt_bool $interactive, 'Would you like to ge
        system './tools/genssl', 'auto';
 }
 
-write_configure_cache %config if $interactive;
-parse_templates \%config, \%compiler;
+write_configure_cache %config;
+parse_templates \%config, \%compiler, \%version;
 
 print_format <<"EOM";
 
@@ -303,10 +312,15 @@ Configuration is complete! You have chosen to build with the following settings:
   <|GREEN Name:|>    $compiler{NAME}
   <|GREEN Version:|> $compiler{VERSION}
 
-<|GREEN Extra Modules:|> <<TODO>>
-  * m_foo
-  * m_bar
-  * m_baz
+<|GREEN Extra Modules:|>
+EOM
+
+for my $file (<src/modules/m_*>) {
+       my $module = basename $file, '.cpp';
+       print "  * $module\n" if -l $file;
+}
+
+print_format <<"EOM";
 
 <|GREEN Paths:|>
   <|GREEN Base:|>   $config{BASE_DIR}