Mingw32.pl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/usr/local/bin/perl
  2. #
  3. # Mingw32.pl -- Mingw
  4. #
  5. $o='/';
  6. $cp='cp';
  7. $rm='rm -f';
  8. $mkdir='gmkdir';
  9. $o='\\';
  10. $cp='copy';
  11. $rm='del';
  12. $mkdir='mkdir';
  13. # C compiler stuff
  14. $cc='gcc';
  15. if ($debug)
  16. { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
  17. else
  18. { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -march=i486 -Wall"; }
  19. if ($gaswin and !$no_asm)
  20. {
  21. $bn_asm_obj='$(OBJ_D)\bn-win32.o';
  22. $bn_asm_src='crypto/bn/asm/bn-win32.s';
  23. $bnco_asm_obj='$(OBJ_D)\co-win32.o';
  24. $bnco_asm_src='crypto/bn/asm/co-win32.s';
  25. $des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o';
  26. $des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
  27. $bf_enc_obj='$(OBJ_D)\b-win32.o';
  28. $bf_enc_src='crypto/bf/asm/b-win32.s';
  29. # $cast_enc_obj='$(OBJ_D)\c-win32.o';
  30. # $cast_enc_src='crypto/cast/asm/c-win32.s';
  31. $rc4_enc_obj='$(OBJ_D)\r4-win32.o';
  32. $rc4_enc_src='crypto/rc4/asm/r4-win32.s';
  33. $rc5_enc_obj='$(OBJ_D)\r5-win32.o';
  34. $rc5_enc_src='crypto/rc5/asm/r5-win32.s';
  35. $md5_asm_obj='$(OBJ_D)\m5-win32.o';
  36. $md5_asm_src='crypto/md5/asm/m5-win32.s';
  37. $rmd160_asm_obj='$(OBJ_D)\rm-win32.o';
  38. $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
  39. $sha1_asm_obj='$(OBJ_D)\s1-win32.o';
  40. $sha1_asm_src='crypto/sha/asm/s1-win32.s';
  41. $cpuid_asm_obj='$(OBJ_D)\cpu-win32.o';
  42. $cpuid_asm_src='crypto/cpu-win32.s';
  43. $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
  44. }
  45. $obj='.o';
  46. $ofile='-o ';
  47. # EXE linking stuff
  48. $link='${CC}';
  49. $lflags='${CFLAGS}';
  50. $efile='-o ';
  51. $exep='';
  52. $ex_libs="-lwsock32 -lgdi32";
  53. # static library stuff
  54. $mklib='ar r';
  55. $mlflags='';
  56. $ranlib='ranlib';
  57. $plib='lib';
  58. $libp=".a";
  59. $shlibp=".a";
  60. $lfile='';
  61. $asm='as';
  62. $afile='-o ';
  63. #$bn_asm_obj="";
  64. #$bn_asm_src="";
  65. #$des_enc_obj="";
  66. #$des_enc_src="";
  67. #$bf_enc_obj="";
  68. #$bf_enc_src="";
  69. sub do_lib_rule
  70. {
  71. local($obj,$target,$name,$shlib)=@_;
  72. local($ret,$_,$Name);
  73. $target =~ s/\//$o/g if $o ne '/';
  74. $target="$target";
  75. ($Name=$name) =~ tr/a-z/A-Z/;
  76. $ret.="$target: \$(${Name}OBJ)\n";
  77. $ret.="\tif exist $target \$(RM) $target\n";
  78. $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
  79. $ret.="\t\$(RANLIB) $target\n\n";
  80. }
  81. sub do_link_rule
  82. {
  83. local($target,$files,$dep_libs,$libs)=@_;
  84. local($ret,$_);
  85. $file =~ s/\//$o/g if $o ne '/';
  86. $n=&bname($target);
  87. $ret.="$target: $files $dep_libs\n";
  88. $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
  89. return($ret);
  90. }
  91. 1;