Fix the no-comp option for Windows
authorMatt Caswell <matt@openssl.org>
Thu, 17 Mar 2016 12:55:02 +0000 (12:55 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 18 Mar 2016 12:13:11 +0000 (12:13 +0000)
no-comp on Windows was not actually suppressing compilation of the code,
although it was suppressing its use.

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/comp/comp.h
util/libeay.num
util/mk1mf.pl

index 406c428aaeed7ee6e993e7607d9f22b8ef1ca4df..60a073404e922f8b7448d115fdb5489feaae500f 100644 (file)
@@ -4,6 +4,10 @@
 
 # include <openssl/crypto.h>
 
+# ifdef OPENSSL_NO_COMP
+#  error COMP is disabled.
+# endif
+
 #ifdef  __cplusplus
 extern "C" {
 #endif
index e5b3c6ea841c85aae5a91cb54f5222d6c5bf8a05..2094ab364c8e17053ff26c996e098b8b6ef7e3d6 100755 (executable)
@@ -1065,8 +1065,8 @@ d2i_ASN1_BMPSTRING                      1092      EXIST::FUNCTION:
 i2d_ASN1_BMPSTRING                      1093   EXIST::FUNCTION:
 BIO_f_ber                               1094   NOEXIST::FUNCTION:
 BN_init                                 1095   EXIST::FUNCTION:
-COMP_CTX_new                            1096   EXIST::FUNCTION:
-COMP_CTX_free                           1097   EXIST::FUNCTION:
+COMP_CTX_new                            1096   EXIST::FUNCTION:COMP
+COMP_CTX_free                           1097   EXIST::FUNCTION:COMP
 COMP_CTX_compress_block                 1098   NOEXIST::FUNCTION:
 COMP_CTX_expand_block                   1099   NOEXIST::FUNCTION:
 X509_STORE_CTX_get_ex_new_index         1100   EXIST::FUNCTION:
@@ -1113,10 +1113,10 @@ PKCS7_digest_from_attributes            1140    EXIST::FUNCTION:
 PKCS7_get_attribute                     1141   EXIST::FUNCTION:
 PKCS7_get_issuer_and_serial             1142   EXIST::FUNCTION:
 PKCS7_get_signed_attribute              1143   EXIST::FUNCTION:
-COMP_compress_block                     1144   EXIST::FUNCTION:
-COMP_expand_block                       1145   EXIST::FUNCTION:
-COMP_rle                                1146   EXIST::FUNCTION:
-COMP_zlib                               1147   EXIST::FUNCTION:
+COMP_compress_block                     1144   EXIST::FUNCTION:COMP
+COMP_expand_block                       1145   EXIST::FUNCTION:COMP
+COMP_rle                                1146   EXIST::FUNCTION:COMP
+COMP_zlib                               1147   EXIST::FUNCTION:COMP
 ms_time_diff                            1148   NOEXIST::FUNCTION:
 ms_time_new                             1149   NOEXIST::FUNCTION:
 ms_time_free                            1150   NOEXIST::FUNCTION:
@@ -1945,7 +1945,7 @@ ENGINE_get_ctrl_function                2521      EXIST::FUNCTION:ENGINE
 ENGINE_set_ctrl_function                2522   EXIST::FUNCTION:ENGINE
 BN_pseudo_rand_range                    2523   EXIST::FUNCTION:
 X509_STORE_CTX_set_verify_cb            2524   EXIST::FUNCTION:
-ERR_load_COMP_strings                   2525   EXIST::FUNCTION:
+ERR_load_COMP_strings                   2525   EXIST::FUNCTION:COMP
 PKCS12_item_decrypt_d2i                 2526   EXIST::FUNCTION:
 ASN1_UTF8STRING_it                      2527   EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:
 ASN1_UTF8STRING_it                      2527   EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:
@@ -3545,8 +3545,8 @@ X509at_get0_data_by_OBJ                 3931      EXIST::FUNCTION:
 ASN1_TYPE_set1                          3932   EXIST::FUNCTION:
 ASN1_STRING_set0                        3933   EXIST::FUNCTION:
 i2d_X509_ALGORS                         3934   EXIST::FUNCTION:
-BIO_f_zlib                              3935   EXIST:ZLIB:FUNCTION:
-COMP_zlib_cleanup                       3936   EXIST::FUNCTION:
+BIO_f_zlib                              3935   EXIST:ZLIB:FUNCTION:COMP
+COMP_zlib_cleanup                       3936   EXIST::FUNCTION:COMP
 d2i_X509_ALGORS                         3937   EXIST::FUNCTION:
 CMS_ReceiptRequest_free                 3938   EXIST::FUNCTION:CMS
 PEM_write_CMS                           3939   EXIST:!WIN16:FUNCTION:CMS
index 9029c5135737e62c1cd940caf7602f5e45a82483..128a405efc353abc0aac887caf149b1fd6093fac 100755 (executable)
@@ -291,8 +291,9 @@ $cflags.=" -DOPENSSL_FIPS"    if $fips;
 $cflags.=" -DOPENSSL_NO_JPAKE"    if $no_jpake;
 $cflags.=" -DOPENSSL_NO_EC2M"    if $no_ec2m;
 $cflags.=" -DOPENSSL_NO_WEAK_SSL_CIPHERS"   if $no_weak_ssl;
-$cflags.= " -DZLIB" if $zlib_opt;
-$cflags.= " -DZLIB_SHARED" if $zlib_opt == 2;
+$cflags.=" -DZLIB" if $zlib_opt;
+$cflags.=" -DZLIB_SHARED" if $zlib_opt == 2;
+$cflags.=" -DOPENSSL_NO_COMP" if $no_comp;
 
 if ($no_static_engine)
        {
@@ -850,6 +851,7 @@ sub var_add
        return("") if $no_gost   && $dir =~ /\/ccgost/;
        return("") if $no_cms  && $dir =~ /\/cms/;
        return("") if $no_jpake  && $dir =~ /\/jpake/;
+       return("") if $no_comp && $dir =~ /\/comp/;
        if ($no_des && $dir =~ /\/des/)
                {
                if ($val =~ /read_pwd/)
@@ -1243,6 +1245,7 @@ sub read_options
                "no-unit-test" => 0,
                "no-libunbound" => 0,
                "no-multiblock" => 0,
+               "no-comp" => \$no_comp,
                "fips" => \$fips
                );
 
@@ -1260,7 +1263,6 @@ sub read_options
                                }
                        }
                }
-       elsif (/^no-comp$/) { $xcflags = "-DOPENSSL_NO_COMP $xcflags"; }
        elsif (/^enable-zlib$/) { $zlib_opt = 1 if $zlib_opt == 0 }
        elsif (/^enable-zlib-dynamic$/)
                {