-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.uk
194 lines (183 loc) · 10.3 KB
/
Makefile.uk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# libxz Makefile.uk
#
# Authors: Andrei Tatar <andrei@unikraft.io>
#
# Copyright (c) 2023, Unikraft GmbH and The Unikraft Authors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
################################################################################
# Library registration
################################################################################
$(eval $(call addlib_s,libxz,$(CONFIG_LIBXZ)))
$(eval $(call addlib_s,libxz_main,$(CONFIG_LIBXZ_MAIN)))
################################################################################
# Sources
################################################################################
LIBXZ_VERSION=5.4.4
LIBXZ_URL=https://github.com/tukaani-project/xz/releases/download/v$(LIBXZ_VERSION)/xz-$(LIBXZ_VERSION).tar.xz
LIBXZ_DIRNAME=xz-$(LIBXZ_VERSION)
#LIBXZ_PATCHDIR=$(LIBXZ_BASE)/patches
$(eval $(call fetch,libxz,$(LIBXZ_URL)))
#$(eval $(call patch,libxz,$(LIBXZ_PATCHDIR),$(LIBXZ_DIRNAME)))
################################################################################
# Helpers
################################################################################
LIBXZ_SRC = $(LIBXZ_ORIGIN)/$(LIBXZ_DIRNAME)
################################################################################
# Library includes
################################################################################
# API
LIBXZ__API += -I$(LIBXZ_SRC)/src/liblzma/api
CINCLUDES-$(CONFIG_LIBXZ) += $(LIBXZ__API)
CXXINCLUDES-$(CONFIG_LIBXZ) += $(LIBXZ__API)
# Internal
LIBXZ_CINCLUDES += -I$(LIBXZ_BASE)/include
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/common
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/delta
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/rangecoder
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/lzma
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/lz
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/check
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/simple
LIBXZ_CINCLUDES += -I$(LIBXZ_SRC)/src/liblzma/common
LIBXZ_MAIN_CINCLUDES += -I$(LIBXZ_BASE)/include
LIBXZ_MAIN_CINCLUDES += -I$(LIBXZ_SRC)/lib
LIBXZ_MAIN_CINCLUDES += -I$(LIBXZ_SRC)/src/common
################################################################################
# Global flags
################################################################################
LIBXZ_CFLAGS += -fvisibility=hidden
LIBXZ_CFLAGS += -DHAVE_CONFIG_H
LIBXZ_CFLAGS += -DTUKLIB_SYMBOL_PREFIX=lzma_
LIBXZ_MAIN_CFLAGS += -fvisibility=hidden
LIBXZ_MAIN_CFLAGS += -DHAVE_CONFIG_H
################################################################################
# Library sources
################################################################################
# These are taken from the upstream build in the order that make builds them.
# Please take care to maintain the order when updating.
################################################################################
# liblzma
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/common/tuklib_physmem.c
LIBXZ_SRCS-$(CONFIG_LIBXZ_THREAD) += $(LIBXZ_SRC)/src/common/tuklib_cpucores.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/common.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_util.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/easy_preset.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_common.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/hardware_physmem.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/index.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_flags_common.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/string_conversion.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/vli_size.c
LIBXZ_SRCS-$(CONFIG_LIBXZ_THREAD) += $(LIBXZ_SRC)/src/liblzma/common/hardware_cputhreads.c
LIBXZ_SRCS-$(CONFIG_LIBXZ_THREAD) += $(LIBXZ_SRC)/src/liblzma/common/outqueue.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/alone_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_buffer_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_header_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/easy_buffer_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/easy_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/easy_encoder_memusage.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_buffer_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_flags_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/index_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_buffer_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_flags_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/vli_encoder.c
LIBXZ_SRCS-$(CONFIG_LIBXZ_THREAD) += $(LIBXZ_SRC)/src/liblzma/common/stream_encoder_mt.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/microlzma_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/alone_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/auto_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_buffer_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/block_header_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/easy_decoder_memusage.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/file_info.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_buffer_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/filter_flags_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/index_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/index_hash.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_buffer_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/stream_flags_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/vli_decoder.c
LIBXZ_SRCS-$(CONFIG_LIBXZ_THREAD) += $(LIBXZ_SRC)/src/liblzma/common/stream_decoder_mt.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/microlzma_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/common/lzip_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/check/check.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/check/crc32_table.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/check/crc32_fast.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/check/crc64_table.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/check/crc64_fast.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/check/sha256.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lz/lz_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lz/lz_encoder_mf.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lz/lz_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma_encoder_presets.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma_encoder_optimum_fast.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma_encoder_optimum_normal.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/fastpos_table.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma2_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/lzma/lzma2_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/rangecoder/price_table.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/delta/delta_common.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/delta/delta_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/delta/delta_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/simple_coder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/simple_encoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/simple_decoder.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/x86.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/powerpc.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/ia64.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/arm.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/armthumb.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/arm64.c
LIBXZ_SRCS-y += $(LIBXZ_SRC)/src/liblzma/simple/sparc.c
# XZ
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/args.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/coder.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/file_io.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/hardware.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/main.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/message.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/mytime.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/options.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/signals.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/suffix.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/util.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/common/tuklib_open_stdxxx.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/common/tuklib_progname.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/common/tuklib_exit.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/common/tuklib_mbstr_width.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/common/tuklib_mbstr_fw.c
LIBXZ_MAIN_SRCS += $(LIBXZ_SRC)/src/xz/list.c