diff options
author | Norbert Preining <preining@logic.at> | 2008-12-15 21:52:47 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-12-15 21:52:47 +0000 |
commit | 6defcf3d4c2f1bec147fcdaf8e3b104d3c6322ab (patch) | |
tree | ff9793d61d278b15c9dee88e76c8121998219801 /Master | |
parent | 1180f6c2294597692c037c8dc7aa584409b478ad (diff) |
add a first shot at a configguess sub in TLUtils.pm
git-svn-id: svn://tug.org/texlive/trunk@11623 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index d9d36ec038f..50e92e57ae8 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -157,6 +157,78 @@ the HD/CD/DVD. =cut +sub configguess { + return "win32" if ($^O=~/^MSWin(32|64)$/i); + chomp( my $umachine = `uname -m 2>/dev/null` ); + chomp( my $usystem = `uname -s 2>/dev/null` ); + # + # OpenBSD only supported on i386 + if ($usystem eq "OpenBSD") { + chomp (my $cpu = `arch`); + $cpu =~ s/OpenBSD.//; + $cpu =~ s/i.86/i386/; + return("$cpu-openbsd"); + } + # + # FreeBSD on amd64, i386 + if ($usystem eq "FreeBSD") { + if ($umachine eq "pc98") { + return "i386-freebsd"; + } elsif ($umachine eq "x86_64") { + return "amd64-freebsd"; + } else { + return "$umachine-freebsd"; + } + } + # + # Linux on alpha, i386, powerpc, sparc, x86_64 + if ($usystem eq "Linux") { + if ($umachine eq "alpha") { + return "alpha-linux"; + } elsif ($umachine =~ m/^i.86$/) { + return "i386-linux"; + } elsif ($umachine eq "x86_64") { + return "x86_64-linux"; + } elsif ($umachine eq "ppc") { + return "powerpc-linux"; + # } elsif ($umachine eq "ppc64") { + # return "powerpc64-linux"; # do we have support for that with ppc? + } elsif ($umachine =~ m/^padre|sparc$/) { + return "sparc-linux"; + } else { + return "$umachine-linux"; + } + } + # + # hpux on hppa + if ($usystem eq "HP-UX") { + if ($umachine =~ m:9000/[678][0-9][0-9]:) { + return "hppa-hpux"; # lets hope for the best, it might break! + } else { + return "$umachine-hpux"; + } + } + # + # aix on powerpc + # THAT IS A PAIN!!!!! + # + # solaris on i386, sparc + # THAT IS A PAIN!!!!! + # + # irix on mips + if ($usystem eq "IRIX") { + return "mips-irix"; + } + # + # darwin on universal + if ($usystem eq "Darwin") { + return "universal-darwin"; + } + # + # if we are still here we can still call config.guess ... ???? + # +} + sub platform { unless (defined $::_platform_) { if ($^O=~/^MSWin(32|64)$/i) { |