diff --git a/README b/README index 5192800..e0c971d 100644 --- a/README +++ b/README @@ -55,6 +55,23 @@ of selinux context mount options (-o context=, etc): For helpers built with mount library (libmount), support of the context mount depends on the libmount that distro provides. +If you are having problems due to the missing nilfs2 disk format or +ioctl interface definition file (nilfs2_ondisk.h or nilfs2_api.h, +respectively), try installing the Linux kernel source or header file +package first. + +If you still cannot install these files, or if you want to overwrite +them with files from this package, specify the +"--enable-uapi-header-install" option as an argument to the configure +script. This will install the uapi header files included in this +package: + + $ ./configure --enable-uapi-header-install + +Note that the utility package itself references bundled local header +files, so you don't need to install these files with this option to +build. + * How to get development sources diff --git a/configure.ac b/configure.ac index 98bc107..ff450aa 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,12 @@ AC_ARG_WITH([blkid], AS_HELP_STRING([--without-blkid], [compile without blkid support]), [], with_blkid=yes) +AC_ARG_ENABLE([uapi_header_install], + AS_HELP_STRING([--enable-uapi-header-install], + [install kernel uapi header files]), + [enable_uapi_header_install="${enableval}"], + [enable_uapi_header_install=no]) + # Checks for libraries. AC_CHECK_LIB([uuid], [uuid_generate], [AC_DEFINE([HAVE_LIBUUID], 1, @@ -139,6 +145,9 @@ if test "${with_selinux}" = "yes"; then fi AC_SUBST([LIB_SELINUX]) +AM_CONDITIONAL(CONFIG_UAPI_HEADER_INSTALL, + [test "$enable_uapi_header_install" = yes]) + # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE diff --git a/include/Makefile.am b/include/Makefile.am index 93f3c01..dc43dad 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,4 +5,8 @@ noinst_HEADERS = realpath.h nls.h parser.h nilfs_feature.h \ vector.h nilfs_gc.h cnormap.h cleaner_msg.h cleaner_exec.h \ compat.h crc32.h pathnames.h segment.h util.h +if CONFIG_UAPI_HEADER_INSTALL nobase_include_HEADERS = linux/nilfs2_api.h linux/nilfs2_ondisk.h +else +noinst_HEADERS += linux/nilfs2_api.h linux/nilfs2_ondisk.h +endif