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