summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util/pl/unix.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util/pl/unix.pl')
-rw-r--r--src/lib/libcrypto/util/pl/unix.pl101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/pl/unix.pl b/src/lib/libcrypto/util/pl/unix.pl
new file mode 100644
index 0000000000..bbd1798a2e
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/unix.pl
@@ -0,0 +1,101 @@
1#!/usr/local/bin/perl
2#
3# unix.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
12if ($gcc)
13 {
14 $cc='gcc';
15 if ($debug)
16 { $cflags="-g2 -ggdb"; }
17 else
18 { $cflags="-O3 -fomit-frame-pointer"; }
19 }
20else
21 {
22 $cc='cc';
23 if ($debug)
24 { $cflags="-g"; }
25 else
26 { $cflags="-O"; }
27 }
28$obj='.o';
29$ofile='-o ';
30
31# EXE linking stuff
32$link='${CC}';
33$lflags='${CFLAGS}';
34$efile='-o ';
35$exep='';
36$ex_libs="";
37
38# static library stuff
39$mklib='ar r';
40$mlflags='';
41$ranlib=&which("ranlib") or $ranlib="true";
42$plib='lib';
43$libp=".a";
44$shlibp=".a";
45$lfile='';
46
47$asm='as';
48$afile='-o ';
49$bn_asm_obj="";
50$bn_asm_src="";
51$des_enc_obj="";
52$des_enc_src="";
53$bf_enc_obj="";
54$bf_enc_src="";
55
56sub do_lib_rule
57 {
58 local($obj,$target,$name,$shlib)=@_;
59 local($ret,$_,$Name);
60
61 $target =~ s/\//$o/g if $o ne '/';
62 $target="$target";
63 ($Name=$name) =~ tr/a-z/A-Z/;
64
65 $ret.="$target: \$(${Name}OBJ)\n";
66 $ret.="\t\$(RM) $target\n";
67 $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
68 $ret.="\t\$(RANLIB) $target\n\n";
69 }
70
71sub do_link_rule
72 {
73 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_;
74 local($ret,$_);
75
76 $file =~ s/\//$o/g if $o ne '/';
77 $n=&bname($target);
78 $ret.="$target: $files $dep_libs\n";
79 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n";
80 if (defined $sha1file)
81 {
82 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
83 }
84 $ret.="\n";
85 return($ret);
86 }
87
88sub which
89 {
90 my ($name)=@_;
91 my $path;
92 foreach $path (split /:/, $ENV{PATH})
93 {
94 if (-x "$path/$name")
95 {
96 return "$path/$name";
97 }
98 }
99 }
100
1011;