Bug 1411073 - av1: Clean up duplicate filenames check. r?Build,kinetik
Check for filenames which differ only by .asm vs .c filename
extensions when importing a new version of the libaom reference
implementation of the av1 video codec.
These confuse our build system as well. Also remove the obsolete
vp8 and vp9 search directories, which generate warnings from 'find'.
MozReview-Commit-ID: DRZL7GUrsYh
--- a/media/libaom/generate_sources_mozbuild.sh
+++ b/media/libaom/generate_sources_mozbuild.sh
@@ -24,34 +24,33 @@ function write_license {
echo "# This file is generated. Do not edit." >> $1
echo "" >> $1
}
# Search for source files with the same basename.
# The build does not support duplicate file names.
function find_duplicates {
local readonly duplicate_file_names=$(find \
- $BASE_DIR/$LIBAOM_SRC_DIR/vp8 \
- $BASE_DIR/$LIBAOM_SRC_DIR/vp9 \
- $BASE_DIR/$LIBAOM_SRC_DIR/av1 \
$BASE_DIR/$LIBAOM_SRC_DIR/aom \
$BASE_DIR/$LIBAOM_SRC_DIR/aom_dsp \
- -type f -name \*.c | xargs -I {} basename {} | sort | uniq -d \
+ $BASE_DIR/$LIBAOM_SRC_DIR/av1 \
+ -type f -name \*.c -o -name \*.asm | \
+ xargs -I {} basename -s .c {} | \
+ xargs -I {} basename -s .asm {} | \
+ sort | uniq -d \
)
if [ -n "${duplicate_file_names}" ]; then
echo "ERROR: DUPLICATE FILES FOUND"
for file in ${duplicate_file_names}; do
find \
- $BASE_DIR/$LIBAOM_SRC_DIR/vp8 \
- $BASE_DIR/$LIBAOM_SRC_DIR/vp9 \
- $BASE_DIR/$LIBAOM_SRC_DIR/av1 \
$BASE_DIR/$LIBAOM_SRC_DIR/aom \
$BASE_DIR/$LIBAOM_SRC_DIR/aom_dsp \
- -name $file
+ $BASE_DIR/$LIBAOM_SRC_DIR/av1 \
+ -name $file\.*
done
exit 1
fi
}
# Generate sources.mozbuild with a list of source files.
# $1 - Array name for file list. This is processed with 'declare' below to
# regenerate the array locally.