Skip to content

Commit

Permalink
BaseTools: Make brotli a submodule
Browse files Browse the repository at this point in the history
Use submodule way to access brotli in BaseTools based on
brotli version 666c328.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2558

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
  • Loading branch information
shenglei10 authored and mergify[bot] committed Apr 16, 2020
1 parent 58802e0 commit 06033f5
Show file tree
Hide file tree
Showing 92 changed files with 61 additions and 35,214 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli"]
path = MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
url = https://github.com/google/brotli
[submodule "BaseTools/Source/C/BrotliCompress/brotli"]
path = BaseTools/Source/C/BrotliCompress/brotli
url = https://github.com/google/brotli
2 changes: 2 additions & 0 deletions .pytool/CISettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def GetRequiredSubmodules(self):
"MdeModulePkg/Universal/RegularExpressionDxe/oniguruma", False))
rs.append(RequiredSubmodule(
"MdeModulePkg/Library/BrotliCustomDecompressLib/brotli", False))
rs.append(RequiredSubmodule(
"BaseTools/Source/C/BrotliCompress/brotli", False))
return rs

def GetName(self):
Expand Down
54 changes: 27 additions & 27 deletions BaseTools/Source/C/BrotliCompress/GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
## @file
# GNU/Linux makefile for 'Brotli' module build.
#
# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
MAKEROOT ?= ..

APPNAME = Brotli

OBJECTS = \
tools/brotli.o \
common/dictionary.o \
common/transform.o \
dec/bit_reader.o \
dec/decode.o \
dec/huffman.o \
dec/state.o \
enc/backward_references.o \
enc/backward_references_hq.o \
enc/bit_cost.o \
enc/block_splitter.o \
enc/brotli_bit_stream.o \
enc/cluster.o \
enc/compress_fragment.o \
enc/compress_fragment_two_pass.o \
enc/dictionary_hash.o \
enc/encode.o \
enc/encoder_dict.o \
enc/entropy_encode.o \
enc/histogram.o \
enc/literal_cost.o \
enc/memory.o \
enc/metablock.o \
enc/static_dict.o \
enc/utf8_util.o
brotli/c/tools/brotli.o \
brotli/c/common/dictionary.o \
brotli/c/common/transform.o \
brotli/c/dec/bit_reader.o \
brotli/c/dec/decode.o \
brotli/c/dec/huffman.o \
brotli/c/dec/state.o \
brotli/c/enc/backward_references.o \
brotli/c/enc/backward_references_hq.o \
brotli/c/enc/bit_cost.o \
brotli/c/enc/block_splitter.o \
brotli/c/enc/brotli_bit_stream.o \
brotli/c/enc/cluster.o \
brotli/c/enc/compress_fragment.o \
brotli/c/enc/compress_fragment_two_pass.o \
brotli/c/enc/dictionary_hash.o \
brotli/c/enc/encode.o \
brotli/c/enc/encoder_dict.o \
brotli/c/enc/entropy_encode.o \
brotli/c/enc/histogram.o \
brotli/c/enc/literal_cost.o \
brotli/c/enc/memory.o \
brotli/c/enc/metablock.o \
brotli/c/enc/static_dict.o \
brotli/c/enc/utf8_util.o

include $(MAKEROOT)/Makefiles/app.makefile

TOOL_INCLUDE = -I ./include
TOOL_INCLUDE = -I ./brotli/c/include
LIBS += -lm
19 changes: 0 additions & 19 deletions BaseTools/Source/C/BrotliCompress/LICENSE

This file was deleted.

52 changes: 26 additions & 26 deletions BaseTools/Source/C/BrotliCompress/Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
## @file
# Windows makefile for 'Brotli' module build.
#
# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
!INCLUDE ..\Makefiles\ms.common

INC = -I .\include $(INC)
INC = -I .\brotli\c\include $(INC)
CFLAGS = $(CFLAGS) /W2

APPNAME = Brotli

#LIBS = $(LIB_PATH)\Common.lib

COMMON_OBJ = common\dictionary.obj common\transform.obj
COMMON_OBJ = brotli\c\common\dictionary.obj brotli\c\common\transform.obj
DEC_OBJ = \
dec\bit_reader.obj \
dec\decode.obj \
dec\huffman.obj \
dec\state.obj
brotli\c\dec\bit_reader.obj \
brotli\c\dec\decode.obj \
brotli\c\dec\huffman.obj \
brotli\c\dec\state.obj
ENC_OBJ = \
enc\backward_references.obj \
enc\backward_references_hq.obj \
enc\bit_cost.obj \
enc\block_splitter.obj \
enc\brotli_bit_stream.obj \
enc\cluster.obj \
enc\compress_fragment.obj \
enc\compress_fragment_two_pass.obj \
enc\dictionary_hash.obj \
enc\encode.obj \
enc\encoder_dict.obj \
enc\entropy_encode.obj \
enc\histogram.obj \
enc\literal_cost.obj \
enc\memory.obj \
enc\metablock.obj \
enc\static_dict.obj \
enc\utf8_util.obj
brotli\c\enc\backward_references.obj \
brotli\c\enc\backward_references_hq.obj \
brotli\c\enc\bit_cost.obj \
brotli\c\enc\block_splitter.obj \
brotli\c\enc\brotli_bit_stream.obj \
brotli\c\enc\cluster.obj \
brotli\c\enc\compress_fragment.obj \
brotli\c\enc\compress_fragment_two_pass.obj \
brotli\c\enc\dictionary_hash.obj \
brotli\c\enc\encode.obj \
brotli\c\enc\encoder_dict.obj \
brotli\c\enc\entropy_encode.obj \
brotli\c\enc\histogram.obj \
brotli\c\enc\literal_cost.obj \
brotli\c\enc\memory.obj \
brotli\c\enc\metablock.obj \
brotli\c\enc\static_dict.obj \
brotli\c\enc\utf8_util.obj

