etc/services - sync with NetBSD-8
[minix.git] / crypto / external / bsd / openssl / dist / util / pl / unix.pl
blob25dc879610db525950656e0380196231473c5293
1 #!/usr/local/bin/perl
3 # unix.pl - the standard unix makefile stuff.
6 $o='/';
7 $cp='/bin/cp';
8 $rm='/bin/rm -f';
10 # C compiler stuff
12 if ($gcc)
14 $cc='gcc';
15 if ($debug)
16 { $cflags="-g2 -ggdb"; }
17 else
18 { $cflags="-O3 -fomit-frame-pointer"; }
20 else
22 $cc='cc';
23 if ($debug)
24 { $cflags="-g"; }
25 else
26 { $cflags="-O"; }
28 $obj='.o';
29 $ofile='-o ';
31 # EXE linking stuff
32 $link='${CC}';
33 $lflags='${CFLAGS}';
34 $efile='-o ';
35 $exep='';
36 $ex_libs="";
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='';
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="";
56 sub do_lib_rule
58 local($obj,$target,$name,$shlib)=@_;
59 local($ret,$_,$Name);
61 $target =~ s/\//$o/g if $o ne '/';
62 $target="$target";
63 (Name=name) =~ tr/a-z/A-Z/;
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";
71 sub do_link_rule
73 local($target,$files,$dep_libs,$libs)=@_;
74 local($ret,$_);
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\n";
80 return($ret);
83 sub which
85 my ($name)=@_;
86 my $path;
87 foreach $path (split /:/, $ENV{PATH})
89 if (-x "$path/$name")
91 return "$path/$name";