diff options
Diffstat (limited to 'src/lib/libcrypto/util/pl')
| -rw-r--r-- | src/lib/libcrypto/util/pl/BC-32.pl | 139 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/pl/Mingw32.pl | 104 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/pl/OS2-EMX.pl | 120 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/pl/VC-32.pl | 400 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/pl/linux.pl | 104 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/pl/ultrix.pl | 38 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/pl/unix.pl (renamed from src/lib/libcrypto/util/pl/Mingw32f.pl) | 47 |
7 files changed, 940 insertions, 12 deletions
diff --git a/src/lib/libcrypto/util/pl/BC-32.pl b/src/lib/libcrypto/util/pl/BC-32.pl new file mode 100644 index 0000000000..b41bb45e82 --- /dev/null +++ b/src/lib/libcrypto/util/pl/BC-32.pl | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # Borland C++ builder 3 and 4 -- Janez Jere <jj@void.si> | ||
| 3 | # | ||
| 4 | |||
| 5 | $ssl= "ssleay32"; | ||
| 6 | $crypto="libeay32"; | ||
| 7 | |||
| 8 | $o='\\'; | ||
| 9 | $cp='copy'; | ||
| 10 | $rm='del'; | ||
| 11 | |||
| 12 | # C compiler stuff | ||
| 13 | $cc='bcc32'; | ||
| 14 | $lflags="-ap -Tpe -x -Gn "; | ||
| 15 | $mlflags=''; | ||
| 16 | |||
| 17 | $out_def="out32"; | ||
| 18 | $tmp_def="tmp32"; | ||
| 19 | $inc_def="inc32"; | ||
| 20 | #enable max error messages, disable most common warnings | ||
| 21 | $cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp -D_timeb=timeb -D_ftime=ftime "; | ||
| 22 | if ($debug) | ||
| 23 | { | ||
| 24 | $cflags.="-Od -y -v -vi- -D_DEBUG"; | ||
| 25 | $mlflags.=' '; | ||
| 26 | } | ||
| 27 | else | ||
| 28 | { | ||
| 29 | $cflags.="-O2 -ff -fp"; | ||
| 30 | } | ||
| 31 | |||
| 32 | $obj='.obj'; | ||
| 33 | $ofile="-o"; | ||
| 34 | |||
| 35 | # EXE linking stuff | ||
| 36 | $link="ilink32"; | ||
| 37 | $efile=""; | ||
| 38 | $exep='.exe'; | ||
| 39 | if ($no_sock) | ||
| 40 | { $ex_libs=""; } | ||
| 41 | else { $ex_libs="cw32mt.lib import32.lib crypt32.lib ws2_32.lib"; } | ||
| 42 | |||
| 43 | # static library stuff | ||
| 44 | $mklib='tlib /P64'; | ||
| 45 | $ranlib=''; | ||
| 46 | $plib=""; | ||
| 47 | $libp=".lib"; | ||
| 48 | $shlibp=($shlib)?".dll":".lib"; | ||
| 49 | $lfile=''; | ||
| 50 | |||
| 51 | $shlib_ex_obj=""; | ||
| 52 | $app_ex_obj="c0x32.obj"; | ||
| 53 | |||
| 54 | $asm=(`nasm -v 2>NUL` ge `nasmw -v 2>NUL`?"nasm":"nasmw")." -f obj -d__omf__"; | ||
| 55 | $asm.=" -g" if $debug; | ||
| 56 | $afile='-o'; | ||
| 57 | |||
| 58 | $bn_mulw_obj=''; | ||
| 59 | $bn_mulw_src=''; | ||
| 60 | $des_enc_obj=''; | ||
| 61 | $des_enc_src=''; | ||
| 62 | $bf_enc_obj=''; | ||
| 63 | $bf_enc_src=''; | ||
| 64 | |||
| 65 | if (!$no_asm) | ||
| 66 | { | ||
| 67 | $bn_mulw_obj='crypto\bn\asm\bn_win32.obj'; | ||
| 68 | $bn_mulw_src='crypto\bn\asm\bn_win32.asm'; | ||
| 69 | $des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj'; | ||
| 70 | $des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm'; | ||
| 71 | $bf_enc_obj='crypto\bf\asm\b_win32.obj'; | ||
| 72 | $bf_enc_src='crypto\bf\asm\b_win32.asm'; | ||
| 73 | $cast_enc_obj='crypto\cast\asm\c_win32.obj'; | ||
| 74 | $cast_enc_src='crypto\cast\asm\c_win32.asm'; | ||
| 75 | $rc4_enc_obj='crypto\rc4\asm\r4_win32.obj'; | ||
| 76 | $rc4_enc_src='crypto\rc4\asm\r4_win32.asm'; | ||
| 77 | $rc5_enc_obj='crypto\rc5\asm\r5_win32.obj'; | ||
| 78 | $rc5_enc_src='crypto\rc5\asm\r5_win32.asm'; | ||
| 79 | $md5_asm_obj='crypto\md5\asm\m5_win32.obj'; | ||
| 80 | $md5_asm_src='crypto\md5\asm\m5_win32.asm'; | ||
| 81 | $sha1_asm_obj='crypto\sha\asm\s1_win32.obj'; | ||
| 82 | $sha1_asm_src='crypto\sha\asm\s1_win32.asm'; | ||
| 83 | $rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj'; | ||
| 84 | $rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm'; | ||
| 85 | $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; | ||
| 86 | } | ||
| 87 | |||
| 88 | if ($shlib) | ||
| 89 | { | ||
| 90 | $mlflags.=" $lflags /dll"; | ||
| 91 | # $cflags =~ s| /MD| /MT|; | ||
| 92 | $lib_cflag=" /GD -D_WINDLL -D_DLL"; | ||
| 93 | $out_def="out32dll"; | ||
| 94 | $tmp_def="tmp32dll"; | ||
| 95 | } | ||
| 96 | |||
| 97 | sub do_lib_rule | ||
| 98 | { | ||
| 99 | local($objs,$target,$name,$shlib)=@_; | ||
| 100 | local($ret,$Name); | ||
| 101 | |||
| 102 | $taget =~ s/\//$o/g if $o ne '/'; | ||
| 103 | ($Name=$name) =~ tr/a-z/A-Z/; | ||
| 104 | |||
| 105 | # $target="\$(LIB_D)$o$target"; | ||
| 106 | $ret.="$target: $objs\n"; | ||
| 107 | if (!$shlib) | ||
| 108 | { | ||
| 109 | $ret.=<<___; | ||
| 110 | -\$(RM) $lfile$target | ||
| 111 | \$(MKLIB) $lfile$target \@&&! | ||
| 112 | +\$(**: = &^ | ||
| 113 | +) | ||
| 114 | ! | ||
| 115 | ___ | ||
| 116 | } | ||
| 117 | else | ||
| 118 | { | ||
| 119 | local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; | ||
| 120 | $ex.=' ws2_32.lib gdi32.lib'; | ||
| 121 | $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n"; | ||
| 122 | } | ||
| 123 | $ret.="\n"; | ||
| 124 | return($ret); | ||
| 125 | } | ||
| 126 | |||
| 127 | sub do_link_rule | ||
| 128 | { | ||
| 129 | local($target,$files,$dep_libs,$libs)=@_; | ||
| 130 | local($ret,$_); | ||
| 131 | |||
| 132 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 133 | $n=&bname($targer); | ||
| 134 | $ret.="$target: $files $dep_libs\n"; | ||
| 135 | $ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n"; | ||
| 136 | return($ret); | ||
| 137 | } | ||
| 138 | |||
| 139 | 1; | ||
diff --git a/src/lib/libcrypto/util/pl/Mingw32.pl b/src/lib/libcrypto/util/pl/Mingw32.pl new file mode 100644 index 0000000000..fe3fb27a78 --- /dev/null +++ b/src/lib/libcrypto/util/pl/Mingw32.pl | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # | ||
| 3 | # Mingw32.pl -- Mingw | ||
| 4 | # | ||
| 5 | |||
| 6 | $o='/'; | ||
| 7 | $cp='cp'; | ||
| 8 | $rm='rm -f'; | ||
| 9 | $mkdir='gmkdir'; | ||
| 10 | |||
| 11 | $o='\\'; | ||
| 12 | $cp='copy'; | ||
| 13 | $rm='del'; | ||
| 14 | $mkdir='mkdir'; | ||
| 15 | |||
| 16 | # C compiler stuff | ||
| 17 | |||
| 18 | $cc='gcc'; | ||
| 19 | if ($debug) | ||
| 20 | { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; } | ||
| 21 | else | ||
| 22 | { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; } | ||
| 23 | |||
| 24 | if ($gaswin and !$no_asm) | ||
| 25 | { | ||
| 26 | $bn_asm_obj='$(OBJ_D)\bn-win32.o'; | ||
| 27 | $bn_asm_src='crypto/bn/asm/bn-win32.s'; | ||
| 28 | $bnco_asm_obj='$(OBJ_D)\co-win32.o'; | ||
| 29 | $bnco_asm_src='crypto/bn/asm/co-win32.s'; | ||
| 30 | $des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o'; | ||
| 31 | $des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s'; | ||
| 32 | $bf_enc_obj='$(OBJ_D)\b-win32.o'; | ||
| 33 | $bf_enc_src='crypto/bf/asm/b-win32.s'; | ||
| 34 | # $cast_enc_obj='$(OBJ_D)\c-win32.o'; | ||
| 35 | # $cast_enc_src='crypto/cast/asm/c-win32.s'; | ||
| 36 | $rc4_enc_obj='$(OBJ_D)\r4-win32.o'; | ||
| 37 | $rc4_enc_src='crypto/rc4/asm/r4-win32.s'; | ||
| 38 | $rc5_enc_obj='$(OBJ_D)\r5-win32.o'; | ||
| 39 | $rc5_enc_src='crypto/rc5/asm/r5-win32.s'; | ||
| 40 | $md5_asm_obj='$(OBJ_D)\m5-win32.o'; | ||
| 41 | $md5_asm_src='crypto/md5/asm/m5-win32.s'; | ||
| 42 | $rmd160_asm_obj='$(OBJ_D)\rm-win32.o'; | ||
| 43 | $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s'; | ||
| 44 | $sha1_asm_obj='$(OBJ_D)\s1-win32.o'; | ||
| 45 | $sha1_asm_src='crypto/sha/asm/s1-win32.s'; | ||
| 46 | $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS"; | ||
| 47 | } | ||
| 48 | |||
| 49 | |||
| 50 | $obj='.o'; | ||
| 51 | $ofile='-o '; | ||
| 52 | |||
| 53 | # EXE linking stuff | ||
| 54 | $link='${CC}'; | ||
| 55 | $lflags='${CFLAGS}'; | ||
| 56 | $efile='-o '; | ||
| 57 | $exep=''; | ||
| 58 | $ex_libs="-lws2_32 -lgdi32"; | ||
| 59 | |||
| 60 | # static library stuff | ||
| 61 | $mklib='ar r'; | ||
| 62 | $mlflags=''; | ||
| 63 | $ranlib='ranlib'; | ||
| 64 | $plib='lib'; | ||
| 65 | $libp=".a"; | ||
| 66 | $shlibp=".a"; | ||
| 67 | $lfile=''; | ||
| 68 | |||
| 69 | $asm='as'; | ||
| 70 | $afile='-o '; | ||
| 71 | #$bn_asm_obj=""; | ||
| 72 | #$bn_asm_src=""; | ||
| 73 | #$des_enc_obj=""; | ||
| 74 | #$des_enc_src=""; | ||
| 75 | #$bf_enc_obj=""; | ||
| 76 | #$bf_enc_src=""; | ||
| 77 | |||
| 78 | sub do_lib_rule | ||
| 79 | { | ||
| 80 | local($obj,$target,$name,$shlib)=@_; | ||
| 81 | local($ret,$_,$Name); | ||
| 82 | |||
| 83 | $target =~ s/\//$o/g if $o ne '/'; | ||
| 84 | $target="$target"; | ||
| 85 | ($Name=$name) =~ tr/a-z/A-Z/; | ||
| 86 | |||
| 87 | $ret.="$target: \$(${Name}OBJ)\n"; | ||
| 88 | $ret.="\tif exist $target \$(RM) $target\n"; | ||
| 89 | $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n"; | ||
| 90 | $ret.="\t\$(RANLIB) $target\n\n"; | ||
| 91 | } | ||
| 92 | |||
| 93 | sub do_link_rule | ||
| 94 | { | ||
| 95 | local($target,$files,$dep_libs,$libs)=@_; | ||
| 96 | local($ret,$_); | ||
| 97 | |||
| 98 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 99 | $n=&bname($target); | ||
| 100 | $ret.="$target: $files $dep_libs\n"; | ||
| 101 | $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; | ||
| 102 | return($ret); | ||
| 103 | } | ||
| 104 | 1; | ||
diff --git a/src/lib/libcrypto/util/pl/OS2-EMX.pl b/src/lib/libcrypto/util/pl/OS2-EMX.pl new file mode 100644 index 0000000000..28cd116907 --- /dev/null +++ b/src/lib/libcrypto/util/pl/OS2-EMX.pl | |||
| @@ -0,0 +1,120 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # | ||
| 3 | # OS2-EMX.pl - for EMX GCC on OS/2 | ||
| 4 | # | ||
| 5 | |||
| 6 | $o='/'; | ||
| 7 | $cp='cp'; | ||
| 8 | $rm='rm -f'; | ||
| 9 | |||
| 10 | $preamble = "SHELL=sh\n"; | ||
| 11 | |||
| 12 | # C compiler stuff | ||
| 13 | |||
| 14 | $cc='gcc'; | ||
| 15 | $cflags="-DL_ENDIAN -O3 -fomit-frame-pointer -m486 -Zmtd -Wall "; | ||
| 16 | $cflags.="-Zomf " if $shlib; | ||
| 17 | $shl_cflag="-Zdll"; | ||
| 18 | |||
| 19 | if ($debug) { | ||
| 20 | $cflags.="-g "; | ||
| 21 | } | ||
| 22 | |||
| 23 | $obj=$shlib ? '.obj' : '.o'; | ||
| 24 | $ofile='-o '; | ||
| 25 | |||
| 26 | # EXE linking stuff | ||
| 27 | $link='${CC}'; | ||
| 28 | $lflags='${CFLAGS} -Zbsd-signals -s'; | ||
| 29 | $efile='-o '; | ||
| 30 | $exep='.exe'; | ||
| 31 | $ex_libs="-lsocket"; | ||
| 32 | |||
| 33 | # static library stuff | ||
| 34 | $mklib='ar r'; | ||
| 35 | $mlflags=''; | ||
| 36 | $ranlib="ar s"; | ||
| 37 | $plib=''; | ||
| 38 | $libp=$shlib ? ".lib" : ".a"; | ||
| 39 | $shlibp=$shlib ? ".dll" : ".a"; | ||
| 40 | $lfile=''; | ||
| 41 | |||
| 42 | $asm=$shlib ? 'as -Zomf' : 'as'; | ||
| 43 | $afile='-o '; | ||
| 44 | $bn_asm_obj=""; | ||
| 45 | $bn_asm_src=""; | ||
| 46 | $des_enc_obj=""; | ||
| 47 | $des_enc_src=""; | ||
| 48 | $bf_enc_obj=""; | ||
| 49 | $bf_enc_src=""; | ||
| 50 | |||
| 51 | if (!$no_asm) | ||
| 52 | { | ||
| 53 | $bn_asm_obj="crypto/bn/asm/bn-os2$obj crypto/bn/asm/co-os2$obj"; | ||
| 54 | $bn_asm_src="crypto/bn/asm/bn-os2.asm crypto/bn/asm/co-os2.asm"; | ||
| 55 | $des_enc_obj="crypto/des/asm/d-os2$obj crypto/des/asm/y-os2$obj"; | ||
| 56 | $des_enc_src="crypto/des/asm/d-os2.asm crypto/des/asm/y-os2.asm"; | ||
| 57 | $bf_enc_obj="crypto/bf/asm/b-os2$obj"; | ||
| 58 | $bf_enc_src="crypto/bf/asm/b-os2.asm"; | ||
| 59 | $cast_enc_obj="crypto/cast/asm/c-os2$obj"; | ||
| 60 | $cast_enc_src="crypto/cast/asm/c-os2.asm"; | ||
| 61 | $rc4_enc_obj="crypto/rc4/asm/r4-os2$obj"; | ||
| 62 | $rc4_enc_src="crypto/rc4/asm/r4-os2.asm"; | ||
| 63 | $rc5_enc_obj="crypto/rc5/asm/r5-os2$obj"; | ||
| 64 | $rc5_enc_src="crypto/rc5/asm/r5-os2.asm"; | ||
| 65 | $md5_asm_obj="crypto/md5/asm/m5-os2$obj"; | ||
| 66 | $md5_asm_src="crypto/md5/asm/m5-os2.asm"; | ||
| 67 | $sha1_asm_obj="crypto/sha/asm/s1-os2$obj"; | ||
| 68 | $sha1_asm_src="crypto/sha/asm/s1-os2.asm"; | ||
| 69 | $rmd160_asm_obj="crypto/ripemd/asm/rm-os2$obj"; | ||
| 70 | $rmd160_asm_src="crypto/ripemd/asm/rm-os2.asm"; | ||
| 71 | $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS"; | ||
| 72 | } | ||
| 73 | |||
| 74 | if ($shlib) | ||
| 75 | { | ||
| 76 | $mlflags.=" $lflags -Zdll"; | ||
| 77 | $lib_cflag=" -D_DLL"; | ||
| 78 | $out_def="out_dll"; | ||
| 79 | $tmp_def="tmp_dll"; | ||
| 80 | } | ||
| 81 | |||
| 82 | sub do_lib_rule | ||
| 83 | { | ||
| 84 | local($obj,$target,$name,$shlib)=@_; | ||
| 85 | local($ret,$_,$Name); | ||
| 86 | |||
| 87 | $target =~ s/\//$o/g if $o ne '/'; | ||
| 88 | $target="$target"; | ||
| 89 | ($Name=$name) =~ tr/a-z/A-Z/; | ||
| 90 | |||
| 91 | $ret.="$target: \$(${Name}OBJ)\n"; | ||
| 92 | if (!$shlib) | ||
| 93 | { | ||
| 94 | $ret.="\t\$(RM) $target\n"; | ||
| 95 | $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n"; | ||
| 96 | $ret.="\t\$(RANLIB) $target\n\n"; | ||
| 97 | } | ||
| 98 | else | ||
| 99 | { | ||
| 100 | local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; | ||
| 101 | $ex.=' -lsocket'; | ||
| 102 | $ret.="\t\$(LINK) \$(SHLIB_CFLAGS) \$(MLFLAGS) $efile$target \$(SHLIB_EX_OBJ) \$(${Name}OBJ) $ex os2/${Name}.def\n"; | ||
| 103 | $ret.="\temximp -o $out_def/$name.a os2/${Name}.def\n"; | ||
| 104 | $ret.="\temximp -o $out_def/$name.lib os2/${Name}.def\n\n"; | ||
| 105 | } | ||
| 106 | } | ||
| 107 | |||
| 108 | sub do_link_rule | ||
| 109 | { | ||
| 110 | local($target,$files,$dep_libs,$libs)=@_; | ||
| 111 | local($ret,$_); | ||
| 112 | |||
| 113 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 114 | $n=&bname($target); | ||
| 115 | $ret.="$target: $files $dep_libs\n"; | ||
| 116 | $ret.="\t\$(LINK) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n\n"; | ||
| 117 | return($ret); | ||
| 118 | } | ||
| 119 | |||
| 120 | 1; | ||
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl new file mode 100644 index 0000000000..3705fc73b7 --- /dev/null +++ b/src/lib/libcrypto/util/pl/VC-32.pl | |||
| @@ -0,0 +1,400 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # VC-32.pl - unified script for Microsoft Visual C++, covering Win32, | ||
| 3 | # Win64 and WinCE [follow $FLAVOR variable to trace the differences]. | ||
| 4 | # | ||
| 5 | |||
| 6 | $ssl= "ssleay32"; | ||
| 7 | $crypto="libeay32"; | ||
| 8 | |||
| 9 | if ($fips && !$shlib) | ||
| 10 | { | ||
| 11 | $crypto="libeayfips32"; | ||
| 12 | $crypto_compat = "libeaycompat32.lib"; | ||
| 13 | } | ||
| 14 | else | ||
| 15 | { | ||
| 16 | $crypto="libeay32"; | ||
| 17 | } | ||
| 18 | |||
| 19 | $o='\\'; | ||
| 20 | $cp='$(PERL) util/copy.pl'; | ||
| 21 | $mkdir='$(PERL) util/mkdir-p.pl'; | ||
| 22 | $rm='del /Q'; | ||
| 23 | |||
| 24 | $zlib_lib="zlib1.lib"; | ||
| 25 | |||
| 26 | # Santize -L options for ms link | ||
| 27 | $l_flags =~ s/-L("\[^"]+")/\/libpath:$1/g; | ||
| 28 | $l_flags =~ s/-L(\S+)/\/libpath:$1/g; | ||
| 29 | |||
| 30 | my $ff = ""; | ||
| 31 | |||
| 32 | # C compiler stuff | ||
| 33 | $cc='cl'; | ||
| 34 | if ($FLAVOR =~ /WIN64/) | ||
| 35 | { | ||
| 36 | # Note that we currently don't have /WX on Win64! There is a lot of | ||
| 37 | # warnings, but only of two types: | ||
| 38 | # | ||
| 39 | # C4344: conversion from '__int64' to 'int/long', possible loss of data | ||
| 40 | # C4267: conversion from 'size_t' to 'int/long', possible loss of data | ||
| 41 | # | ||
| 42 | # Amount of latter type is minimized by aliasing strlen to function of | ||
| 43 | # own desing and limiting its return value to 2GB-1 (see e_os.h). As | ||
| 44 | # per 0.9.8 release remaining warnings were explicitly examined and | ||
| 45 | # considered safe to ignore. | ||
| 46 | # | ||
| 47 | $base_cflags= " $mf_cflag"; | ||
| 48 | my $f = $shlib || $fips ?' /MD':' /MT'; | ||
| 49 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | ||
| 50 | $opt_cflags=$f.' /Ox'; | ||
| 51 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | ||
| 52 | $lflags="/nologo /subsystem:console /opt:ref"; | ||
| 53 | |||
| 54 | *::perlasm_compile_target = sub { | ||
| 55 | my ($target,$source,$bname)=@_; | ||
| 56 | my $ret; | ||
| 57 | |||
| 58 | $bname =~ s/(.*)\.[^\.]$/$1/; | ||
| 59 | $ret=<<___; | ||
| 60 | \$(TMP_D)$o$bname.asm: $source | ||
| 61 | set ASM=\$(ASM) | ||
| 62 | \$(PERL) $source \$\@ | ||
| 63 | |||
| 64 | $target: \$(TMP_D)$o$bname.asm | ||
| 65 | \$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm | ||
| 66 | |||
| 67 | ___ | ||
| 68 | } | ||
| 69 | } | ||
| 70 | elsif ($FLAVOR =~ /CE/) | ||
| 71 | { | ||
| 72 | # sanity check | ||
| 73 | die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'})); | ||
| 74 | die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'})); | ||
| 75 | die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'})); | ||
| 76 | |||
| 77 | # | ||
| 78 | # Idea behind this is to mimic flags set by eVC++ IDE... | ||
| 79 | # | ||
| 80 | $wcevers = $ENV{'OSVERSION'}; # WCENNN | ||
| 81 | die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/); | ||
| 82 | $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN | ||
| 83 | $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN | ||
| 84 | |||
| 85 | $wceplatf = $ENV{'PLATFORM'}; | ||
| 86 | $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d; | ||
| 87 | $wcecdefs .= " -DWCE_PLATFORM_$wceplatf"; | ||
| 88 | |||
| 89 | $wcetgt = $ENV{'TARGETCPU'}; # just shorter name... | ||
| 90 | SWITCH: for($wcetgt) { | ||
| 91 | /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_"; | ||
| 92 | $wcelflag.=" /machine:IX86"; last; }; | ||
| 93 | /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; | ||
| 94 | $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/); | ||
| 95 | $wcecdefs.=" -QRarch4T -QRinterwork-return"; | ||
| 96 | $wcelflag.=" /machine:THUMB"; last; }; | ||
| 97 | /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; | ||
| 98 | $wcelflag.=" /machine:ARM"; last; }; | ||
| 99 | /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | ||
| 100 | $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32"; | ||
| 101 | $wcelflag.=" /machine:MIPSFPU"; last; }; | ||
| 102 | /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | ||
| 103 | $wcecdefs.=" -DMIPSII -QMmips16"; | ||
| 104 | $wcelflag.=" /machine:MIPS16"; last; }; | ||
| 105 | /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | ||
| 106 | $wcecdefs.=" -QMmips2"; | ||
| 107 | $wcelflag.=" /machine:MIPS"; last; }; | ||
| 108 | /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000"; | ||
| 109 | $wcelflag.=" /machine:MIPS"; last; }; | ||
| 110 | /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_$wcetgt_ -DSHx"; | ||
| 111 | $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/); | ||
| 112 | $wcelflag.=" /machine:$wcetgt"; last; }; | ||
| 113 | { $wcecdefs.=" -D$wcetgt -D_$wcetgt_"; | ||
| 114 | $wcelflag.=" /machine:$wcetgt"; last; }; | ||
| 115 | } | ||
| 116 | |||
| 117 | $cc='$(CC)'; | ||
| 118 | $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT'; | ||
| 119 | $base_cflags.=" $wcecdefs"; | ||
| 120 | $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'})); | ||
| 121 | $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'})); | ||
| 122 | $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics... | ||
| 123 | $dbg_cflags=' /MC /Od -DDEBUG -D_DEBUG'; | ||
| 124 | $lflags="/nologo /opt:ref $wcelflag"; | ||
| 125 | } | ||
| 126 | else # Win32 | ||
| 127 | { | ||
| 128 | $base_cflags= " $mf_cflag"; | ||
| 129 | my $f = $shlib || $fips ?' /MD':' /MT'; | ||
| 130 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | ||
| 131 | $ff = "/fixed"; | ||
| 132 | $opt_cflags=$f.' /Ox /O2 /Ob2'; | ||
| 133 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | ||
| 134 | $lflags="/nologo /subsystem:console /opt:ref"; | ||
| 135 | } | ||
| 136 | $mlflags=''; | ||
| 137 | |||
| 138 | $out_def ="out32"; $out_def.="dll" if ($shlib); | ||
| 139 | $out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); | ||
| 140 | $tmp_def ="tmp32"; $tmp_def.="dll" if ($shlib); | ||
| 141 | $tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); | ||
| 142 | $inc_def="inc32"; | ||
| 143 | |||
| 144 | if ($debug) | ||
| 145 | { | ||
| 146 | $cflags=$dbg_cflags.$base_cflags; | ||
| 147 | } | ||
| 148 | else | ||
| 149 | { | ||
| 150 | $cflags=$opt_cflags.$base_cflags; | ||
| 151 | } | ||
| 152 | |||
| 153 | # generate symbols.pdb unconditionally | ||
| 154 | $app_cflag.=" /Zi /Fd\$(TMP_D)/app"; | ||
| 155 | $lib_cflag.=" /Zi /Fd\$(TMP_D)/lib"; | ||
| 156 | $lflags.=" /debug"; | ||
| 157 | |||
| 158 | $obj='.obj'; | ||
| 159 | $asm_suffix='.asm'; | ||
| 160 | $ofile="/Fo"; | ||
| 161 | |||
| 162 | # EXE linking stuff | ||
| 163 | $link="link"; | ||
| 164 | $rsc="rc"; | ||
| 165 | $efile="/out:"; | ||
| 166 | $exep='.exe'; | ||
| 167 | if ($no_sock) { $ex_libs=''; } | ||
| 168 | elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; } | ||
| 169 | else { $ex_libs='ws2_32.lib'; } | ||
| 170 | |||
| 171 | if ($FLAVOR =~ /CE/) | ||
| 172 | { | ||
| 173 | $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib' if (defined($ENV{'WCECOMPAT'})); | ||
| 174 | $ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'})); | ||
| 175 | $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86"); | ||
| 176 | } | ||
| 177 | else | ||
| 178 | { | ||
| 179 | $ex_libs.=' gdi32.lib advapi32.lib crypt32.lib user32.lib'; | ||
| 180 | $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/ and `cl 2>&1` =~ /14\.00\.4[0-9]{4}\./); | ||
| 181 | # WIN32 UNICODE build gets linked with unicows.lib for | ||
| 182 | # backward compatibility with Win9x. | ||
| 183 | $ex_libs="unicows.lib $ex_libs" if ($FLAVOR =~ /WIN32/ and $cflags =~ /\-DUNICODE/); | ||
| 184 | } | ||
| 185 | |||
| 186 | # static library stuff | ||
| 187 | $mklib='lib /nologo'; | ||
| 188 | $ranlib=''; | ||
| 189 | $plib=""; | ||
| 190 | $libp=".lib"; | ||
| 191 | $shlibp=($shlib)?".dll":".lib"; | ||
| 192 | $lfile='/out:'; | ||
| 193 | |||
| 194 | $shlib_ex_obj=""; | ||
| 195 | $app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/); | ||
| 196 | if ($FLAVOR =~ /WIN64A/) { | ||
| 197 | if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) { | ||
| 198 | $asm='nasm -f win64 -DNEAR -Ox -g'; | ||
| 199 | $afile='-o '; | ||
| 200 | } else { | ||
| 201 | $asm='ml64 /c /Cp /Cx /Zi'; | ||
| 202 | $afile='/Fo'; | ||
| 203 | } | ||
| 204 | } elsif ($FLAVOR =~ /WIN64I/) { | ||
| 205 | $asm='ias -d debug'; | ||
| 206 | $afile="-o "; | ||
| 207 | } elsif ($nasm) { | ||
| 208 | my $ver=`nasm -v 2>NUL`; | ||
| 209 | my $vew=`nasmw -v 2>NUL`; | ||
| 210 | # pick newest version | ||
| 211 | $asm=($ver ge $vew?"nasm":"nasmw")." -f win32"; | ||
| 212 | $asmtype="win32n"; | ||
| 213 | $afile='-o '; | ||
| 214 | } else { | ||
| 215 | $asm='ml /nologo /Cp /coff /c /Cx /Zi'; | ||
| 216 | $afile='/Fo'; | ||
| 217 | $asmtype="win32"; | ||
| 218 | } | ||
| 219 | |||
| 220 | $bn_asm_obj=''; | ||
| 221 | $bn_asm_src=''; | ||
| 222 | $des_enc_obj=''; | ||
| 223 | $des_enc_src=''; | ||
| 224 | $bf_enc_obj=''; | ||
| 225 | $bf_enc_src=''; | ||
| 226 | |||
| 227 | if (!$no_asm) | ||
| 228 | { | ||
| 229 | win32_import_asm($mf_bn_asm, "bn", \$bn_asm_obj, \$bn_asm_src); | ||
| 230 | win32_import_asm($mf_aes_asm, "aes", \$aes_asm_obj, \$aes_asm_src); | ||
| 231 | win32_import_asm($mf_des_asm, "des", \$des_enc_obj, \$des_enc_src); | ||
| 232 | win32_import_asm($mf_bf_asm, "bf", \$bf_enc_obj, \$bf_enc_src); | ||
| 233 | win32_import_asm($mf_cast_asm, "cast", \$cast_enc_obj, \$cast_enc_src); | ||
| 234 | win32_import_asm($mf_rc4_asm, "rc4", \$rc4_enc_obj, \$rc4_enc_src); | ||
| 235 | win32_import_asm($mf_rc5_asm, "rc5", \$rc5_enc_obj, \$rc5_enc_src); | ||
| 236 | win32_import_asm($mf_md5_asm, "md5", \$md5_asm_obj, \$md5_asm_src); | ||
| 237 | win32_import_asm($mf_sha_asm, "sha", \$sha1_asm_obj, \$sha1_asm_src); | ||
| 238 | win32_import_asm($mf_rmd_asm, "ripemd", \$rmd160_asm_obj, \$rmd160_asm_src); | ||
| 239 | win32_import_asm($mf_wp_asm, "whrlpool", \$whirlpool_asm_obj, \$whirlpool_asm_src); | ||
| 240 | win32_import_asm($mf_cpuid_asm, "", \$cpuid_asm_obj, \$cpuid_asm_src); | ||
| 241 | $perl_asm = 1; | ||
| 242 | } | ||
| 243 | |||
| 244 | if ($shlib && $FLAVOR !~ /CE/) | ||
| 245 | { | ||
| 246 | $mlflags.=" $lflags /dll"; | ||
| 247 | $lib_cflag.=" -D_WINDLL"; | ||
| 248 | # | ||
| 249 | # Engage Applink... | ||
| 250 | # | ||
| 251 | $app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib"; | ||
| 252 | $cflags.=" -DOPENSSL_USE_APPLINK -I."; | ||
| 253 | # I'm open for better suggestions than overriding $banner... | ||
| 254 | $banner=<<'___'; | ||
| 255 | @echo Building OpenSSL | ||
| 256 | |||
| 257 | $(OBJ_D)\applink.obj: ms\applink.c | ||
| 258 | $(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c | ||
| 259 | $(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c | ||
| 260 | $(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c | ||
| 261 | $(INCO_D)\applink.c: ms\applink.c | ||
| 262 | $(CP) ms\applink.c $(INCO_D)\applink.c | ||
| 263 | |||
| 264 | EXHEADER= $(EXHEADER) $(INCO_D)\applink.c | ||
| 265 | |||
| 266 | LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj | ||
| 267 | CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ) | ||
| 268 | ___ | ||
| 269 | $banner.=<<'___' if ($FLAVOR =~ /WIN64/); | ||
| 270 | CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ) | ||
| 271 | ___ | ||
| 272 | } | ||
| 273 | elsif ($shlib && $FLAVOR =~ /CE/) | ||
| 274 | { | ||
| 275 | $mlflags.=" $lflags /dll"; | ||
| 276 | $lflags.=' /entry:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'})); | ||
| 277 | $lib_cflag.=" -D_WINDLL -D_DLL"; | ||
| 278 | } | ||
| 279 | |||
| 280 | sub do_lib_rule | ||
| 281 | { | ||
| 282 | my($objs,$target,$name,$shlib,$ign,$base_addr) = @_; | ||
| 283 | local($ret); | ||
| 284 | |||
| 285 | $taget =~ s/\//$o/g if $o ne '/'; | ||
| 286 | my $base_arg; | ||
| 287 | if ($base_addr ne "") | ||
| 288 | { | ||
| 289 | $base_arg= " /base:$base_addr"; | ||
| 290 | } | ||
| 291 | else | ||
| 292 | { | ||
| 293 | $base_arg = ""; | ||
| 294 | } | ||
| 295 | if ($name ne "") | ||
| 296 | { | ||
| 297 | $name =~ tr/a-z/A-Z/; | ||
| 298 | $name = "/def:ms/${name}.def"; | ||
| 299 | } | ||
| 300 | |||
| 301 | # $target="\$(LIB_D)$o$target"; | ||
| 302 | # $ret.="$target: $objs\n"; | ||
| 303 | if (!$shlib) | ||
| 304 | { | ||
| 305 | # $ret.="\t\$(RM) \$(O_$Name)\n"; | ||
| 306 | $ret.="$target: $objs\n"; | ||
| 307 | $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; | ||
| 308 | } | ||
| 309 | else | ||
| 310 | { | ||
| 311 | local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)'; | ||
| 312 | $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; | ||
| 313 | |||
| 314 | if ($fips && $target =~ /O_CRYPTO/) | ||
| 315 | { | ||
| 316 | $ret.="$target: $objs \$(PREMAIN_DSO_EXE)"; | ||
| 317 | $ret.="\n\tSET FIPS_LINK=\$(LINK)\n"; | ||
| 318 | $ret.="\tSET FIPS_CC=\$(CC)\n"; | ||
| 319 | $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; | ||
| 320 | $ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n"; | ||
| 321 | $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; | ||
| 322 | $ret.="\tSET FIPS_TARGET=$target\n"; | ||
| 323 | $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; | ||
| 324 | $ret.="\t\$(FIPSLINK) \$(MLFLAGS) $ff /map $base_arg $efile$target "; | ||
| 325 | $ret.="$name @<<\n \$(SHLIB_EX_OBJ) $objs \$(EX_LIBS) "; | ||
| 326 | $ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n"; | ||
| 327 | } | ||
| 328 | else | ||
| 329 | { | ||
| 330 | $ret.="$target: $objs"; | ||
| 331 | $ret.="\n\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n"; | ||
| 332 | } | ||
| 333 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; | ||
| 334 | } | ||
| 335 | $ret.="\n"; | ||
| 336 | return($ret); | ||
| 337 | } | ||
| 338 | |||
| 339 | sub do_link_rule | ||
| 340 | { | ||
| 341 | my($target,$files,$dep_libs,$libs,$standalone)=@_; | ||
| 342 | local($ret,$_); | ||
| 343 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 344 | $n=&bname($targer); | ||
| 345 | $ret.="$target: $files $dep_libs\n"; | ||
| 346 | if ($standalone == 1) | ||
| 347 | { | ||
| 348 | $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t"; | ||
| 349 | $ret.= "\$(EX_LIBS) " if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild); | ||
| 350 | $ret.="$files $libs\n<<\n"; | ||
| 351 | } | ||
| 352 | elsif ($standalone == 2) | ||
| 353 | { | ||
| 354 | $ret.="\tSET FIPS_LINK=\$(LINK)\n"; | ||
| 355 | $ret.="\tSET FIPS_CC=\$(CC)\n"; | ||
| 356 | $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; | ||
| 357 | $ret.="\tSET PREMAIN_DSO_EXE=\n"; | ||
| 358 | $ret.="\tSET FIPS_TARGET=$target\n"; | ||
| 359 | $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; | ||
| 360 | $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; | ||
| 361 | $ret.="\t\$(FIPSLINK) \$(LFLAGS) $ff /map $efile$target @<<\n"; | ||
| 362 | $ret.="\t\$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n"; | ||
| 363 | } | ||
| 364 | else | ||
| 365 | { | ||
| 366 | $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; | ||
| 367 | $ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n"; | ||
| 368 | } | ||
| 369 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; | ||
| 370 | return($ret); | ||
| 371 | } | ||
| 372 | |||
| 373 | sub win32_import_asm | ||
| 374 | { | ||
| 375 | my ($mf_var, $asm_name, $oref, $sref) = @_; | ||
| 376 | my $asm_dir; | ||
| 377 | if ($asm_name eq "") | ||
| 378 | { | ||
| 379 | $asm_dir = "crypto\\"; | ||
| 380 | } | ||
| 381 | else | ||
| 382 | { | ||
| 383 | $asm_dir = "crypto\\$asm_name\\asm\\"; | ||
| 384 | } | ||
| 385 | |||
| 386 | $$oref = ""; | ||
| 387 | $mf_var =~ s/\.o$/.obj/g; | ||
| 388 | |||
| 389 | foreach (split(/ /, $mf_var)) | ||
| 390 | { | ||
| 391 | $$oref .= $asm_dir . $_ . " "; | ||
| 392 | } | ||
| 393 | $$oref =~ s/ $//; | ||
| 394 | $$sref = $$oref; | ||
| 395 | $$sref =~ s/\.obj/.asm/g; | ||
| 396 | |||
| 397 | } | ||
| 398 | |||
| 399 | |||
| 400 | 1; | ||
diff --git a/src/lib/libcrypto/util/pl/linux.pl b/src/lib/libcrypto/util/pl/linux.pl new file mode 100644 index 0000000000..d24f7b7291 --- /dev/null +++ b/src/lib/libcrypto/util/pl/linux.pl | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # | ||
| 3 | # linux.pl - the standard unix makefile stuff. | ||
| 4 | # | ||
| 5 | |||
| 6 | $o='/'; | ||
| 7 | $cp='/bin/cp'; | ||
| 8 | $rm='/bin/rm -f'; | ||
| 9 | |||
| 10 | # C compiler stuff | ||
| 11 | |||
| 12 | $cc='gcc'; | ||
| 13 | if ($debug) | ||
| 14 | { $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; } | ||
| 15 | elsif ($profile) | ||
| 16 | { $cflags="-pg -O3"; } | ||
| 17 | else | ||
| 18 | { $cflags="-O3 -fomit-frame-pointer"; } | ||
| 19 | |||
| 20 | if (!$no_asm) | ||
| 21 | { | ||
| 22 | $bn_asm_obj='$(OBJ_D)/bn86-elf.o'; | ||
| 23 | $bn_asm_src='crypto/bn/asm/bn86unix.cpp'; | ||
| 24 | $bnco_asm_obj='$(OBJ_D)/co86-elf.o'; | ||
| 25 | $bnco_asm_src='crypto/bn/asm/co86unix.cpp'; | ||
| 26 | $des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o'; | ||
| 27 | $des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp'; | ||
| 28 | $bf_enc_obj='$(OBJ_D)/bx86-elf.o'; | ||
| 29 | $bf_enc_src='crypto/bf/asm/bx86unix.cpp'; | ||
| 30 | $cast_enc_obj='$(OBJ_D)/cx86-elf.o'; | ||
| 31 | $cast_enc_src='crypto/cast/asm/cx86unix.cpp'; | ||
| 32 | $rc4_enc_obj='$(OBJ_D)/rx86-elf.o'; | ||
| 33 | $rc4_enc_src='crypto/rc4/asm/rx86unix.cpp'; | ||
| 34 | $rc5_enc_obj='$(OBJ_D)/r586-elf.o'; | ||
| 35 | $rc5_enc_src='crypto/rc5/asm/r586unix.cpp'; | ||
| 36 | $md5_asm_obj='$(OBJ_D)/mx86-elf.o'; | ||
| 37 | $md5_asm_src='crypto/md5/asm/mx86unix.cpp'; | ||
| 38 | $rmd160_asm_obj='$(OBJ_D)/rm86-elf.o'; | ||
| 39 | $rmd160_asm_src='crypto/ripemd/asm/rm86unix.cpp'; | ||
| 40 | $sha1_asm_obj='$(OBJ_D)/sx86-elf.o'; | ||
| 41 | $sha1_asm_src='crypto/sha/asm/sx86unix.cpp'; | ||
| 42 | $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS"; | ||
| 43 | } | ||
| 44 | |||
| 45 | $cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall"; | ||
| 46 | |||
| 47 | if ($shlib) | ||
| 48 | { | ||
| 49 | $shl_cflag=" -DPIC -fpic"; | ||
| 50 | $shlibp=".so.$ssl_version"; | ||
| 51 | $so_shlibp=".so"; | ||
| 52 | } | ||
| 53 | |||
| 54 | sub do_shlib_rule | ||
| 55 | { | ||
| 56 | local($obj,$target,$name,$shlib,$so_name)=@_; | ||
| 57 | local($ret,$_,$Name); | ||
| 58 | |||
| 59 | $target =~ s/\//$o/g if $o ne '/'; | ||
| 60 | ($Name=$name) =~ tr/a-z/A-Z/; | ||
| 61 | |||
| 62 | $ret.="$target: \$(${Name}OBJ)\n"; | ||
| 63 | $ret.="\t\$(RM) target\n"; | ||
| 64 | $ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o $target \$(${Name}OBJ)\n"; | ||
| 65 | ($t=$target) =~ s/(^.*)\/[^\/]*$/$1/; | ||
| 66 | if ($so_name ne "") | ||
| 67 | { | ||
| 68 | $ret.="\t\$(RM) \$(LIB_D)$o$so_name\n"; | ||
| 69 | $ret.="\tln -s $target \$(LIB_D)$o$so_name\n\n"; | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | sub do_link_rule | ||
| 74 | { | ||
| 75 | local($target,$files,$dep_libs,$libs)=@_; | ||
| 76 | local($ret,$_); | ||
| 77 | |||
| 78 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 79 | $n=&bname($target); | ||
| 80 | $ret.="$target: $files $dep_libs\n"; | ||
| 81 | $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; | ||
| 82 | return($ret); | ||
| 83 | } | ||
| 84 | |||
| 85 | sub do_asm_rule | ||
| 86 | { | ||
| 87 | local($target,$src)=@_; | ||
| 88 | local($ret,@s,@t,$i); | ||
| 89 | |||
| 90 | $target =~ s/\//$o/g if $o ne "/"; | ||
| 91 | $src =~ s/\//$o/g if $o ne "/"; | ||
| 92 | |||
| 93 | @s=split(/\s+/,$src); | ||
| 94 | @t=split(/\s+/,$target); | ||
| 95 | |||
| 96 | for ($i=0; $i<=$#s; $i++) | ||
| 97 | { | ||
| 98 | $ret.="$t[$i]: $s[$i]\n"; | ||
| 99 | $ret.="\tgcc -E -DELF \$(SRC_D)$o$s[$i]|\$(AS) $afile$t[$i]\n\n"; | ||
| 100 | } | ||
| 101 | return($ret); | ||
| 102 | } | ||
| 103 | |||
| 104 | 1; | ||
diff --git a/src/lib/libcrypto/util/pl/ultrix.pl b/src/lib/libcrypto/util/pl/ultrix.pl new file mode 100644 index 0000000000..ea370c71f9 --- /dev/null +++ b/src/lib/libcrypto/util/pl/ultrix.pl | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # | ||
| 3 | # linux.pl - the standard unix makefile stuff. | ||
| 4 | # | ||
| 5 | |||
| 6 | $o='/'; | ||
| 7 | $cp='/bin/cp'; | ||
| 8 | $rm='/bin/rm -f'; | ||
| 9 | |||
| 10 | # C compiler stuff | ||
| 11 | |||
| 12 | $cc='cc'; | ||
| 13 | if ($debug) | ||
| 14 | { $cflags="-g -DREF_CHECK -DCRYPTO_MDEBUG"; } | ||
| 15 | else | ||
| 16 | { $cflags="-O2"; } | ||
| 17 | |||
| 18 | $cflags.=" -std1 -DL_ENDIAN"; | ||
| 19 | |||
| 20 | if (!$no_asm) | ||
| 21 | { | ||
| 22 | $bn_asm_obj='$(OBJ_D)/mips1.o'; | ||
| 23 | $bn_asm_src='crypto/bn/asm/mips1.s'; | ||
| 24 | } | ||
| 25 | |||
| 26 | sub do_link_rule | ||
| 27 | { | ||
| 28 | local($target,$files,$dep_libs,$libs)=@_; | ||
| 29 | local($ret,$_); | ||
| 30 | |||
| 31 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 32 | $n=&bname($target); | ||
| 33 | $ret.="$target: $files $dep_libs\n"; | ||
| 34 | $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; | ||
| 35 | return($ret); | ||
| 36 | } | ||
| 37 | |||
| 38 | 1; | ||
diff --git a/src/lib/libcrypto/util/pl/Mingw32f.pl b/src/lib/libcrypto/util/pl/unix.pl index 44f5673d7a..146611ad99 100644 --- a/src/lib/libcrypto/util/pl/Mingw32f.pl +++ b/src/lib/libcrypto/util/pl/unix.pl | |||
| @@ -1,20 +1,30 @@ | |||
| 1 | #!/usr/local/bin/perl | 1 | #!/usr/local/bin/perl |
| 2 | # | 2 | # |
| 3 | # Mingw32f.pl -- copy files; Mingw32.pl is needed to do the compiling. | 3 | # unix.pl - the standard unix makefile stuff. |
| 4 | # | 4 | # |
| 5 | 5 | ||
| 6 | $o='\\'; | 6 | $o='/'; |
| 7 | $cp='copy'; | 7 | $cp='/bin/cp'; |
| 8 | $rm='del'; | 8 | $rm='/bin/rm -f'; |
| 9 | 9 | ||
| 10 | # C compiler stuff | 10 | # C compiler stuff |
| 11 | 11 | ||
| 12 | $cc='gcc'; | 12 | if ($gcc) |
| 13 | if ($debug) | 13 | { |
| 14 | { $cflags="-g2 -ggdb -DDSO_WIN32"; } | 14 | $cc='gcc'; |
| 15 | if ($debug) | ||
| 16 | { $cflags="-g2 -ggdb"; } | ||
| 17 | else | ||
| 18 | { $cflags="-O3 -fomit-frame-pointer"; } | ||
| 19 | } | ||
| 15 | else | 20 | else |
| 16 | { $cflags="-O3 -fomit-frame-pointer -DDSO_WIN32"; } | 21 | { |
| 17 | 22 | $cc='cc'; | |
| 23 | if ($debug) | ||
| 24 | { $cflags="-g"; } | ||
| 25 | else | ||
| 26 | { $cflags="-O"; } | ||
| 27 | } | ||
| 18 | $obj='.o'; | 28 | $obj='.o'; |
| 19 | $ofile='-o '; | 29 | $ofile='-o '; |
| 20 | 30 | ||
| @@ -23,12 +33,12 @@ $link='${CC}'; | |||
| 23 | $lflags='${CFLAGS}'; | 33 | $lflags='${CFLAGS}'; |
| 24 | $efile='-o '; | 34 | $efile='-o '; |
| 25 | $exep=''; | 35 | $exep=''; |
| 26 | $ex_libs="-lwsock32 -lgdi32"; | 36 | $ex_libs=""; |
| 27 | 37 | ||
| 28 | # static library stuff | 38 | # static library stuff |
| 29 | $mklib='ar r'; | 39 | $mklib='ar r'; |
| 30 | $mlflags=''; | 40 | $mlflags=''; |
| 31 | $ranlib='ranlib'; | 41 | $ranlib=&which("ranlib") or $ranlib="true"; |
| 32 | $plib='lib'; | 42 | $plib='lib'; |
| 33 | $libp=".a"; | 43 | $libp=".a"; |
| 34 | $shlibp=".a"; | 44 | $shlibp=".a"; |
| @@ -69,5 +79,18 @@ sub do_link_rule | |||
| 69 | $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; | 79 | $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; |
| 70 | return($ret); | 80 | return($ret); |
| 71 | } | 81 | } |
| 72 | 1; | ||
| 73 | 82 | ||
| 83 | sub which | ||
| 84 | { | ||
| 85 | my ($name)=@_; | ||
| 86 | my $path; | ||
| 87 | foreach $path (split /:/, $ENV{PATH}) | ||
| 88 | { | ||
| 89 | if (-x "$path/$name") | ||
| 90 | { | ||
| 91 | return "$path/$name"; | ||
| 92 | } | ||
| 93 | } | ||
| 94 | } | ||
| 95 | |||
| 96 | 1; | ||
