$config{CHANGE_COMPILER} = "n";
print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
-if ($config{GCCVER} < 3) {
+while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) {
print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
-should NOT be used. You should probably specify a newer compiler.\n";
-}
-yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
-if ($config{CHANGE_COMPILER} =~ /y/i) {
- print "What command do you want to use to invoke your compiler?\n";
- print "[\033[1;32m$config{CC}\033[0m] -> ";
- chomp($config{CC} = <STDIN>);
- if ($config{CC} eq "") {
- $config{CC} = "g++";
- }
- chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
- if ($foo ne "") {
- chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change
- chomp($config{GCC34} = `$config{CC} -dumpversion | cut -c 3`); # the compiler path
- print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
- }
- else {
- print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
+should NOT be used. You should probably specify a newer compiler.\n\n";
+ yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
+ if ($config{CHANGE_COMPILER} =~ /y/i) {
+ print "What command do you want to use to invoke your compiler?\n";
+ print "[\033[1;32m$config{CC}\033[0m] -> ";
+ chomp($config{CC} = <STDIN>);
+ if ($config{CC} eq "") {
+ $config{CC} = "g++";
+ }
+ chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
+ if ($foo ne "") {
+ chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change
+ chomp($config{GCC34} = `$config{CC} -dumpversion | cut -c 3`); # the compiler path
+ print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
+ if ($config{GCCVER} < 3) {
+ print "\033[1;32mGCC 2.x WILL NOT WORK!\033[0m. Let's try that again, shall we?\n";
+ }
+ }
+ else {
+ print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
+ }
}
}
print "\033[0mOpenSSL Support:\033[1;32m\t\t$config{USE_OPENSSL}\033[0m\n\n";
if ($config{USE_GNUTLS} eq "y") {
- system("cd src/modules");
- system("ln -s extra/m_ssl_gnutls.cpp");
- system("cd ../..");
+ $failed = 0;
+ open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
+ close(TMP);
+ if ($failed) {
+ print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
+ chdir("src/modules");
+ system("ln -s extra/m_ssl_gnutls.cpp");
+ chdir("../..");
+ }
getmodules();
$failed = 0;
open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
print "SSL Certificates found, skipping.\n\n"
}
} elsif ($config{USE_OPENSSL} eq "y") {
- system("cd src/modules");
- system("ln -s extra/m_ssl_openssl.cpp");
- system("cd ../..");
+ $failed = 0;
+ open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
+ close(TMP);
+ if ($failed) {
+ print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
+ chdir("src/modules");
+ system("ln -s extra/m_ssl_openssl.cpp");
+ chdir("../..");
+ }
getmodules();
$failed = 0;
open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;