2
0

Mingw32.pl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 -mcpu=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. $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
  42. }
  43. $obj='.o';
  44. $ofile='-o ';
  45. # EXE linking stuff
  46. $link='${CC}';
  47. $lflags='${CFLAGS}';
  48. $efile='-o ';
  49. $exep='';
  50. $ex_libs="-lws2_32 -lgdi32";
  51. # static library stuff
  52. $mklib='ar r';
  53. $mlflags='';
  54. $ranlib='ranlib';
  55. $plib='lib';
  56. $libp=".a";
  57. $shlibp=".a";
  58. $lfile='';
  59. $asm='as';
  60. $afile='-o ';
  61. #$bn_asm_obj="";
  62. #$bn_asm_src="";
  63. #$des_enc_obj="";
  64. #$des_enc_src="";
  65. #$bf_enc_obj="";
  66. #$bf_enc_src="";
  67. sub do_lib_rule
  68. {
  69. local($obj,$target,$name,$shlib)=@_;
  70. local($ret,$_,$Name);
  71. $target =~ s/\//$o/g if $o ne '/';
  72. $target="$target";
  73. ($Name=$name) =~ tr/a-z/A-Z/;
  74. $ret.="$target: \$(${Name}OBJ)\n";
  75. $ret.="\tif exist $target \$(RM) $target\n";
  76. $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
  77. $ret.="\t\$(RANLIB) $target\n\n";
  78. }
  79. sub do_link_rule
  80. {
  81. local($target,$files,$dep_libs,$libs)=@_;
  82. local($ret,$_);
  83. $file =~ s/\//$o/g if $o ne '/';
  84. $n=&bname($target);
  85. $ret.="$target: $files $dep_libs\n";
  86. $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
  87. return($ret);
  88. }
  89. 1;