# Helper functions for the VMS configs
my $vms_info = {};
sub vms_info {
- unless (%$vms_info) {
- my $pointer_size = shift;
- my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";
+ my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
+
+ # For the case where Configure iterate through all config targets, such
+ # as when listing them and their details, we reset info if the pointer
+ # size changes.
+ if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
+ $vms_info = {};
+ }
+ unless (%$vms_info) {
$vms_info->{disable_warns} = [ ];
$vms_info->{pointer_size} = $pointer_size_str;
- if ($pointer_size == 64) {
+ if ($pointer_size_str eq "64") {
`PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
if ($? == 0) {
push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
debug => "-O0 -g",
release => "-O3 -fomit-frame-pointer"),
threads("-pthread")),
- cppflags => add("-DL_DEBIAN"),
+ cppflags => add("-DL_ENDIAN"),
ex_libs => add(threads("-pthread")),
bn_ops => "BN_LLONG",
shared_cflag => "-fPIC",
debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
- cppflags => add("-DL_DEBIAN"),
+ cppflags => add("-DL_ENDIAN"),
ex_libs => add(threads("-pthread")),
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa",
debug => "-g",
release => "-xO5 -xdepend -xbuiltin")),
- cppflags => add("-DL_DEBIAN", threads("-D_REENTRANT")),
+ cppflags => add("-DL_ENDIAN", threads("-D_REENTRANT")),
thread_scheme => "pthreads",
lflags => add(threads("-mt")),
ex_libs => add(threads("-lpthread")),
debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
- cppflags => add("-DB_DEBIAN -DBN_DIV2W"),
+ cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
ex_libs => add(threads("-pthread")),
bn_ops => "BN_LLONG RC4_CHAR",
shared_cflag => "-fPIC",
cflags => add_before(picker(default => "-xstrconst -Xa",
debug => "-g",
release => "-xO5 -xdepend")),
- cppflags => add("-DB_DEBIAN -DBN_DIV2W",
+ cppflags => add("-DB_ENDIAN -DBN_DIV2W",
threads("-D_REENTRANT")),
lflags => add(threads("-mt")),
ex_libs => add(threads("-lpthread")),
cflags => combine(picker(default => "-mabi=n32",
debug => "-g -O0",
release => "-O3")),
- cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
+ cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
threads("-D_SGI_MP_SOURCE")),
ex_libs => add(threads("-lpthread")),
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
debug => "-g -O0",
release => "-O2")),
- cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
+ cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
threads("-D_SGI_MP_SOURCE")),
ex_libs => add(threads("-lpthread")),
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
cflags => combine(picker(default => "-mabi=64 -mips4",
debug => "-g -O0",
release => "-O3")),
- cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
+ cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
threads("-D_SGI_MP_SOURCE")),
ex_libs => add(threads("-lpthread")),
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
debug => "-g -O0",
release => "-O2")),
- cppflags => combine("-DB_DEBIAN -DBN_DIV3W",
+ cppflags => combine("-DB_ENDIAN -DBN_DIV3W",
threads("-D_SGI_MP_SOURCE")),
ex_libs => add(threads("-lpthread")),
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
cflags => combine(picker(debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
- cppflags => "-DB_DEBIAN -DBN_DIV2W",
+ cppflags => "-DB_ENDIAN -DBN_DIV2W",
ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
bn_ops => "BN_LLONG",
thread_scheme => "pthreads",
cc => "gcc",
cflags => combine(picker(debug => "-O0 -g",
release => "-O3")),
- cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
+ cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
ex_libs => add("-ldl"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
thread_scheme => "pthreads",
cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit",
debug => "+O0 +d -g",
release => "+O3")),
- cppflags => combine("-DB_DEBIAN -DBN_DIV2W -DMD32_XARRAY",
+ cppflags => combine("-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
threads("-D_REENTRANT")),
ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
bn_ops => "RC4_CHAR",
cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
debug => "+O0 +d -g",
release => "+O3")),
- cppflags => combine("-DB_DEBIAN -DMD32_XARRAY",
+ cppflags => combine("-DB_ENDIAN -DMD32_XARRAY",
threads("-D_REENTRANT")),
ex_libs => add("-ldl",threads("-lpthread")),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z",
debug => "+O0 +d -g",
release => "+O2")),
- cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
+ cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
ex_libs => add("-ldl",threads("-lpthread")),
bn_ops => "SIXTY_FOUR_BIT",
thread_scheme => "pthreads",
cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z",
debug => "+O0 +d -g",
release => "+O3")),
- cppflags => combine("-DB_DEBIAN", threads("-D_REENTRANT")),
+ cppflags => combine("-DB_ENDIAN", threads("-D_REENTRANT")),
ex_libs => add("-ldl", threads("-lpthread")),
bn_ops => "SIXTY_FOUR_BIT_LONG",
thread_scheme => "pthreads",
cflags => combine(picker(debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
- cppflags => "-DB_DEBIAN",
+ cppflags => "-DB_ENDIAN",
ex_libs => add("-ldl", threads("-pthread")),
bn_ops => "SIXTY_FOUR_BIT",
thread_scheme => "pthreads",
debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
- cppflags => "-DB_DEBIAN",
+ cppflags => "-DB_ENDIAN",
ex_libs => add("-ldl", threads("-pthread")),
bn_ops => "SIXTY_FOUR_BIT_LONG",
thread_scheme => "pthreads",
cc => "gcc",
cflags => "-O3",
cppflags => "-D_ENDIAN -DBN_DIV2W -D_POSIX_SOURCE -D_SOCKET_SOURCE",
- includes => [ "/SYSLOG/PUB" ],
+ includes => add("/SYSLOG/PUB"),
sys_id => "MPE",
lflags => add("-L/SYSLOG/PUB"),
ex_libs => add("-lsyslog -lsocket -lcurses"),
debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
+ cxxflags => combine(picker(default => "-std=c++11 -Wall",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
cppflags => "-DOPENSSL_USE_NODELETE",
ex_libs => add("-ldl", threads("-pthread")),
bn_ops => "BN_LLONG RC4_CHAR",
inherit_from => [ "BASE_Windows" ],
template => 1,
cc => "cl",
+ cpp => '$(CC) /EP /C',
cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo",
defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
"L_ENDIAN", "_CRT_SECURE_NO_DEPRECATE",
"NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT" ],
debug => [ "DEBUG", "_DEBUG" ]),
includes =>
- combine(sub { defined(env('WCECOMPAT'))
- ? '$(WCECOMPAT)/include' : (); },
- sub { defined(env('PORTSDK_LIBPATH'))
- ? '$(PORTSDK_LIBPATH)/../../include' : (); }),
+ add(combine(sub { defined(env('WCECOMPAT'))
+ ? '$(WCECOMPAT)/include' : (); },
+ sub { defined(env('PORTSDK_LIBPATH'))
+ ? '$(PORTSDK_LIBPATH)/../../include'
+ : (); })),
lflags => add(combine("/nologo /opt:ref",
sub { vc_wince_info()->{lflags}; },
sub { defined(env('PORTSDK_LIBPATH'))
},
##### VMS
+ # Most things happen in vms-generic.
+ # Note that vms_info extracts the pointer size from the end of
+ # the target name, and will assume that anything matching /-p\d+$/
+ # indicates the pointer size setting for the desired target.
"vms-generic" => {
inherit_from => [ "BASE_VMS" ],
template => 1,
cc => "CC/DECC",
- cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
- debug => "/NOOPTIMIZE/DEBUG",
- release => "/OPTIMIZE/NODEBUG"),
- defines => add("OPENSSL_USE_NODELETE"),
+ cpp => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
+ cflags =>
+ combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
+ debug => "/NOOPTIMIZE/DEBUG",
+ release => "/OPTIMIZE/NODEBUG"),
+ sub { my @warnings =
+ @{vms_info()->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
+ defines =>
+ add("OPENSSL_USE_NODELETE",
+ sub {
+ return vms_info()->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
+ }),
lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
debug => "/DEBUG/TRACEBACK",
release => "/NODEBUG/NOTRACEBACK"),
# no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
# for object files belonging to selected internal libraries
no_inst_lib_cflags => "",
+ ex_libs => add(sub { return vms_info()->{zlib} || (); }),
shared_target => "vms-shared",
dso_scheme => "vms",
thread_scheme => "pthreads",
- apps_aux_src => "vms_decc_init.c vms_term_sock.c",
+ apps_aux_src => "vms_term_sock.c",
+ apps_init_src => "vms_decc_init.c",
},
+ # From HELP CC/POINTER_SIZE:
+ #
+ # ----------
+ # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
+ # LONG or 64 is present, the main argument argv will be an
+ # array of long pointers instead of an array of short pointers.
+ #
+ # 64[=ARGV] Same as LONG.
+ # ----------
+ #
+ # We don't want the hassle of dealing with 32-bit pointers with argv, so
+ # we force it to have 64-bit pointers, see the added cflags in the -p64
+ # config targets below.
+
"vms-alpha" => {
inherit_from => [ "vms-generic" ],
- cflags => add(sub { my @warnings =
- @{vms_info(0)->{disable_warns}};
- @warnings
- ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
- defines =>
- add(sub {
- return vms_info(0)->{def_zlib}
- ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
- }),
- ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
- pointer_size => sub { return vms_info(0)->{pointer_size} },
- #as => "???",
- #debug_aflags => "/NOOPTIMIZE/DEBUG",
- #release_aflags => "/OPTIMIZE/NODEBUG",
- bn_opts => "SIXTY_FOUR_BIT RC4_INT",
+ bn_ops => "SIXTY_FOUR_BIT RC4_INT",
+ pointer_size => "",
},
"vms-alpha-p32" => {
- inherit_from => [ "vms-generic" ],
- cflags =>
- add("/POINTER_SIZE=32",
- sub { my @warnings =
- @{vms_info(32)->{disable_warns}};
- @warnings
- ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
- } ),
- defines =>
- add(sub {
- return vms_info(32)->{def_zlib}
- ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
- }),
- ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
- pointer_size => sub { return vms_info(32)->{pointer_size} },
+ inherit_from => [ "vms-alpha" ],
+ cflags => add("/POINTER_SIZE=32"),
+ pointer_size => "32",
},
"vms-alpha-p64" => {
- inherit_from => [ "vms-generic" ],
- cflags =>
- add("/POINTER_SIZE=64=ARGV",
- sub { my @warnings =
- @{vms_info(64)->{disable_warns}};
- @warnings
- ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
- } ),
- defines =>
- add(sub {
- return vms_info(64)->{def_zlib}
- ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
- }),
- ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
- pointer_size => sub { return vms_info(64)->{pointer_size} },
+ inherit_from => [ "vms-alpha" ],
+ cflags => add("/POINTER_SIZE=64=ARGV"),
+ pointer_size => "64",
},
"vms-ia64" => {
inherit_from => [ "vms-generic" ],
- cflags => add(sub { my @warnings =
- @{vms_info(0)->{disable_warns}};
- @warnings
- ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
- defines =>
- add(sub {
- return vms_info(0)->{def_zlib}
- ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
- }),
- ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
- pointer_size => sub { return vms_info(0)->{pointer_size} },
- #as => "I4S",
- #debug_aflags => "/NOOPTIMIZE/DEBUG",
- #release_aflags => "/OPTIMIZE/NODEBUG",
- bn_opts => "SIXTY_FOUR_BIT RC4_INT",
+ bn_ops => "SIXTY_FOUR_BIT RC4_INT",
+ pointer_size => "",
},
"vms-ia64-p32" => {
- inherit_from => [ "vms-generic" ],
- cflags =>
- add("/POINTER_SIZE=32",
- sub { my @warnings =
- @{vms_info(32)->{disable_warns}};
- @warnings
- ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
- } ),
- defines =>
- add(sub {
- return vms_info(32)->{def_zlib}
- ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
- }),
- ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
- pointer_size => sub { return vms_info(32)->{pointer_size} },
+ inherit_from => [ "vms-ia64" ],
+ cflags => add("/POINTER_SIZE=32"),
+ pointer_size => "32",
},
"vms-ia64-p64" => {
- inherit_from => [ "vms-generic" ],
- cflags =>
- add("/POINTER_SIZE=64=ARGV",
- sub { my @warnings =
- @{vms_info(64)->{disable_warns}};
- @warnings
- ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
- } ),
- defines =>
- add(sub {
- return vms_info(64)->{def_zlib}
- ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
- }),
- ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
- pointer_size => sub { return vms_info(64)->{pointer_size} },
+ inherit_from => [ "vms-ia64" ],
+ cflags => add("/POINTER_SIZE=64=ARGV"),
+ pointer_size => "64",
},
);