comparison src/build-meson.mk @ 5521:5f9dc6e65bd2

build-meson: Support using ccache in projects that use the meson toolchain file. * src/build-meson.mk: Write the basename of the (cross-)compilers to the toolchain file. That allows projects using that file to find the ccache links in the search path.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 27 Aug 2020 12:45:36 +0200
parents 4edf49596bf0
children aef302738266
comparison
equal deleted inserted replaced
5520:efe91da1a169 5521:5f9dc6e65bd2
20 MESON_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/meson/cross/mxe-conf.ini 20 MESON_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/meson/cross/mxe-conf.ini
21 else 21 else
22 MESON_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/meson/native/mxe-conf.ini 22 MESON_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/meson/native/mxe-conf.ini
23 endif 23 endif
24 24
25 ifeq ($(USE_CCACHE),yes)
26 $(PKG)_MXE_CC_BASENAME := $(shell basename $(MXE_CC))
27 $(PKG)_MXE_CXX_BASENAME := $(shell basename $(MXE_CXX))
28 $(PKG)_MXE_F77_BASENAME := $(shell basename $(MXE_F77))
29 endif
30
25 define $(PKG)_BUILD 31 define $(PKG)_BUILD
26 cd '$(1)' && $(PYTHON3) setup.py install --prefix='$(BUILD_TOOLS_PREFIX)' 32 cd '$(1)' && $(PYTHON3) setup.py install --prefix='$(BUILD_TOOLS_PREFIX)'
27 33
28 # create file with compilation settings 34 # create file with compilation settings
29 rm -f $(MESON_TOOLCHAIN_FILE) && mkdir -p '$(dir $(MESON_TOOLCHAIN_FILE))' 35 rm -f $(MESON_TOOLCHAIN_FILE) && mkdir -p '$(dir $(MESON_TOOLCHAIN_FILE))'
30 (echo "[binaries]"; \ 36 (echo "[binaries]"; \
31 if [ x$(USE_SYSTEM_GCC) == xno ]; then \ 37 if [ x$(USE_SYSTEM_GCC) == xno ]; then \
32 echo "c = '$(shell echo $(MXE_CC) | $(SED) "s/'//g")'"; \ 38 if [ x$(USE_CCACHE) == xyes ]; then \
33 echo "cpp = '$(shell echo $(MXE_CXX) | $(SED) "s/'//g")'"; \ 39 echo "c = '$($(PKG)_MXE_CC_BASENAME)'"; \
34 echo "fortran = '$(shell echo $(MXE_F77) | $(SED) "s/'//g")'"; \ 40 echo "cpp = '$($(PKG)_MXE_CXX_BASENAME)'"; \
41 echo "fortran = '$($(PKG)_MXE_F77_BASENAME)'"; \
42 else \
43 echo "c = '$(shell echo $(MXE_CC) | $(SED) "s/'//g")'"; \
44 echo "cpp = '$(shell echo $(MXE_CXX) | $(SED) "s/'//g")'"; \
45 echo "fortran = '$(shell echo $(MXE_F77) | $(SED) "s/'//g")'"; \
46 fi; \
35 echo "ar = '$(shell echo $(MXE_AR) | $(SED) "s/'//g")'"; \ 47 echo "ar = '$(shell echo $(MXE_AR) | $(SED) "s/'//g")'"; \
36 echo "strip = '$(shell echo $(MXE_STRIP) | $(SED) "s/'//g")'"; \ 48 echo "strip = '$(shell echo $(MXE_STRIP) | $(SED) "s/'//g")'"; \
37 fi; \ 49 fi; \
38 echo "pkgconfig = '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config'"; \ 50 echo "pkgconfig = '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config'"; \
39 echo "llvm-config = '$(HOST_BINDIR)/$(MXE_TOOL_PREFIX)llvm-config'";\ 51 echo "llvm-config = '$(HOST_BINDIR)/$(MXE_TOOL_PREFIX)llvm-config'";\