summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-17 12:17:15 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-03-17 12:17:15 +0000
commitf9db3b35171fe2e4b9caf2389b311e23769ec4e4 (patch)
treece9d8e816d92d432621143ec4d7bc480cc1bd6e3 /Build
parent3dc31d2d22a09c9391f876e4ae7f8bf6b8cc3b7c (diff)
biber: TeX Live platform names
git-svn-id: svn://tug.org/texlive/trunk@21746 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/utils/biber/ChangeLog7
-rw-r--r--Build/source/utils/biber/TeXLive/TLConfig.pm1
-rw-r--r--Build/source/utils/biber/TeXLive/TLUtils.pm56
-rw-r--r--Build/source/utils/biber/configure.ac4
-rw-r--r--Build/source/utils/biber/m4/kpse-tl-platform.m46
5 files changed, 44 insertions, 30 deletions
diff --git a/Build/source/utils/biber/ChangeLog b/Build/source/utils/biber/ChangeLog
index 51590a05fcc..a7dfa102e06 100644
--- a/Build/source/utils/biber/ChangeLog
+++ b/Build/source/utils/biber/ChangeLog
@@ -1,3 +1,10 @@
+2011-03-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ac: new directory, required for the TeX Live build system.
+ * Makefile.am, configure.ac: Drop TL_HAVE_BIBER_BINARY.
+ * configure.ac, m4/kpse-tl-platform.m4, TeXLive/*.pm:
+ New strategy to determine TeX Live platform names.
+
2011-03-16 Karl Berry <karl@tug.org>
* configure.ac (BIBER_EXE): AC_SUBST this, after detecting it.
diff --git a/Build/source/utils/biber/TeXLive/TLConfig.pm b/Build/source/utils/biber/TeXLive/TLConfig.pm
index ea19ecf7ad3..57f2181738f 100644
--- a/Build/source/utils/biber/TeXLive/TLConfig.pm
+++ b/Build/source/utils/biber/TeXLive/TLConfig.pm
@@ -1,3 +1,2 @@
package TeXLive::TLConfig;
-our $Config_Guess_Dir = "$ENV{ac_aux_dir}";
1;
diff --git a/Build/source/utils/biber/TeXLive/TLUtils.pm b/Build/source/utils/biber/TeXLive/TLUtils.pm
index e88f0c51529..f8d921dea14 100644
--- a/Build/source/utils/biber/TeXLive/TLUtils.pm
+++ b/Build/source/utils/biber/TeXLive/TLUtils.pm
@@ -30,6 +30,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure
=head2 Platform Detection
TeXLive::TLUtils::platform();
+ TeXLive::TLUtils::platform_name($canonical_host);
TeXLive::TLUtils::platform_desc($platform);
TeXLive::TLUtils::win32();
TeXLive::TLUtils::unix();
@@ -122,6 +123,7 @@ BEGIN {
@ISA = qw(Exporter);
@EXPORT_OK = qw(
&platform
+ &platform_name
&platform_desc
&unix
&getenv
@@ -202,19 +204,8 @@ $::opt_verbosity = 0; # see process_logging_options
If C<$^O=~/MSWin(32|64)$/i> is true we know that we're on
Windows and we set the global variable C<$::_platform_> to C<win32>.
-Otherwise we call C<config.guess>. The output of C<config.guess>
-is filtered as described below.
-
-CPU type is determined by a regexp, and any C</^i.86/> name is replaced
-by C<i386>.
-
-For OS we need a list because what's returned is not likely to match our
-historical names, e.g., C<config.guess> returns C<linux-gnu> but we need
-C<linux>. This list might/should contain OSs which are not currently
-supported.
-
-If a particular platform is not found in this list we use the regexp
-C</.*-(.*$)/> as a last resort and hope it provides something useful.
+Otherwise we call C<platform_name> with the output of C<config.guess>
+as argument.
The result is stored in a global variable C<$::_platform_>, and
subsequent calls just return that value.
@@ -226,10 +217,7 @@ sub platform {
if ($^O =~ /^MSWin/i) {
$::_platform_ = "win32";
} else {
- # the copy of this file in biber uses a different config.guess dir.
- my $config_guess_dir = $TeXLive::TLConfig::Config_Guess_Dir
- || "$::installerdir/tlpkg/installer";
- my $config_guess = "$config_guess_dir/config.guess";
+ my $config_guess = "$::installerdir/tlpkg/installer/config.guess";
# We cannot rely on #! in config.guess but have to call /bin/sh
# explicitly because sometimes the 'noexec' flag is set in
@@ -240,6 +228,34 @@ sub platform {
die "$0: could not run $config_guess, cannot proceed, sorry"
if ! $guessed_platform;
+ $::_platform_ = platform_name($guessed_platform);
+ }
+ }
+ return $::_platform_;
+}
+
+
+=item C<platform_name($canonical_host)>
+
+Convert a canonical host names as returned by C<config.guess> into
+TeX Live platform names.
+
+CPU type is determined by a regexp, and any C</^i.86/> name is replaced
+by C<i386>.
+
+For OS we need a list because what's returned is not likely to match our
+historical names, e.g., C<config.guess> returns C<linux-gnu> but we need
+C<linux>. This list might/should contain OSs which are not currently
+supported.
+
+If a particular platform is not found in this list we use the regexp
+C</.*-(.*$)/> as a last resort and hope it provides something useful.
+
+=cut
+
+sub platform_name {
+ my ($guessed_platform) = @_;
+
$guessed_platform =~ s/^x86_64-(.*-k?)freebsd/amd64-$1freebsd/;
my $CPU; # CPU type as reported by config.guess.
my $OS; # O/S type as reported by config.guess.
@@ -269,13 +285,9 @@ sub platform {
($OS = $guessed_platform) =~ s/.*-(.*)/$1/;
}
- $::_platform_ = "$CPU-$OS";
- }
- }
- return $::_platform_;
+ return "$CPU-$OS";
}
-
=item C<platform_desc($platform)>
Return a string which describes a particular platform identifier, e.g.,
diff --git a/Build/source/utils/biber/configure.ac b/Build/source/utils/biber/configure.ac
index ece78c94e49..3848cd95828 100644
--- a/Build/source/utils/biber/configure.ac
+++ b/Build/source/utils/biber/configure.ac
@@ -19,10 +19,10 @@ dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_MAKE_SET
-dnl Determine the TeX Live platform name (not yet, just prepare)
+dnl Determine the TeX Live platform name.
KPSE_TL_PLATFORM
-dnl Check if we have an executable for the current platform.
+dnl Check if we have an executable for this platform.
AC_MSG_CHECKING([for a biber binary])
biber_bin="bin/$TL_PLATFORM/biber"
if test -r "$srcdir/$biber_bin"; then
diff --git a/Build/source/utils/biber/m4/kpse-tl-platform.m4 b/Build/source/utils/biber/m4/kpse-tl-platform.m4
index f822807f7b4..445e6c88ad5 100644
--- a/Build/source/utils/biber/m4/kpse-tl-platform.m4
+++ b/Build/source/utils/biber/m4/kpse-tl-platform.m4
@@ -16,12 +16,8 @@ AC_ARG_VAR([TL_PLATFORM], [TeX Live platform name [autodetected]])
AC_MSG_CHECKING([for TeX Live platform name])
if test "X$TL_PLATFORM" = X; then
if test "x$kpse_cv_have_win32" = xno; then
- # we need this variable in the Perl (current).
- export ac_aux_dir
- # we need this variable in the Perl (future).
- export ac_cv_host
TL_PLATFORM=`$PERL -I"$srcdir" -MTeXLive::TLUtils -e '
- print TeXLive::TLUtils::platform();'`
+ print TeXLive::TLUtils::platform_name("'"$ac_cv_host"'");'`
if test -z "$TL_PLATFORM"; then
AC_MSG_ERROR([cannot determine TeX Live platform name])
fi