From: [EMAIL PROTECTED] (Bodo Moeller)

bmoeller> This inconsistency exists for historical reasons (as usual).
bmoeller> The SSLeay installation directory layout is similar to what you now
bmoeller> get when using --openssldir=/usr/local/ssl.  If someone wants
bmoeller> binaries, libraries, and header files to be installed to 'standard'
bmoeller> locations (such as /usr/local/bin, /usr/local/lib, and
bmoeller> /usr/local/include, respectively), they probably don't want the
bmoeller> SSLeay/OpenSSL specific stuff to reside directly under /usr/local;
bmoeller> this is why --prefix=/whatever sets openssldir to /whatever/ssl.

OK, that makes sense.

bmoeller> If we are going to change this, then we should always use
bmoeller> openssldir = prefix + "/ssl" (or prefix + "/openssldir")
bmoeller> because the openssldir = prefix variant doesn't make sense
bmoeller> if the directory is not exclusive to OpenSSL.

Hmm, what we could do is only have a unidirectional dependency as in:

        prefix defaults to "/usr/local"
        openssldir defaults to "/usr/local/ssl"
        if prefix is given, openssldir becomes prefix + "/ssl"
        if openssldir is given, that's the value it gets.

The combinations would then be:

        neither --prefix nor --openssldir given =>
                $prefix = "/usr/local", $openssldir = "/usr/local/ssl"
        only --prefix=/foo given =>
                $prefix = "/foo", $openssldir = "/foo/ssl"
        only --openssldir=/foo given =>
                $prefix = "/usr/local", $openssldir = "/foo"
        both --prefix=/foo and --openssldir=/foo given =>
                $prefix = "/foo", $openssldir = "/foo"

Note that the last combination is perfectly reasonable if you want to
have OpenSSL in a structure resembling the usual /opt stuff in Unixen
like Solaris (and other SysV systems, I assume).

The logic to get this right becomes also very simple.  Instead of the
current:

  $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
  $prefix=$openssldir if $prefix eq "";

  chop $openssldir if $openssldir =~ /\/$/;
  chop $prefix if $prefix =~ /\/$/;

  $openssldir=$prefix . "/ssl" if $openssldir eq "";
  $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//;

we would get:

  $prefix="/usr/local" if ($prefix eq "");
  chop $prefix if $prefix =~ /\/$/;
  $openssldir=prefix."/ssl" if ($openssldir eq "");

Voil�!  That's even understandable...

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \      SWEDEN       \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to