diff --git a/Mk/Uses/inotify.mk b/Mk/Uses/inotify.mk new file mode 100644 --- /dev/null +++ b/Mk/Uses/inotify.mk @@ -0,0 +1,38 @@ +# Handle dependency on the libinotify port +# inotify was added to base in FreeBSD 15 +# +# Feature: inotify +# Valid ARGS: none +# +# MAINTAINER: adamw@FreeBSD.org + +.if !defined(_INCLUDE_USES_INOTIFY_MK) +_INCLUDE_USES_INOTIFY_MK= yes + +. if !exists(/usr/include/sys/inotify.h) +INOTIFY_PORT= true +INOTIFY_INCLUDE_PATH= ${LOCALBASE}/include/sys +INOTIFY_LIB= -linotify +INOTIFY_LIB_PATH= ${LOCALBASE}/lib/libinotify.so + +LIB_DEPENDS+= libinotify.so:devel/libinotify + +. else +INOTIFY_PORT= +INOTIFY_INCLUDE_PATH= /usr/include/sys +INOTIFY_LIB= +INOTIFY_LIB_PATH= /usr/lib/libc.so + +. if exists(${LOCALBASE}/include/sys/inotify.h) +LIB_DEPENDS+= libinotify.so:devel/libinotify +. endif + +CMAKE_ARGS+= -DINOTIFY_INCLUDE_DIR=${INOTIFY_INCLUDE_PATH} \ + -DINOTIFY_LIBRARIES=${INOTIFY_LIB_PATH} \ + -DINOTIFY_LIBRARY=${INOTIFY_LIB_PATH} \ + -DLIBINOTIFY_INCLUDE_DIR=${INOTIFY_INCLUDE_PATH} \ + -DLIBINOTIFY_LIBRARIES=${INOTIFY_LIB_PATH} \ + -DLIBINOTIFY_LIBRARY=${INOTIFY_LIB_PATH} +. endif + +.endif # !defined(_INCLUDE_USES_INOTIFY_MK