File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ darwin_native_toolchain=native_cctools
17
17
18
18
clang_prog =$(build_prefix ) /bin/clang
19
19
clangxx_prog =$(clang_prog ) ++
20
+ llvm_config_prog =$(build_prefix ) /bin/llvm-config
20
21
21
22
clang_resource_dir =$(build_prefix ) /lib/clang/$(native_clang_version )
22
23
else
@@ -34,8 +35,10 @@ darwin_native_toolchain=
34
35
# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
35
36
clang_prog =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v clang")
36
37
clangxx_prog =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v clang++")
38
+ llvm_config_prog =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v llvm-config")
37
39
38
40
clang_resource_dir =$(shell clang -print-resource-dir)
41
+ llvm_lib_dir =$(shell $(llvm_config_prog ) --libdir)
39
42
endif
40
43
41
44
cctools_TOOLS =AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL
Original file line number Diff line number Diff line change @@ -7,18 +7,24 @@ $(package)_build_subdir=cctools
7
7
$(package)_dependencies =native_libtapi
8
8
9
9
define $(package)_set_vars
10
- $(package ) _config_opts=--target=$(host )
10
+ $(package ) _config_opts=--target=$(host ) --enable-lto-support
11
+ $(package ) _config_opts+=--with-llvm-config=$(llvm_config_prog )
11
12
$(package ) _ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib
12
- ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG ) ) ,)
13
- $(package ) _config_opts+=--enable-lto-support --with-llvm-config=$(build_prefix ) /bin/llvm-config
14
- endif
15
13
$(package ) _cc=$(clang_prog )
16
14
$(package ) _cxx=$(clangxx_prog )
17
15
endef
18
16
17
+ ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG ) ) ,)
19
18
define $(package)_preprocess_cmds
19
+ mkdir -p $($(package ) _staging_prefix_dir) /lib && \
20
+ cp $(llvm_lib_dir ) /libLTO.so $($(package ) _staging_prefix_dir) /lib/ && \
20
21
cp -f $(BASEDIR ) /config.guess $(BASEDIR ) /config.sub cctools
21
22
endef
23
+ else
24
+ define $(package)_preprocess_cmds
25
+ cp -f $(BASEDIR ) /config.guess $(BASEDIR ) /config.sub cctools
26
+ endef
27
+ endif
22
28
23
29
define $(package)_config_cmds
24
30
$($(package ) _autoconf)
Original file line number Diff line number Diff line change @@ -16,10 +16,13 @@ endef
16
16
define $(package)_stage_cmds
17
17
mkdir -p $($(package ) _staging_prefix_dir) /lib/clang/$($(package ) _version) /include && \
18
18
mkdir -p $($(package ) _staging_prefix_dir) /bin && \
19
+ mkdir -p $($(package ) _staging_prefix_dir) /include/llvm-c && \
19
20
cp bin/clang $($(package ) _staging_prefix_dir) /bin/ && \
20
21
cp -P bin/clang++ $($(package ) _staging_prefix_dir) /bin/ && \
21
22
cp bin/dsymutil $($(package ) _staging_prefix_dir) /bin/$(host ) -dsymutil && \
22
23
cp bin/llvm-config $($(package ) _staging_prefix_dir) /bin/ && \
24
+ cp include/llvm-c/ExternC.h $($(package ) _staging_prefix_dir) /include/llvm-c && \
25
+ cp include/llvm-c/lto.h $($(package ) _staging_prefix_dir) /include/llvm-c && \
23
26
cp lib/libLTO.so $($(package ) _staging_prefix_dir) /lib/ && \
24
27
cp -r lib/clang/$($(package ) _version) /include/* $($(package ) _staging_prefix_dir) /lib/clang/$($(package ) _version) /include/
25
28
endef
Original file line number Diff line number Diff line change @@ -13,7 +13,5 @@ define $(package)_build_cmds
13
13
endef
14
14
15
15
define $(package)_stage_cmds
16
- ./install.sh && \
17
- mkdir -p $($(package ) _staging_prefix_dir) /include/llvm-c && \
18
- cp src/llvm/include/llvm-c/lto.h $($(package ) _staging_prefix_dir) /include/llvm-c
16
+ ./install.sh
19
17
endef
You can’t perform that action at this time.
0 commit comments