- foreach my $extra (<src/modules/extra/m_*.cpp>) {
- my $module_name = basename $extra, '.cpp';
- if (prompt_bool $interactive, "Would you like to enable $module_name?", 0) {
- enable_extras "$module_name.cpp";
+ for my $extra (<$RealDir/src/modules/extra/m_*.cpp>) {
+ my $module_name = module_shrink $extra;
+ if (prompt_bool $interactive, "Would you like to enable the <|BOLD $module_name|> module?", 0) {
+ enable_extras $module_name;
+ }
+ }
+} elsif (!defined $opt_disable_auto_extras) {
+ my %modules = (
+ 'm_argon2.cpp' => 'pkg-config --exists libargon2',
+ 'm_geo_maxmind.cpp' => 'pkg-config --exists libmaxminddb',
+ 'm_mysql.cpp' => 'mysql_config --version',
+ 'm_pgsql.cpp' => 'pg_config --version',
+ 'm_ldap.cpp' => "echo '#include <ldap.h>' | $config{CXX} -E -",
+ 'm_regex_pcre.cpp' => 'pcre-config --version',
+ 'm_regex_posix.cpp' => undef,
+ 'm_regex_re2.cpp' => 'pkg-config --exists re2',
+ 'm_regex_stdlib.cpp' => "$config{CXX} -o /dev/null -std=c++11 $RealDir/make/test/compiler.cpp",
+ 'm_regex_tre.cpp' => 'pkg-config --exists tre',
+ 'm_sqlite3.cpp' => 'pkg-config --exists sqlite3',
+ 'm_ssl_gnutls.cpp' => 'pkg-config --exists gnutls',
+ 'm_ssl_mbedtls.cpp' => "echo '#include <mbedtls/version.h>' | $config{CXX} -E -",
+ 'm_ssl_openssl.cpp' => 'pkg-config --exists openssl',
+ 'm_sslrehashsignal.cpp' => undef,
+ );
+ while (my ($module, $command) = each %modules) {
+ unless (defined $command && system "$command 1>/dev/null 2>/dev/null") {
+ enable_extras $module;