a1fb60
diff -up openssl-1.0.2a/Configure.enginesdir openssl-1.0.2a/Configure
a1fb60
--- openssl-1.0.2a/Configure.enginesdir	2015-04-20 14:37:58.137392222 +0200
a1fb60
+++ openssl-1.0.2a/Configure	2015-04-20 14:37:58.140392292 +0200
a1fb60
@@ -702,6 +702,7 @@ my $idx_multilib = $idx++;
2ccfa6
 my $prefix="";
aabbc9
 my $libdir="";
2ccfa6
 my $openssldir="";
2ccfa6
+my $enginesdir="";
2ccfa6
 my $exe_ext="";
aabbc9
 my $install_prefix= "$ENV{'INSTALL_PREFIX'}";
2ccfa6
 my $cross_compile_prefix="";
a1fb60
@@ -929,6 +930,10 @@ PROCESS_ARGS:
2ccfa6
 				{
2ccfa6
 				$openssldir=$1;
2ccfa6
 				}
2ccfa6
+			elsif (/^--enginesdir=(.*)$/)
2ccfa6
+				{
2ccfa6
+				$enginesdir=$1;
2ccfa6
+				}
2ccfa6
 			elsif (/^--install.prefix=(.*)$/)
2ccfa6
 				{
2ccfa6
 				$install_prefix=$1;
a1fb60
@@ -1185,7 +1190,7 @@ chop $prefix if $prefix =~ /.\/$/;
2ccfa6
 
2ccfa6
 $openssldir=$prefix . "/ssl" if $openssldir eq "";
2ccfa6
 $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
2ccfa6
-
2ccfa6
+$enginesdir="$prefix/lib/engines" if $enginesdir eq "";
2ccfa6
 
2ccfa6
 print "IsMK1MF=$IsMK1MF\n";
2ccfa6
 
a1fb60
@@ -1871,7 +1876,7 @@ while (<in>)
ae5568
 		}
ae5568
 	elsif	(/^#define\s+ENGINESDIR/)
ae5568
 		{
ae5568
-		my $foo = "$prefix/$libdir/engines";
2ccfa6
+		my $foo = "$enginesdir";
2ccfa6
 		$foo =~ s/\\/\\\\/g;
2ccfa6
 		print OUT "#define ENGINESDIR \"$foo\"\n";
2ccfa6
 		}
a1fb60
diff -up openssl-1.0.2a/engines/Makefile.enginesdir openssl-1.0.2a/engines/Makefile
a1fb60
--- openssl-1.0.2a/engines/Makefile.enginesdir	2015-04-20 14:37:58.140392292 +0200
a1fb60
+++ openssl-1.0.2a/engines/Makefile	2015-04-20 14:40:15.570598383 +0200
aabbc9
@@ -124,7 +124,7 @@ install:
a1fb60
 				esac; \
a1fb60
 				cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
2ccfa6
 			  fi; \
aabbc9
-			  chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
aabbc9
+			  chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
aabbc9
 			  mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
2ccfa6
 		done; \
2ccfa6
 	fi