diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-04-18 04:39:03 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-04-18 04:39:03 +1000 |
commit | 8f0e47e3ce7e0c188c5548789b2cea18f0c8484d (patch) | |
tree | b1b1a3417144dafda0c4198624efc9eb8981b527 /tools/depends | |
parent | d89c10711a535e572db1f093dbed9da0eed9fb6a (diff) |
[tools/depends][target] libpng use cmake build system
Diffstat (limited to 'tools/depends')
-rw-r--r-- | tools/depends/target/libpng/LIBPNG-VERSION | 5 | ||||
-rw-r--r-- | tools/depends/target/libpng/Makefile | 49 |
2 files changed, 31 insertions, 23 deletions
diff --git a/tools/depends/target/libpng/LIBPNG-VERSION b/tools/depends/target/libpng/LIBPNG-VERSION new file mode 100644 index 0000000000..c67b9d40ef --- /dev/null +++ b/tools/depends/target/libpng/LIBPNG-VERSION @@ -0,0 +1,5 @@ +LIBNAME=libpng +VERSION=1.6.37 +ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz +SHA512=2ce2b855af307ca92a6e053f521f5d262c36eb836b4810cb53c809aa3ea2dcc08f834aee0ffd66137768a54397e28e92804534a74abb6fc9f6f3127f14c9c338 +BYPRODUCT=libpng.a diff --git a/tools/depends/target/libpng/Makefile b/tools/depends/target/libpng/Makefile index 9962f78edb..4e4def73bc 100644 --- a/tools/depends/target/libpng/Makefile +++ b/tools/depends/target/libpng/Makefile @@ -1,37 +1,40 @@ -include ../../Makefile.include -DEPS = ../../Makefile.include Makefile ../../download-files.include - -# lib name, version -LIBNAME=libpng -VERSION=1.6.37 -SOURCE=$(LIBNAME)-$(VERSION) -ARCHIVE=$(SOURCE).tar.gz -SHA512=2ce2b855af307ca92a6e053f521f5d262c36eb836b4810cb53c809aa3ea2dcc08f834aee0ffd66137768a54397e28e92804534a74abb6fc9f6f3127f14c9c338 -include ../../download-files.include +include ../../Makefile.include LIBPNG-VERSION ../../download-files.include +DEPS = ../../Makefile.include Makefile LIBPNG-VERSION ../../download-files.include # configuration settings -CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ - ./configure --prefix=$(PREFIX) --disable-shared - -LIBDYLIB=$(PLATFORM)/.libs/$(LIBNAME)16.a +CMAKE_OPTIONS=-DPNG_SHARED=OFF \ + -DPNG_STATIC=ON \ + -DPNG_TESTS=OFF \ + -DPNG_DEBUG=OFF + +ifneq ($(findstring apple-darwin, $(HOST)), apple-darwin) + CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON \ + -DPNG_BUILD_ZLIB=ON \ + -DZLIB_LIBRARY=$(PREFIX)/lib/libz.a \ + -DZLIB_INCLUDE_DIR=$(PREFIX)/include +else + ifeq ($(OS), osx) + CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=ON + else + CMAKE_OPTIONS+= -DPNG_HARDWARE_OPTIMIZATIONS=OFF + endif +endif + +LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT) all: .installed-$(PLATFORM) - $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) $(DEPS) - rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) + rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); $(CONFIGURE) - -$(LIBDYLIB): $(PLATFORM) - $(MAKE) -C $(PLATFORM) + cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. -.installed-$(PLATFORM): $(LIBDYLIB) - $(MAKE) -C $(PLATFORM) install +.installed-$(PLATFORM): $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build install touch $@ clean: - $(MAKE) -C $(PLATFORM) clean + $(MAKE) -C $(PLATFORM)/build clean rm -f .installed-$(PLATFORM) distclean:: |