Unverified Commit 1029148d authored by Andreas Sturmlechner's avatar Andreas Sturmlechner
Browse files

Build kio_nfs against standalone libtirpc

Summary:
Since glibc-2.26, cmake skipped over nfs when standalone tirpc
was installed in tirpc subdir (as done by Debian, Fedora, Arch, Gentoo...)

Use FindTIRPC and make kio_nfs optional that way
FindTIRPC taken from https://phabricator.kde.org/D12761

Test Plan: Built with libtirpc successfully.

Reviewers: #dolphin, dfaure, rdieter, sitter

Subscribers: kde-frameworks-devel, cgiboudeaux, arojas, kfm-devel, meven

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D17205
parent 9f1b9eb8
...@@ -140,6 +140,11 @@ if(UNIX) ...@@ -140,6 +140,11 @@ if(UNIX)
set_package_properties(Gperf PROPERTIES TYPE OPTIONAL set_package_properties(Gperf PROPERTIES TYPE OPTIONAL
PURPOSE "Needed to build the man kioslave" PURPOSE "Needed to build the man kioslave"
) )
find_package(TIRPC)
set_package_properties(TIRPC PROPERTIES TYPE OPTIONAL
PURPOSE "Needed to build the NFS kioslave"
)
else() else()
# FIXME: on windows we ignore support until trash gets integrated # FIXME: on windows we ignore support until trash gets integrated
endif() endif()
...@@ -184,9 +189,7 @@ if(NOT WIN32) ...@@ -184,9 +189,7 @@ if(NOT WIN32)
if(Gperf_FOUND) if(Gperf_FOUND)
add_subdirectory( man ) add_subdirectory( man )
endif() endif()
check_include_files(rpc/rpc.h HAVE_RPC_RPC_H) if(TIRPC_FOUND)
add_feature_info("NFS kioslave" HAVE_RPC_RPC_H "The RPC library is needed to build the NFS kioslave")
if(HAVE_RPC_RPC_H)
add_subdirectory( nfs ) add_subdirectory( nfs )
endif() endif()
endif() endif()
......
## Check for XDR functions ## Check for XDR functions
include(CheckFunctionExists) include(CheckCXXSymbolExists)
CHECK_FUNCTION_EXISTS(xdr_u_int64_t HAVE_XDR_U_INT64_T) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${TIRPC_LIBRARIES})
CHECK_FUNCTION_EXISTS(xdr_uint64_t HAVE_XDR_UINT64_T) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${TIRPC_INCLUDE_DIRS})
CHECK_FUNCTION_EXISTS(xdr_u_hyper HAVE_XDR_U_HYPER) check_cxx_symbol_exists(xdr_u_int64_t "rpc/xdr.h" HAVE_XDR_U_INT64_T)
CHECK_FUNCTION_EXISTS(xdr_u_longlong_t HAVE_XDR_U_LONGLONG_T) check_cxx_symbol_exists(xdr_uint64_t "rpc/xdr.h" HAVE_XDR_UINT64_T)
check_cxx_symbol_exists(xdr_u_hyper "rpc/xdr.h" HAVE_XDR_U_HYPER)
check_cxx_symbol_exists(xdr_u_longlong_t "rpc/xdr.h" HAVE_XDR_U_LONGLONG_T)
if (NOT HAVE_XDR_U_INT64_T AND NOT HAVE_XDR_UINT64_T AND NOT HAVE_XDR_U_HYPER AND NOT HAVE_XDR_U_LONGLONG_T) if (NOT HAVE_XDR_U_INT64_T AND NOT HAVE_XDR_UINT64_T AND NOT HAVE_XDR_U_HYPER AND NOT HAVE_XDR_U_LONGLONG_T)
message(FATAL_ERROR "Could not find 64-bit XDR datatype functions!") message(FATAL_ERROR "Could not find 64-bit XDR datatype functions!")
...@@ -24,9 +26,10 @@ if (HAVE_XDR_U_LONGLONG_T) ...@@ -24,9 +26,10 @@ if (HAVE_XDR_U_LONGLONG_T)
endif (HAVE_XDR_U_LONGLONG_T) endif (HAVE_XDR_U_LONGLONG_T)
add_definitions(-DTRANSLATION_DOMAIN=\"kio5_nfs\") add_definitions(-DTRANSLATION_DOMAIN=\"kio5_nfs\")
include_directories(${TIRPC_INCLUDE_DIRS})
add_library(kio_nfs MODULE kio_nfs.cpp nfsv2.cpp nfsv3.cpp rpc_nfs3_prot_xdr.c rpc_nfs2_prot_xdr.c) add_library(kio_nfs MODULE kio_nfs.cpp nfsv2.cpp nfsv3.cpp rpc_nfs3_prot_xdr.c rpc_nfs2_prot_xdr.c)
target_link_libraries(kio_nfs KF5::KIOCore KF5::I18n Qt5::Network) target_link_libraries(kio_nfs KF5::KIOCore KF5::I18n Qt5::Network ${TIRPC_LIBRARIES})
set_target_properties(kio_nfs PROPERTIES OUTPUT_NAME "nfs") set_target_properties(kio_nfs PROPERTIES OUTPUT_NAME "nfs")
install(TARGETS kio_nfs DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio) install(TARGETS kio_nfs DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment