diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2022-03-18 04:15:12 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 04:15:12 +1000 |
commit | d80480fee36f38cb446f077ad1fe30b7dbc15745 (patch) | |
tree | 26f0750723610b0a595179bf6bcfa902de3c75e4 /tools | |
parent | 877b7230ef7b49eaa71df720a5c00da6e3d9de19 (diff) | |
parent | 54f7a910bb618486fdcaecd6d0cfa09af3fb125e (diff) |
Merge pull request #21125 from fuzzard/depends_libnfs
[tools/depends][target] libnfs use cmake build
Diffstat (limited to 'tools')
-rw-r--r-- | tools/depends/target/libnfs/001-fix-cmake-build.patch | 25 | ||||
-rw-r--r-- | tools/depends/target/libnfs/LIBNFS-VERSION | 1 | ||||
-rw-r--r-- | tools/depends/target/libnfs/Makefile | 26 |
3 files changed, 41 insertions, 11 deletions
diff --git a/tools/depends/target/libnfs/001-fix-cmake-build.patch b/tools/depends/target/libnfs/001-fix-cmake-build.patch new file mode 100644 index 0000000000..fe59fffca5 --- /dev/null +++ b/tools/depends/target/libnfs/001-fix-cmake-build.patch @@ -0,0 +1,25 @@ +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -12,4 +12,12 @@ + add_library(${name} OBJECT ${SOURCES} ${HEADERS}) + target_include_directories(${name} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) + set(CORE_LIBRARIES "${name};${CORE_LIBRARIES}" CACHE INTERNAL "") ++ ++ # no need to install core libs if we build shared library ++ if(NOT BUILD_SHARED_LIBS) ++ install(TARGETS ${name} EXPORT libnfs ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) ++ endif() + endfunction() +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -116,6 +116,7 @@ + + install(FILES mount/libnfs-raw-mount.h + nfs/libnfs-raw-nfs.h ++ nfs4/libnfs-raw-nfs4.h + nlm/libnfs-raw-nlm.h + nsm/libnfs-raw-nsm.h + portmap/libnfs-raw-portmap.h diff --git a/tools/depends/target/libnfs/LIBNFS-VERSION b/tools/depends/target/libnfs/LIBNFS-VERSION index dbe9fb8775..ec25ff92f2 100644 --- a/tools/depends/target/libnfs/LIBNFS-VERSION +++ b/tools/depends/target/libnfs/LIBNFS-VERSION @@ -2,3 +2,4 @@ LIBNAME=libnfs VERSION=5.0.1 ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz SHA512=71f2dcfa8945c1cb6402f5fca10b1f7a4720f7589807d6130eb55361f05ef4684f9cc9a177ece4e13d3847ac6606924115fac7b27749cecc2f5aca6fa9c63ebf +BYPRODUCT=libnfs.a diff --git a/tools/depends/target/libnfs/Makefile b/tools/depends/target/libnfs/Makefile index 30ce28152b..ee8bb3048b 100644 --- a/tools/depends/target/libnfs/Makefile +++ b/tools/depends/target/libnfs/Makefile @@ -1,31 +1,35 @@ include ../../Makefile.include LIBNFS-VERSION ../../download-files.include -DEPS= ../../Makefile.include Makefile LIBNFS-VERSION ../../download-files.include +DEPS= ../../Makefile.include Makefile LIBNFS-VERSION ../../download-files.include \ + 001-fix-cmake-build.patch # configuration settings -CONFIGURE=./configure --prefix=$(PREFIX) --disable-shared --disable-utils --disable-examples --disable-werror +CMAKE_OPTIONS=-DBUILD_SHARED_LIBS=OFF \ + -DENABLE_TESTS=OFF \ + -DENABLE_DOCUMENTATION=OFF \ + -DENABLE_UTILS=OFF \ + -DENABLE_EXAMPLES=OFF -LIBDYLIB=$(PLATFORM)/lib/.libs/$(LIBNAME).a +LIBDYLIB=$(PLATFORM)/build/lib/$(BYPRODUCT) all: .installed-$(PLATFORM) - $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) $(DEPS) -rm -rf $(PLATFORM); mkdir -p $(PLATFORM) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); ./bootstrap - cd $(PLATFORM); $(CONFIGURE) + cd $(PLATFORM); mkdir -p build + cd $(PLATFORM); patch -p1 -i ../001-fix-cmake-build.patch + cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. $(LIBDYLIB): $(PLATFORM) - $(MAKE) -C $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build .installed-$(PLATFORM): $(LIBDYLIB) - $(MAKE) -C $(PLATFORM) install + $(MAKE) -C $(PLATFORM)/build install touch $@ clean: - $(MAKE) -C $(PLATFORM) clean - rm -r .installed-$(PLATFORM) - rm -rf $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build clean + rm -f .installed-$(PLATFORM) distclean:: rm -rf $(PLATFORM) .installed-$(PLATFORM) |