Add the possibility to build without the ENGINE framework.
[openssl.git] / util / mk1mf.pl
index 8c6370bc5dcbb470550d520b834148a027a7d3bc..5f3ab059f0cccd058a89e9036a740c046d813ba8 100755 (executable)
@@ -65,6 +65,8 @@ and [options] can be one of
        no-krb5                                 - No KRB5
        no-ec                                   - No EC
        no-ecdsa                                - No ECDSA
+       no-ecdh                                 - No ECDH
+       no-engine                               - No engine
        nasm                                    - Use NASM for x86 asm
        gaswin                                  - Use GNU as with Mingw32
        no-socks                                - No socket code
@@ -234,6 +236,8 @@ $cflags.=" -DOPENSSL_NO_ERR"  if $no_err;
 $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5;
 $cflags.=" -DOPENSSL_NO_EC"   if $no_ec;
 $cflags.=" -DOPENSSL_NO_ECDSA" if $no_ecdsa;
+$cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh;
+$cflags.=" -DOPENSSL_NO_ENGINE"   if $no_engine;
 #$cflags.=" -DRSAref"  if $rsaref ne "";
 
 ## if ($unix)
@@ -663,6 +667,7 @@ sub var_add
        local($dir,$val)=@_;
        local(@a,$_,$ret);
 
+       return("") if $no_engine && $dir =~ /\/engine/;
        return("") if $no_idea && $dir =~ /\/idea/;
        return("") if $no_aes  && $dir =~ /\/aes/;
        return("") if $no_rc2  && $dir =~ /\/rc2/;
@@ -723,6 +728,7 @@ sub var_add
        @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
        @a=grep(!/_mdc2$/,@a) if $no_mdc2;
 
+       @a=grep(!/^engine$/,@a) if $no_engine;
        @a=grep(!/(^rsa$)|(^genrsa$)/,@a) if $no_rsa;
        @a=grep(!/(^dsa$)|(^gendsa$)|(^dsaparam$)/,@a) if $no_dsa;
        @a=grep(!/^gendsa$/,@a) if $no_sha1;
@@ -925,6 +931,8 @@ sub read_options
        elsif (/^no-krb5$/)     { $no_krb5=1; }
        elsif (/^no-ec$/)       { $no_ec=1; }
        elsif (/^no-ecdsa$/)    { $no_ecdsa=1; }
+       elsif (/^no-ecdh$/)     { $no_ecdh=1; }
+       elsif (/^no-engine$/)   { $no_engine=1; }
 
        elsif (/^just-ssl$/)    { $no_rc2=$no_idea=$no_des=$no_bf=$no_cast=1;
                                  $no_md2=$no_sha=$no_mdc2=$no_dsa=$no_dh=1;