From: aquanight Date: Sat, 2 Feb 2008 18:02:47 +0000 (+0000) Subject: Fix $config{HAS_OPENSSL} winding up undefined and crashing configure if openssl isn... X-Git-Tag: v2.0.23~3968 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=0808eb7a9dd3b339f5b37f0ee67c5253ccbc2956;p=user%2Fhenk%2Fcode%2Finspircd.git Fix $config{HAS_OPENSSL} winding up undefined and crashing configure if openssl isn't found or otherwise spits garbage for version. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8789 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/configure b/configure index 09efb51f3..1b28e30a1 100755 --- a/configure +++ b/configure @@ -380,8 +380,11 @@ if (defined $opt_away) $config{MAX_AWAY} = $opt_away; } -$config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/; -$config{HAS_OPENSSL} = $1; +if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/) { + $config{HAS_OPENSSL} = $1; +} else { + $config{HAS_OPENSSL} = ""; +} if ($config{GCCVER} eq "") { print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n"; @@ -643,7 +646,7 @@ $config{HAS_EPOLL} = $has_epoll; $config{HAS_KQUEUE} = $has_kqueue; printf "Checking for libgnutls... "; -if (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y")) { +if (defined($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y"))) { print "yes\n"; $config{HAS_GNUTLS} = "y"; } else { @@ -652,7 +655,7 @@ if (($config{HAS_GNUTLS}) || ($config{HAS_GNUTLS} eq "y")) { } printf "Checking for openssl... "; -if (($config{HAS_OPENSSL}) || ($config{HAS_OPENSSL} eq "y")) { +if (defined($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL}) || ($config{HAS_OPENSSL} eq "y"))) { print "yes\n"; $config{HAS_OPENSSL} = "y"; } else {