Fix bug 927073 - Binary compatibility broken for maintenance releases due to strict version-script. r=glandium

This commit is contained in:
Philipp Kewisch 2013-10-29 21:48:28 +01:00
parent fcf26b0e90
commit 4d8ce17a99
8 changed files with 62 additions and 6 deletions

View File

@ -138,6 +138,25 @@ sub getMilestoneAB {
return "final";
}
#
# Usage: getMilestoneABWithNum($milestoneFile)
# Returns the alpha and beta tag with its number (a1, a2, b3, ...)
#
sub getMilestoneABWithNum {
my $milestoneABNum;
if (defined($Moz::Milestone::milestone)) {
$milestoneABNum = $Moz::Milestone::milestone;
} else {
$milestoneABNum = $_[0];
}
if ($milestoneABNum =~ /([ab]\d+)/) {
return $1;
} else {
return "";
}
}
#
# build_file($template_file,$output_file)
#

View File

@ -21,6 +21,7 @@ use vars qw(
$opt_debug
$opt_template
$opt_uaversion
$opt_symbolversion
$opt_help
);
@ -30,7 +31,7 @@ push(@INC,$SCRIPTDIR);
require "Moz/Milestone.pm";
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion', 'symbolversion');
if (defined($opt_help)) {
&usage();
@ -75,13 +76,19 @@ if (@TEMPLATE_FILE) {
# (bugs 572659 and 870868).
my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . ".0";
print "$uaversion\n";
} elsif(defined($opt_symbolversion)) {
# Only expose major milestone and alpha version. Used for symbol versioning
# on Linux.
my $symbolversion = Moz::Milestone::getMilestoneMajor($milestone) .
Moz::Milestone::getMilestoneABWithNum($milestone);
print "$symbolversion\n";
} else {
print "$milestone\n";
}
sub usage() {
print <<END
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion` # will build file list from .tmpl files
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion --symbolversion` # will build file list from .tmpl files
END
;
}

View File

@ -1748,6 +1748,7 @@ fi
dnl Get mozilla version from central milestone file
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion`
dnl Get version of various core apps from the version files.
FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
@ -1759,6 +1760,7 @@ fi
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
AC_DEFINE_UNQUOTED(MOZILLA_SYMBOLVERSION,"$MOZILLA_SYMBOLVERSION")
MOZ_DOING_LTO(lto_is_enabled)

View File

@ -138,6 +138,25 @@ sub getMilestoneAB {
return "final";
}
#
# Usage: getMilestoneABWithNum($milestoneFile)
# Returns the alpha and beta tag with its number (a1, a2, b3, ...)
#
sub getMilestoneABWithNum {
my $milestoneABNum;
if (defined($Moz::Milestone::milestone)) {
$milestoneABNum = $Moz::Milestone::milestone;
} else {
$milestoneABNum = $_[0];
}
if ($milestoneABNum =~ /([ab]\d+)/) {
return $1;
} else {
return "";
}
}
#
# build_file($template_file,$output_file)
#

View File

@ -21,6 +21,7 @@ use vars qw(
$opt_debug
$opt_template
$opt_uaversion
$opt_symbolversion
$opt_help
);
@ -30,7 +31,7 @@ push(@INC,$SCRIPTDIR);
require "Moz/Milestone.pm";
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion', 'symbolversion');
if (defined($opt_help)) {
&usage();
@ -75,13 +76,19 @@ if (@TEMPLATE_FILE) {
# (bugs 572659 and 870868).
my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . ".0";
print "$uaversion\n";
} elsif(defined($opt_symbolversion)) {
# Only expose major milestone and alpha version. Used for symbol versioning
# on Linux.
my $symbolversion = Moz::Milestone::getMilestoneMajor($milestone) .
Moz::Milestone::getMilestoneABWithNum($milestone);
print "$symbolversion\n";
} else {
print "$milestone\n";
}
sub usage() {
print <<END
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion` # will build file list from .tmpl files
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion --symbolversion` # will build file list from .tmpl files
END
;
}

View File

@ -235,10 +235,12 @@ dnl Get mozilla version from central milestone file
dnl ==============================================================
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion`
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
AC_DEFINE_UNQUOTED(MOZILLA_SYMBOLVERSION,"$MOZILLA_SYMBOLVERSION")
# Separate version into components for use in shared object naming etc
changequote(,)

View File

@ -21,7 +21,7 @@ TEST_DIRS += ['jsapi-tests', 'tests', 'gdb']
MODULE = 'js'
if CONFIG['JS_STANDALONE']:
LIBRARY_NAME = 'mozjs-%s.%s%s' % (CONFIG['MOZJS_MAJOR_VERSION'], CONFIG['MOZJS_MINOR_VERSION'], CONFIG['MOZJS_ALPHA'])
LIBRARY_NAME = 'mozjs-%s' % CONFIG['MOZILLA_SYMBOLVERSION']
else:
LIBRARY_NAME = 'mozjs'

View File

@ -121,7 +121,7 @@ EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript
symverscript: symverscript.in
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
-DVERSION="$(LIBRARY_NAME)$(MOZILLA_VERSION)" $< > $@
-DVERSION="$(LIBRARY_NAME)$(MOZILLA_SYMBOLVERSION)" $< > $@
EXTRA_DEPS += symverscript
endif