summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-11 13:46:41 +0900
committerNorbert Preining <norbert@preining.info>2020-04-25 22:43:43 +0900
commit9b35a913dd8d865721e66310498da41653f5af7e (patch)
tree45c839a3ccf2505ffdb12011458898f3b860efa1 /Master/tlpkg/TeXLive/TLUtils.pm
parent803980524c9abc5919a821b170590ea0e1d11650 (diff)
work on win64 support
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm50
1 files changed, 46 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index ab1f6c99ddc..755500182f8 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -25,6 +25,8 @@ C<TeXLive::TLUtils> - utilities used in TeX Live infrastructure
TeXLive::TLUtils::platform();
TeXLive::TLUtils::platform_name($canonical_host);
TeXLive::TLUtils::platform_desc($platform);
+ TeXLive::TLUtils::win32_32();
+ TeXLive::TLUtils::win32_64();
TeXLive::TLUtils::win32();
TeXLive::TLUtils::unix();
@@ -219,7 +221,7 @@ BEGIN {
@EXPORT = qw(setup_programs download_file process_logging_options
tldie tlwarn info log debug ddebug dddebug debug
debug_hash_str debug_hash
- win32 xchdir xsystem run_cmd system_pipe sort_archs);
+ win32 win32_32 win32_64 xchdir xsystem run_cmd system_pipe sort_archs);
}
use Cwd;
@@ -253,6 +255,7 @@ sub platform {
unless (defined $::_platform_) {
if ($^O =~ /^MSWin/i) {
$::_platform_ = "win32";
+ # TODO make sure we check how to detect win64!!!
} else {
my $config_guess = "$::installerdir/tlpkg/installer/config.guess";
@@ -425,7 +428,8 @@ sub platform_desc {
'sparc-linux' => 'GNU/Linux on Sparc',
'sparc-solaris' => 'Solaris on Sparc',
'universal-darwin' => 'MacOSX universal binaries',
- 'win32' => 'Windows',
+ 'win32' => 'Windows 32bit',
+ 'win64' => 'Windows 64bit',
'x86_64-cygwin' => 'Cygwin on x86_64',
'x86_64-darwin' => 'MacOSX current (10.13-) on x86_64',
'x86_64-darwinlegacy' => 'MacOSX legacy (10.6-) on x86_64',
@@ -448,9 +452,44 @@ sub platform_desc {
}
+=item C<win32_32>
+
+Return C<1> if platform is Windows32 and C<0> otherwise. The test is
+currently based on the value of Perl's C<$^O> variable.
+
+=cut
+
+sub win32_32 {
+ if ($^O =~ /^MSWin/i) {
+ # TODO check 32bit
+ return 1;
+ } else {
+ return 0;
+ }
+ # the following needs config.guess, which is quite bad ...
+ # return (&platform eq "win32")? 1:0;
+}
+=item C<win32_64>
+
+Return C<1> if platform is Windows64 and C<0> otherwise. The test is
+currently based on the value of Perl's C<$^O> variable.
+
+=cut
+
+sub win32_64 {
+ if ($^O =~ /^MSWin/i) {
+ # TODO check 64bit
+ return 1;
+ } else {
+ return 0;
+ }
+ # the following needs config.guess, which is quite bad ...
+ # return (&platform eq "win32")? 1:0;
+}
+
=item C<win32>
-Return C<1> if platform is Windows and C<0> otherwise. The test is
+Return C<1> if platform is Windows32 or 64 and C<0> otherwise. The test is
currently based on the value of Perl's C<$^O> variable.
=cut
@@ -466,6 +505,9 @@ sub win32 {
}
+
+
+
=item C<unix>
Return C<1> if platform is UNIX and C<0> otherwise.
@@ -473,7 +515,7 @@ Return C<1> if platform is UNIX and C<0> otherwise.
=cut
sub unix {
- return (&platform eq "win32")? 0:1;
+ return (&platform eq "win32" || &platform eq "win64" )? 0:1;
}