-sub module_installed($)
-{
- my $module = shift;
- eval("use $module;");
- return !$@;
-}
-
-sub promptstring_s($$)
-{
- my ($prompt,$default) = @_;
- my $var;
- print "$prompt\n";
- print "[\e[1;32m$default\e[0m] -> ";
- chomp($var = <STDIN>);
- $var = $default if $var eq "";
- print "\n";
- return $var;
-}
-
-sub dumphash()
-{
- print "\n\e[1;32mPre-build configuration is complete!\e[0m\n\n";
- print "\e[0mBase install path:\e[1;32m\t\t$main::config{BASE_DIR}\e[0m\n";
- print "\e[0mConfig path:\e[1;32m\t\t\t$main::config{CONFIG_DIR}\e[0m\n";
- print "\e[0mData path:\e[1;32m\t\t\t$main::config{DATA_DIR}\e[0m\n";
- print "\e[0mLog path:\e[1;32m\t\t\t$main::config{LOG_DIR}\e[0m\n";
- print "\e[0mModule path:\e[1;32m\t\t\t$main::config{MODULE_DIR}\e[0m\n";
- print "\e[0mCompiler:\e[1;32m\t\t\t$main::cxx{NAME} $main::cxx{VERSION}\e[0m\n";
- print "\e[0mSocket engine:\e[1;32m\t\t\t$main::config{SOCKETENGINE}\e[0m\n";
- print "\e[0mGnuTLS support:\e[1;32m\t\t\t$main::config{USE_GNUTLS}\e[0m\n";
- print "\e[0mOpenSSL support:\e[1;32m\t\t$main::config{USE_OPENSSL}\e[0m\n";
-}
-
-sub showhelp
-{
- chomp(my $PWD = `pwd`);
- my (@socketengines, $SELIST);
- foreach (<src/socketengines/socketengine_*.cpp>) {
- s/src\/socketengines\/socketengine_(\w+)\.cpp/$1/;
- push(@socketengines, $1);
- }
- $SELIST = join(", ", @socketengines);
- print <<EOH;
-Usage: configure [options]
-
-When no options are specified, interactive
-configuration is started and you must specify
-any required values manually. If one or more
-options are specified, non-interactive configuration
-is started, and any omitted values are defaulted.
-
-Arguments with a single \"-\" symbol are also allowed.
-
- --disable-interactive Sets no options itself, but
- will disable any interactive prompting.
- --update Update makefiles and dependencies
- --clean Remove .config.cache file and go interactive
- --enable-gnutls Enable GnuTLS module [no]
- --enable-openssl Enable OpenSSL module [no]
- --socketengine=[name] Sets the socket engine to be used. Possible values are
- $SELIST.
- --prefix=[directory] Base directory to install into (if defined,
- can automatically define config, data, module,
- log and binary dirs as subdirectories of prefix)
- [$PWD]
- --config-dir=[directory] Config file directory for config and SSL certs
- [$PWD/conf]
- --log-dir=[directory] Log file directory for logs
- [$PWD/logs]
- --data-dir=[directory] Data directory for variable data, such as the permchannel
- configuration and the XLine database
- [$PWD/data]
- --module-dir=[directory] Modules directory for loadable modules
- [$PWD/modules]
- --binary-dir=[directory] Binaries directory for core binary
- [$PWD/bin]
- --list-extras Show current status of extra modules
- --enable-extras=[extras] Enable the specified list of extras
- --disable-extras=[extras] Disable the specified list of extras
- --help Show this help text and exit
-
-EOH
- exit(0);
-}
-