--- a/open-src/common/Makefile.inc Fri Aug 06 14:38:17 2010 -0700
+++ b/open-src/common/Makefile.inc Fri Aug 06 14:40:21 2010 -0700
@@ -631,9 +631,12 @@
$(BUILD_DEBUG:yes=$(POUND_SIGN)) DEBUG_ELF_COMMENTS=
ELF_COMMENTS += $(DEBUG_ELF_COMMENTS)
+ELF_COMMENTS_FLAGS = -B 'hg id' -M '$(ELF_COMMENTS)'
+ELF_COMMENTS_FLAGS += $(MODTYPE_ELF_COMMENTS_FLAGS) $(MODULE_ELF_COMMENTS_FLAGS)
+
set-elf-comments: $(BUILD_TARGETS:set-elf-comments=)
- $(TOP)/open-src/common/set-elf-comments.pl -B 'hg id' \
- -M '$(ELF_COMMENTS)' $(SOURCE_DIR)
+ $(TOP)/open-src/common/set-elf-comments.pl $(ELF_COMMENTS_FLAGS) \
+ $(SOURCE_DIR)
# Help generate templates for package manifests
DEFAULT_LICENSE=$(PKG_LICENSE_DIR)/cr_Oracle $(PKG_LICENSE_DIR)/lic_X11
--- a/open-src/common/set-elf-comments.pl Fri Aug 06 14:38:17 2010 -0700
+++ b/open-src/common/set-elf-comments.pl Fri Aug 06 14:40:21 2010 -0700
@@ -26,13 +26,17 @@
#
# Set version information in ELF files to give hints to help in troubleshooting
#
-# Usage: set-elf-comments.pl -B <pkgversion> -M "module version" <path>
+# Usage: set-elf-comments.pl [-B <pkgversion>] -M "module version" \
+# [-X <exclude regexp>] <path>
+#
# <pkgversion> may either be a path to a file containing BUILD="<version>"
# or the string "hg id" to get the version from the hg id output.
#
# If the XBUILD_HG_ID environment variable is set, it is used for the hg id
# instead of forking a hg id process for every component in a full tree build
#
+# If -X is specified, it gives a regular expresion for filenames to skip
+# for this module.
use strict;
use warnings;
@@ -40,8 +44,10 @@
use POSIX qw(strftime);
use File::Find;
+$Getopt::Std::STANDARD_HELP_VERSION = 1;
+
my %opts;
-getopts('B:M:', \%opts);
+getopts('B:M:X:', \%opts);
my $module_version_info = '@(#)';
if (exists($opts{'M'})) {
@@ -50,6 +56,11 @@
die qq(Must specify -M "module version");
}
+my $exclude_regexp;
+if (exists($opts{'X'})) {
+ $exclude_regexp = $opts{'X'};
+}
+
my $build_info = strftime("%e %b %Y", localtime);
if (exists($opts{'B'})) {
@@ -100,8 +111,13 @@
# skip sources & intermediate build files that we don't ship
return if $_ =~ m/\.[acho]$/ims;
- # skip the *.uc files used by xf86-video-rendition for firmware
- return if $_ =~ m/\.uc$/ms;
+ # skip files matching specified regexp
+ if (defined $exclude_regexp) {
+ if ($_ =~ m{$exclude_regexp}so) {
+ print "Excluding $_\n";
+ return;
+ }
+ }
# If the file is not a symlink, is a regular file, and is at least 256 bytes
if ((! -l $_) && (-f _) && (-s _ > 256)) {
--- a/open-src/driver/xf86-video-rendition/Makefile Fri Aug 06 14:38:17 2010 -0700
+++ b/open-src/driver/xf86-video-rendition/Makefile Fri Aug 06 14:40:21 2010 -0700
@@ -57,6 +57,10 @@
# Additional install rules beyond what upstream installs
MODULE_ADD_INSTALL_TARGETS=install_docs
+# Don't touch the firmware blobs when setting elf comments, even though
+# they look like ELF files
+MODULE_ELF_COMMENTS_FLAGS = -X '\.uc$$'
+
include ../Makefile.inc
install_docs: $(INSTALL_DEPS)
--- a/open-src/lib/freetype/Makefile Fri Aug 06 14:38:17 2010 -0700
+++ b/open-src/lib/freetype/Makefile Fri Aug 06 14:40:21 2010 -0700
@@ -129,6 +129,10 @@
MODULE_INSTALL_MAKEFLAGS=bindir=$(MODULE_PREFIX)/bin$(ARCHLIBSUBDIR)
+# Don't touch apinames when running set-elf-comments or it will trigger
+# a rebuild during "make install" that loses the comments.
+MODULE_ELF_COMMENTS_FLAGS = -X apinames
+
### Include common rulesets
include ../Makefile.inc