diff options
author | Philipp Kerling <pkerling@casix.org> | 2018-01-03 09:23:38 +0100 |
---|---|---|
committer | Philipp Kerling <pkerling@casix.org> | 2018-01-04 15:37:28 +0100 |
commit | deef0d9ec6a820bdfc15cc808ce1f8f5b6a1c161 (patch) | |
tree | 3558b52f764a31b1ea4e66006e4c8b7054f73cef | |
parent | d52404179abf5c203657f43ae7640beecb48db05 (diff) |
[depends] Build waylandpp with CMake
-rw-r--r-- | tools/depends/Makefile.include.in | 2 | ||||
-rw-r--r-- | tools/depends/native/Makefile | 5 | ||||
-rw-r--r-- | tools/depends/native/waylandpp-scanner-native/Makefile | 45 | ||||
-rw-r--r-- | tools/depends/target/waylandpp/Makefile | 21 |
4 files changed, 61 insertions, 12 deletions
diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in index f4daa90670..99781b99fb 100644 --- a/tools/depends/Makefile.include.in +++ b/tools/depends/Makefile.include.in @@ -82,6 +82,8 @@ else CC_FOR_BUILD=@CCACHE@ @CC_FOR_BUILD@ CXX_FOR_BUILD=@CCACHE@ @CXX_FOR_BUILD@ endif +CC_BINARY_FOR_BUILD=@CC_FOR_BUILD@ +CXX_BINARY_FOR_BUILD=@CXX_FOR_BUILD@ AR_FOR_BUILD=@AR_FOR_BUILD@ RANLIB_FOR_BUILD=@RANLIB_FOR_BUILD@ AS_FOR_BUILD=@AS_FOR_BUILD@ diff --git a/tools/depends/native/Makefile b/tools/depends/native/Makefile index ce5f15b0b3..346f14a93c 100644 --- a/tools/depends/native/Makefile +++ b/tools/depends/native/Makefile @@ -21,7 +21,7 @@ ifeq ($(OS),osx) endif ifeq ($(ENABLE_WAYLAND),yes) - NATIVE += expat-native wayland-scanner-native scons-native + NATIVE += expat-native wayland-scanner-native waylandpp-scanner-native endif .PHONY: $(NATIVE) native @@ -39,8 +39,9 @@ distribute-native: python27-native distutilscross-native: python27-native distribute-native tar-native: xz-native automake-native python27-native: zlib-native -wayland-scanner-native: expat-native scons-native: python27-native +wayland-scanner-native: expat-native +waylandpp-scanner-native: cmake-native #liblzo2 has stale packaged automake files that cause borked host/build detection liblzo2-native: automake-native diff --git a/tools/depends/native/waylandpp-scanner-native/Makefile b/tools/depends/native/waylandpp-scanner-native/Makefile new file mode 100644 index 0000000000..ba41d9eb1d --- /dev/null +++ b/tools/depends/native/waylandpp-scanner-native/Makefile @@ -0,0 +1,45 @@ +include ../../Makefile.include +PREFIX=$(NATIVEPREFIX) +PLATFORM=$(NATIVEPLATFORM) +DEPS=../../Makefile.include Makefile + +# lib name, version +LIBNAME=waylandpp +VERSION=0.1.5 +SOURCE=$(LIBNAME)-$(VERSION) +ARCHIVE=$(SOURCE).tar.gz + +APP=$(PLATFORM)/wayland-scanner++ +CLEAN_FILES=$(ARCHIVE) $(PLATFORM) + +# Only this package uses CMake for build on native at the moment, +# so there is no separate toolchain file. Still we have to unset +# the CMAKE_TOOLCHAIN_FILE, which is part of $(CMAKE) and set to +# the target toolchain file. +CMAKE_OPTIONS := -DCMAKE_TOOLCHAIN_FILE= -DBUILD_DOCUMENTATION=OFF -DBUILD_LIBRARIES=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SCANNER=ON -DCMAKE_C_COMPILER="$(CC_BINARY_FOR_BUILD)" -DCMAKE_CXX_COMPILER="$(CXX_BINARY_FOR_BUILD)" -DCMAKE_C_FLAGS="$(NATIVE_CFLAGS)" -DCMAKE_CXX_FLAGS="$(NATIVE_CXXFLAGS)" -DCMAKE_EXE_LINKER_FLAGS="$(NATIVE_LDFLAGS)" -DCMAKE_INSTALL_LIBDIR=lib $(CMAKE_OPTIONS) +BUILDDIR = $(PLATFORM)/build + +all: .installed-$(PLATFORM) + +$(TARBALLS_LOCATION)/$(ARCHIVE): + cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) + +$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) + rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) + cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) + mkdir -p $(BUILDDIR) + cd $(BUILDDIR); $(CMAKE) $(CMAKE_OPTIONS) .. + +$(APP): $(PLATFORM) + $(MAKE) -C $(BUILDDIR) + +.installed-$(PLATFORM): $(APP) + $(MAKE) -C $(BUILDDIR) install + touch $@ + +clean: + $(MAKE) -C $(BUILDDIR) clean + rm -f .installed-$(PLATFORM) + +distclean: + rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/tools/depends/target/waylandpp/Makefile b/tools/depends/target/waylandpp/Makefile index a8109110b3..40e51748dd 100644 --- a/tools/depends/target/waylandpp/Makefile +++ b/tools/depends/target/waylandpp/Makefile @@ -3,7 +3,7 @@ DEPS=Makefile # lib name, version LIBNAME=waylandpp -VERSION=0.1.0 +VERSION=0.1.5 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz @@ -12,23 +12,22 @@ CLEAN_FILES=$(ARCHIVE) $(PLATFORM) ifeq ($(PLATFORM),) # Building stand-alone - CXX_FOR_BUILD := $(CXX) ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) PLATFORM = native TARBALLS_LOCATION = $(ROOT_DIR) BASE_URL := http://mirrors.kodi.tv/build-deps/sources RETRIEVE_TOOL := curl -Ls --create-dirs -f -O ARCHIVE_TOOL := tar --strip-components=1 -xf + CMAKE := cmake + CMAKE_OPTIONS := -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DBUILD_SCANNER=ON $(CMAKE_OPTIONS) else # Building as part of depends DEPS += ../../Makefile.include - export PKG_CONFIG=$(NATIVEPREFIX)/bin/pkg-config - export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig + CMAKE_OPTIONS := -DBUILD_SCANNER=OFF -DWAYLAND_SCANNERPP=$(NATIVEPREFIX)/bin/wayland-scanner++ $(CMAKE_OPTIONS) endif -SCONS=scons -export CROSSCXX:=$(CXX) -export CXX=$(CXX_FOR_BUILD) +CMAKE_OPTIONS := -DBUILD_DOCUMENTATION=OFF -DBUILD_LIBRARIES=ON -DBUILD_EXAMPLES=OFF $(CMAKE_OPTIONS) +BUILDDIR = $(PLATFORM)/build all: .installed-$(PLATFORM) @@ -43,16 +42,18 @@ ifeq ($(PREFIX),) endif rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) + mkdir -p $(BUILDDIR) + cd $(BUILDDIR); $(CMAKE) $(CMAKE_OPTIONS) .. $(LIBDYLIB): $(PLATFORM) - $(SCONS) -C $(PLATFORM) + $(MAKE) -C $(BUILDDIR) .installed-$(PLATFORM): $(LIBDYLIB) - PREFIX=$(PREFIX) $(SCONS) -C $(PLATFORM) install + $(MAKE) -C $(BUILDDIR) install touch $@ clean: - $(SCONS) -C $(PLATFORM) clean + $(MAKE) -C $(BUILDDIR) clean rm -f .installed-$(PLATFORM) distclean: |