OBJECTS = \
tools\brotli.obj \
brotli\c\tools\brotli.obj \
$(COMMON_OBJ) \
$(DEC_OBJ) \
$(ENC_OBJ)
Expand Down
26 changes: 0 additions & 26 deletions BaseTools/Source/C/BrotliCompress/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions BaseTools/Source/C/BrotliCompress/ReadMe.txt

This file was deleted.

1 change: 1 addition & 0 deletions BaseTools/Source/C/BrotliCompress/brotli
Submodule brotli added at 666c32
64 changes: 0 additions & 64 deletions BaseTools/Source/C/BrotliCompress/common/constants.h

This file was deleted.

1 comment on commit 06033f5

@osresearch
Copy link
Contributor

@osresearch osresearch commented on 06033f5 Nov 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the release trees since the submodule is not included in the tar file. edk2-stable202008/BaseTools/Source/C/BrotliCompress/brotli/ is an empty directory, so a clean build fails:

make -C BaseTools/
make: Entering directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools'
make -C Source/C
make[1]: Entering directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools/Source/C'
Attempting to detect HOST_ARCH from 'uname -m': x86_64
Detected HOST_ARCH of X64 using uname.
mkdir -p .
make -C Common
make[2]: Entering directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools/Source/C/Common'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools/Source/C/Common'
make -C BrotliCompress
make[2]: Entering directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools/Source/C/BrotliCompress'
gcc -o ../bin/Brotli   brotli/c/tools/brotli.o brotli/c/common/dictionary.o brotli/c/common/transform.o brotli/c/dec/bit_reader.o brotli/c/dec/decode.o brotli/c/dec/huffman.o brotli/c/dec/state.o brotli/c/enc/backward_references.o brotli/c/enc/backward_references_hq.o brotli/c/enc/bit_cost.o brotli/c/enc/block_splitter.o brotli/c/enc/brotli_bit_stream.o brotli/c/enc/cluster.o brotli/c/enc/compress_fragment.o brotli/c/enc/compress_fragment_two_pass.o brotli/c/enc/dictionary_hash.o brotli/c/enc/encode.o brotli/c/enc/encoder_dict.o brotli/c/enc/entropy_encode.o brotli/c/enc/histogram.o brotli/c/enc/literal_cost.o brotli/c/enc/memory.o brotli/c/enc/metablock.o brotli/c/enc/static_dict.o brotli/c/enc/utf8_util.o -L../libs -lm
gcc: error: brotli/c/tools/brotli.o: No such file or directory
gcc: error: brotli/c/common/dictionary.o: No such file or directory
gcc: error: brotli/c/common/transform.o: No such file or directory
gcc: error: brotli/c/dec/bit_reader.o: No such file or directory
gcc: error: brotli/c/dec/decode.o: No such file or directory
gcc: error: brotli/c/dec/huffman.o: No such file or directory
gcc: error: brotli/c/dec/state.o: No such file or directory
gcc: error: brotli/c/enc/backward_references.o: No such file or directory
gcc: error: brotli/c/enc/backward_references_hq.o: No such file or directory
gcc: error: brotli/c/enc/bit_cost.o: No such file or directory
gcc: error: brotli/c/enc/block_splitter.o: No such file or directory
gcc: error: brotli/c/enc/brotli_bit_stream.o: No such file or directory
gcc: error: brotli/c/enc/cluster.o: No such file or directory
gcc: error: brotli/c/enc/compress_fragment.o: No such file or directory
gcc: error: brotli/c/enc/compress_fragment_two_pass.o: No such file or directory
gcc: error: brotli/c/enc/dictionary_hash.o: No such file or directory
gcc: error: brotli/c/enc/encode.o: No such file or directory
gcc: error: brotli/c/enc/encoder_dict.o: No such file or directory
gcc: error: brotli/c/enc/entropy_encode.o: No such file or directory
gcc: error: brotli/c/enc/histogram.o: No such file or directory
gcc: error: brotli/c/enc/literal_cost.o: No such file or directory
gcc: error: brotli/c/enc/memory.o: No such file or directory
gcc: error: brotli/c/enc/metablock.o: No such file or directory
gcc: error: brotli/c/enc/static_dict.o: No such file or directory
gcc: error: brotli/c/enc/utf8_util.o: No such file or directory
../Makefiles/app.makefile:18: recipe for target '../bin/Brotli' failed
make[2]: *** [../bin/Brotli] Error 1
make[2]: Leaving directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools/Source/C/BrotliCompress'
GNUmakefile:74: recipe for target 'BrotliCompress' failed
make[1]: *** [BrotliCompress] Error 2
make[1]: Leaving directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools/Source/C'
GNUmakefile:19: recipe for target 'Source/C' failed
make: *** [Source/C] Error 2
make: Leaving directory '/home/hudson/heads/safeboot/build/edk2-stable202008/BaseTools'

Please sign in to comment.