1*e0c4386eSCy Schubert# -*- Mode: perl -*-
2*e0c4386eSCy Schubertmy %targets=(
3*e0c4386eSCy Schubert    DEFAULTS => {
4*e0c4386eSCy Schubert	template	=> 1,
5*e0c4386eSCy Schubert
6*e0c4386eSCy Schubert	cflags		=> "",
7*e0c4386eSCy Schubert	cppflags	=> "",
8*e0c4386eSCy Schubert	lflags		=> "",
9*e0c4386eSCy Schubert	defines		=> [],
10*e0c4386eSCy Schubert	includes	=> [],
11*e0c4386eSCy Schubert	lib_cflags	=> "",
12*e0c4386eSCy Schubert	lib_cppflags	=> "",
13*e0c4386eSCy Schubert	lib_defines	=> [],
14*e0c4386eSCy Schubert	thread_scheme	=> "(unknown)", # Assume we don't know
15*e0c4386eSCy Schubert	thread_defines	=> [],
16*e0c4386eSCy Schubert
17*e0c4386eSCy Schubert	unistd		=> "<unistd.h>",
18*e0c4386eSCy Schubert	shared_target	=> "",
19*e0c4386eSCy Schubert	shared_cflag	=> "",
20*e0c4386eSCy Schubert	shared_defines	=> [],
21*e0c4386eSCy Schubert	shared_ldflag	=> "",
22*e0c4386eSCy Schubert	shared_rcflag	=> "",
23*e0c4386eSCy Schubert
24*e0c4386eSCy Schubert	#### Defaults for the benefit of the config targets who don't inherit
25*e0c4386eSCy Schubert	#### a BASE and assume Unix defaults
26*e0c4386eSCy Schubert	#### THESE WILL DISAPPEAR IN OpenSSL 1.2
27*e0c4386eSCy Schubert	build_scheme	=> [ "unified", "unix" ],
28*e0c4386eSCy Schubert	build_file	=> "Makefile",
29*e0c4386eSCy Schubert
30*e0c4386eSCy Schubert	AR		=> "(unused)",
31*e0c4386eSCy Schubert	ARFLAGS		=> "(unused)",
32*e0c4386eSCy Schubert	CC		=> "cc",
33*e0c4386eSCy Schubert	HASHBANGPERL	=> "/usr/bin/env perl",
34*e0c4386eSCy Schubert	RANLIB		=> sub { which("$config{cross_compile_prefix}ranlib")
35*e0c4386eSCy Schubert                                     ? "ranlib" : "" },
36*e0c4386eSCy Schubert	RC		=> "windres",
37*e0c4386eSCy Schubert
38*e0c4386eSCy Schubert	#### THESE WILL BE ENABLED IN OpenSSL 1.2
39*e0c4386eSCy Schubert	#HASHBANGPERL	=> "PERL", # Only Unix actually cares
40*e0c4386eSCy Schubert    },
41*e0c4386eSCy Schubert
42*e0c4386eSCy Schubert    BASE_common => {
43*e0c4386eSCy Schubert	template	=> 1,
44*e0c4386eSCy Schubert
45*e0c4386eSCy Schubert	enable		=> [],
46*e0c4386eSCy Schubert	disable		=> [],
47*e0c4386eSCy Schubert
48*e0c4386eSCy Schubert	defines		=>
49*e0c4386eSCy Schubert	    sub {
50*e0c4386eSCy Schubert                my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
51*e0c4386eSCy Schubert                push @defs, "ZLIB" unless $disabled{zlib};
52*e0c4386eSCy Schubert                push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
53*e0c4386eSCy Schubert                return [ @defs ];
54*e0c4386eSCy Schubert            },
55*e0c4386eSCy Schubert        includes        =>
56*e0c4386eSCy Schubert            sub {
57*e0c4386eSCy Schubert                my @incs = ();
58*e0c4386eSCy Schubert                push @incs, $withargs{zlib_include}
59*e0c4386eSCy Schubert                    if !$disabled{zlib} && $withargs{zlib_include};
60*e0c4386eSCy Schubert                return [ @incs ];
61*e0c4386eSCy Schubert            },
62*e0c4386eSCy Schubert    },
63*e0c4386eSCy Schubert
64*e0c4386eSCy Schubert    BASE_unix => {
65*e0c4386eSCy Schubert        inherit_from    => [ "BASE_common" ],
66*e0c4386eSCy Schubert        template        => 1,
67*e0c4386eSCy Schubert
68*e0c4386eSCy Schubert        AR              => "ar",
69*e0c4386eSCy Schubert        ARFLAGS         => "qc",
70*e0c4386eSCy Schubert        CC              => "cc",
71*e0c4386eSCy Schubert        lflags          =>
72*e0c4386eSCy Schubert            sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
73*e0c4386eSCy Schubert        ex_libs         =>
74*e0c4386eSCy Schubert            sub { !defined($disabled{zlib})
75*e0c4386eSCy Schubert                  && defined($disabled{"zlib-dynamic"})
76*e0c4386eSCy Schubert                  ? "-lz" : () },
77*e0c4386eSCy Schubert        HASHBANGPERL    => "/usr/bin/env perl", # Only Unix actually cares
78*e0c4386eSCy Schubert        RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
79*e0c4386eSCy Schubert                                     ? "ranlib" : "" },
80*e0c4386eSCy Schubert        RC              => "windres",
81*e0c4386eSCy Schubert
82*e0c4386eSCy Schubert        build_scheme    => [ "unified", "unix" ],
83*e0c4386eSCy Schubert        build_file      => "Makefile",
84*e0c4386eSCy Schubert
85*e0c4386eSCy Schubert        perl_platform   => 'Unix',
86*e0c4386eSCy Schubert    },
87*e0c4386eSCy Schubert
88*e0c4386eSCy Schubert    BASE_Windows => {
89*e0c4386eSCy Schubert        inherit_from    => [ "BASE_common" ],
90*e0c4386eSCy Schubert        template        => 1,
91*e0c4386eSCy Schubert
92*e0c4386eSCy Schubert        lib_defines      =>
93*e0c4386eSCy Schubert            sub {
94*e0c4386eSCy Schubert                my @defs = ();
95*e0c4386eSCy Schubert                unless ($disabled{"zlib-dynamic"}) {
96*e0c4386eSCy Schubert                    my $zlib = $withargs{zlib_lib} // "ZLIB1";
97*e0c4386eSCy Schubert                    push @defs, 'LIBZ=' . (quotify("perl", $zlib))[0];
98*e0c4386eSCy Schubert                }
99*e0c4386eSCy Schubert                return [ @defs ];
100*e0c4386eSCy Schubert            },
101*e0c4386eSCy Schubert        ex_libs         =>
102*e0c4386eSCy Schubert            sub {
103*e0c4386eSCy Schubert                unless ($disabled{zlib}) {
104*e0c4386eSCy Schubert                    if (defined($disabled{"zlib-dynamic"})) {
105*e0c4386eSCy Schubert                        return $withargs{zlib_lib} // "ZLIB1";
106*e0c4386eSCy Schubert                    }
107*e0c4386eSCy Schubert                }
108*e0c4386eSCy Schubert                return ();
109*e0c4386eSCy Schubert            },
110*e0c4386eSCy Schubert
111*e0c4386eSCy Schubert        MT              => "mt",
112*e0c4386eSCy Schubert        MTFLAGS         => "-nologo",
113*e0c4386eSCy Schubert        mtinflag        => "-manifest ",
114*e0c4386eSCy Schubert        mtoutflag       => "-outputresource:",
115*e0c4386eSCy Schubert
116*e0c4386eSCy Schubert        build_file      => "makefile",
117*e0c4386eSCy Schubert        build_scheme    => [ "unified", "windows" ],
118*e0c4386eSCy Schubert
119*e0c4386eSCy Schubert        perl_platform   => 'Windows',
120*e0c4386eSCy Schubert    },
121*e0c4386eSCy Schubert
122*e0c4386eSCy Schubert    BASE_VMS => {
123*e0c4386eSCy Schubert        inherit_from    => [ "BASE_common" ],
124*e0c4386eSCy Schubert        template        => 1,
125*e0c4386eSCy Schubert
126*e0c4386eSCy Schubert        includes        =>
127*e0c4386eSCy Schubert            add(sub {
128*e0c4386eSCy Schubert                    my @incs = ();
129*e0c4386eSCy Schubert                    # GNV$ZLIB_INCLUDE is the standard logical name for later
130*e0c4386eSCy Schubert                    # zlib incarnations.
131*e0c4386eSCy Schubert                    push @incs, 'GNV$ZLIB_INCLUDE:'
132*e0c4386eSCy Schubert                        if !$disabled{zlib} && !$withargs{zlib_include};
133*e0c4386eSCy Schubert                    return [ @incs ];
134*e0c4386eSCy Schubert                }),
135*e0c4386eSCy Schubert
136*e0c4386eSCy Schubert        build_file       => "descrip.mms",
137*e0c4386eSCy Schubert        build_scheme     => [ "unified", "VMS" ],
138*e0c4386eSCy Schubert
139*e0c4386eSCy Schubert        perl_platform    => 'VMS',
140*e0c4386eSCy Schubert    },
141*e0c4386eSCy Schubert);
142