2001-07-01 22:39:46 +00:00
|
|
|
#!/usr/local/bin/perl
|
|
|
|
#
|
|
|
|
# OS2-EMX.pl - for EMX GCC on OS/2
|
|
|
|
#
|
|
|
|
|
2003-11-28 14:51:30 +00:00
|
|
|
$o='/';
|
|
|
|
$cp='cp';
|
2001-07-01 22:39:46 +00:00
|
|
|
$rm='rm -f';
|
|
|
|
|
2003-11-28 14:51:30 +00:00
|
|
|
$preamble = "SHELL=sh\n";
|
|
|
|
|
2001-07-01 22:39:46 +00:00
|
|
|
# C compiler stuff
|
|
|
|
|
|
|
|
$cc='gcc';
|
2002-07-17 13:27:43 +00:00
|
|
|
$cflags="-DL_ENDIAN -O3 -fomit-frame-pointer -m486 -Zmtd -Wall ";
|
|
|
|
$cflags.="-Zomf " if $shlib;
|
|
|
|
$shl_cflag="-Zdll";
|
2001-07-01 22:39:46 +00:00
|
|
|
|
|
|
|
if ($debug) {
|
|
|
|
$cflags.="-g ";
|
|
|
|
}
|
|
|
|
|
2002-07-17 13:27:43 +00:00
|
|
|
$obj=$shlib ? '.obj' : '.o';
|
2001-07-01 22:39:46 +00:00
|
|
|
$ofile='-o ';
|
|
|
|
|
|
|
|
# EXE linking stuff
|
|
|
|
$link='${CC}';
|
2002-07-17 13:27:43 +00:00
|
|
|
$lflags='${CFLAGS} -Zbsd-signals -s';
|
2001-07-01 22:39:46 +00:00
|
|
|
$efile='-o ';
|
|
|
|
$exep='.exe';
|
|
|
|
$ex_libs="-lsocket";
|
|
|
|
|
|
|
|
# static library stuff
|
|
|
|
$mklib='ar r';
|
|
|
|
$mlflags='';
|
|
|
|
$ranlib="ar s";
|
2002-07-17 13:27:43 +00:00
|
|
|
$plib='';
|
|
|
|
$libp=$shlib ? ".lib" : ".a";
|
|
|
|
$shlibp=$shlib ? ".dll" : ".a";
|
2001-07-01 22:39:46 +00:00
|
|
|
$lfile='';
|
|
|
|
|
2002-07-17 13:27:43 +00:00
|
|
|
$asm=$shlib ? 'as -Zomf' : 'as';
|
2001-07-01 22:39:46 +00:00
|
|
|
$afile='-o ';
|
|
|
|
$bn_asm_obj="";
|
|
|
|
$bn_asm_src="";
|
|
|
|
$des_enc_obj="";
|
|
|
|
$des_enc_src="";
|
|
|
|
$bf_enc_obj="";
|
|
|
|
$bf_enc_src="";
|
|
|
|
|
|
|
|
if (!$no_asm)
|
|
|
|
{
|
2003-11-28 14:51:30 +00:00
|
|
|
$bn_asm_obj="crypto/bn/asm/bn-os2$obj crypto/bn/asm/co-os2$obj";
|
|
|
|
$bn_asm_src="crypto/bn/asm/bn-os2.asm crypto/bn/asm/co-os2.asm";
|
|
|
|
$des_enc_obj="crypto/des/asm/d-os2$obj crypto/des/asm/y-os2$obj";
|
|
|
|
$des_enc_src="crypto/des/asm/d-os2.asm crypto/des/asm/y-os2.asm";
|
|
|
|
$bf_enc_obj="crypto/bf/asm/b-os2$obj";
|
|
|
|
$bf_enc_src="crypto/bf/asm/b-os2.asm";
|
|
|
|
$cast_enc_obj="crypto/cast/asm/c-os2$obj";
|
|
|
|
$cast_enc_src="crypto/cast/asm/c-os2.asm";
|
|
|
|
$rc4_enc_obj="crypto/rc4/asm/r4-os2$obj";
|
|
|
|
$rc4_enc_src="crypto/rc4/asm/r4-os2.asm";
|
|
|
|
$rc5_enc_obj="crypto/rc5/asm/r5-os2$obj";
|
|
|
|
$rc5_enc_src="crypto/rc5/asm/r5-os2.asm";
|
|
|
|
$md5_asm_obj="crypto/md5/asm/m5-os2$obj";
|
|
|
|
$md5_asm_src="crypto/md5/asm/m5-os2.asm";
|
|
|
|
$sha1_asm_obj="crypto/sha/asm/s1-os2$obj";
|
|
|
|
$sha1_asm_src="crypto/sha/asm/s1-os2.asm";
|
|
|
|
$rmd160_asm_obj="crypto/ripemd/asm/rm-os2$obj";
|
|
|
|
$rmd160_asm_src="crypto/ripemd/asm/rm-os2.asm";
|
2002-07-17 13:27:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($shlib)
|
|
|
|
{
|
|
|
|
$mlflags.=" $lflags -Zdll";
|
|
|
|
$lib_cflag=" -D_DLL";
|
|
|
|
$out_def="out_dll";
|
|
|
|
$tmp_def="tmp_dll";
|
2001-07-01 22:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub do_lib_rule
|
|
|
|
{
|
|
|
|
local($obj,$target,$name,$shlib)=@_;
|
|
|
|
local($ret,$_,$Name);
|
|
|
|
|
|
|
|
$target =~ s/\//$o/g if $o ne '/';
|
|
|
|
$target="$target";
|
|
|
|
($Name=$name) =~ tr/a-z/A-Z/;
|
|
|
|
|
|
|
|
$ret.="$target: \$(${Name}OBJ)\n";
|
2002-07-17 13:27:43 +00:00
|
|
|
if (!$shlib)
|
|
|
|
{
|
|
|
|
$ret.="\t\$(RM) $target\n";
|
|
|
|
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
|
|
|
|
$ret.="\t\$(RANLIB) $target\n\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
|
|
|
|
$ex.=' -lsocket';
|
|
|
|
$ret.="\t\$(LINK) \$(SHLIB_CFLAGS) \$(MLFLAGS) $efile$target \$(SHLIB_EX_OBJ) \$(${Name}OBJ) $ex os2/${Name}.def\n";
|
|
|
|
$ret.="\temximp -o $out_def/$name.a os2/${Name}.def\n";
|
|
|
|
$ret.="\temximp -o $out_def/$name.lib os2/${Name}.def\n\n";
|
|
|
|
}
|
2001-07-01 22:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub do_link_rule
|
|
|
|
{
|
|
|
|
local($target,$files,$dep_libs,$libs)=@_;
|
|
|
|
local($ret,$_);
|
|
|
|
|
|
|
|
$file =~ s/\//$o/g if $o ne '/';
|
|
|
|
$n=&bname($target);
|
|
|
|
$ret.="$target: $files $dep_libs\n";
|
2002-07-17 13:27:43 +00:00
|
|
|
$ret.="\t\$(LINK) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n\n";
|
2001-07-01 22:39:46 +00:00
|
|
|
return($ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|