Recognize zlib and krb5 options in mk1mf.pl
authorDr. Stephen Henson <steve@openssl.org>
Sun, 24 Apr 2005 02:14:25 +0000 (02:14 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 24 Apr 2005 02:14:25 +0000 (02:14 +0000)
util/mk1mf.pl

index 19206352d10afc02539d9463f060238bc80c8b0c..20691546a54859d76691e30ee0ee754dcc18856e 100755 (executable)
@@ -43,6 +43,7 @@ $infile="MINFO";
        );
 
 $platform="";
+my $xcflags="";
 foreach (@ARGV)
        {
        if (!&read_options && !defined($ops{$_}))
@@ -210,6 +211,8 @@ $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def;
 
 $bin_dir=$bin_dir.$o unless ((substr($bin_dir,-1,1) eq $o) || ($bin_dir eq ''));
 
+$cflags= "$xcflags$cflags" if $xcflags ne "";
+
 $cflags.=" -DOPENSSL_NO_IDEA" if $no_idea;
 $cflags.=" -DOPENSSL_NO_AES"  if $no_aes;
 $cflags.=" -DOPENSSL_NO_RC2"  if $no_rc2;
@@ -941,8 +944,24 @@ sub read_options
        elsif (/^shlib$/)       { $shlib=1; }
        elsif (/^dll$/)         { $shlib=1; }
        elsif (/^shared$/)      { } # We just need to ignore it for now...
-       elsif (/^zlib$/)        { } # Ignore
-       elsif (/^zlib-dynamic$/){ } # Ignore
+       elsif (/^zlib$/)        { $xcflags = "-DZLIB $xcflags"; }
+       elsif (/^zlib-dynamic$/){ $xcflags = "-DZLIB_SHARED -DZLIB $xcflags"; }
+       elsif (/^--with-krb5-flavor=(.*)$/)
+               {
+               my $krb5_flavor = $1;
+               if ($krb5_flavor =~ /^force-[Hh]eimdal$/)
+                       {
+                       $xcflags="-DKRB5_HEIMDAL $xcflags";
+                       }
+               elsif ($krb5_flavor =~ /^MIT/i)
+                       {
+                       $xcflags="-DKRB5_MIT $xcflags";
+                       if ($krb5_flavor =~ /^MIT[._-]*1[._-]*[01]/i)
+                               {
+                               $xcflags="-DKRB5_MIT_OLD11 $xcflags"
+                               }
+                       }
+               }
        elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; }
        elsif (/^-[lL].*$/)     { $l_flags.="$_ "; }
        elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)