Commit 7e8234bc authored by Adriaan de Groot's avatar Adriaan de Groot Committed by Fabian Vogt

Make kio-fuse compile on FreeBSD

 - needs additional LDFLAGS (basically, -L/usr/local/lib because
   that's not in the standard link path, and all user-installed
   libraries live there). An alternative would be to find_library
   to massage -lfuse3 to an absolute path, but since there's
   potentially multiple libraries in FUSE3_LIBRARIES, it'd take
   a bunch of CMake boilerplate. Go for simplicity.
 - massage includes; <linux/fs.h> isn't there, and then we need
   to define some non-POSIXy flags that come from that header.
parent 3155bde7
......@@ -55,6 +55,7 @@ ecm_qt_declare_logging_category(KIOFUSE_SOURCES
add_executable(kio-fuse ${KIOFUSE_SOURCES})
target_include_directories(kio-fuse PRIVATE ${FUSE3_INCLUDE_DIRS})
target_compile_definitions(kio-fuse PRIVATE FUSE_USE_VERSION=31 ${FUSE3_CFLAGS_OTHER})
target_link_options(kio-fuse PRIVATE ${FUSE3_LDFLAGS})
target_link_libraries(kio-fuse PRIVATE Qt5::Core KF5::KIOCore ${FUSE3_LIBRARIES})
install(TARGETS kio-fuse DESTINATION ${KDE_INSTALL_FULL_LIBEXECDIR})
install(FILES kio-fuse-tmpfiles.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d)
......
......@@ -18,8 +18,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qglobal.h>
#ifdef Q_OS_LINUX
#include <linux/fs.h>
#endif
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
......@@ -40,6 +45,19 @@
#include "debug.h"
#include "kiofusevfs.h"
// Flags that don't exist on FreeBSD; since these are used as
// bit(masks), setting them to 0 effectively means they're always unset.
#ifndef O_NOATIME
#define O_NOATIME 0
#endif
// Flags that are extensions for renameat2, cribbed from GNU stdio.h
// and <linux/fs.h>
#ifndef RENAME_NOREPLACE
#define RENAME_NOREPLACE (1 << 0)
#endif
// The libfuse macros make this necessary
#pragma GCC diagnostic ignored "-Wpedantic"
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
......
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