You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.7 KiB

  1. AC_INIT(fuse, 2.9.7-mergerfs_2.26.0)
  2. AC_PREREQ(2.59d)
  3. AC_CONFIG_MACRO_DIR([m4])
  4. AC_CANONICAL_TARGET
  5. AM_INIT_AUTOMAKE([foreign])
  6. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
  7. AC_CONFIG_HEADERS(include/config.h)
  8. AC_PROG_LIBTOOL
  9. AC_PROG_CC
  10. AC_PROG_MKDIR_P
  11. AM_PROG_CC_C_O
  12. case $target_os in
  13. *linux*) arch=linux;;
  14. *netbsd*) arch=netbsd;;
  15. *bsd*) arch=bsd;;
  16. *) arch=unknown;;
  17. esac
  18. if test "$ac_env_CFLAGS_set" != set; then
  19. CFLAGS="-Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing"
  20. fi
  21. AC_ARG_ENABLE(lib,
  22. [ --enable-lib Compile with library ])
  23. AC_ARG_ENABLE(util,
  24. [ --enable-util Compile with util ])
  25. AC_ARG_ENABLE(example,
  26. [ --enable-example Compile with examples ])
  27. AC_ARG_ENABLE(mtab,
  28. [ --disable-mtab Disable and ignore usage of /etc/mtab ])
  29. AC_ARG_WITH(pkgconfigdir,
  30. [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
  31. [pkgconfigdir=$withval],
  32. [pkgconfigdir='${libdir}/pkgconfig'])
  33. AC_SUBST(pkgconfigdir)
  34. subdirs2="include"
  35. if test "$enable_lib" != "no"; then
  36. subdirs2="$subdirs2 lib";
  37. fi
  38. if test "$arch" = linux -a "$enable_util" != "no"; then
  39. subdirs2="$subdirs2 util";
  40. fi
  41. if test "$enable_example" != "no"; then
  42. subdirs2="$subdirs2 example";
  43. fi
  44. if test "$enable_mtab" = "no"; then
  45. AC_DEFINE(IGNORE_MTAB, 1, [Don't update /etc/mtab])
  46. fi
  47. AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat])
  48. AC_CHECK_FUNCS([posix_fallocate])
  49. AC_CHECK_MEMBERS([struct stat.st_atim])
  50. AC_CHECK_MEMBERS([struct stat.st_atimespec])
  51. LIBS=
  52. AC_SEARCH_LIBS(dlopen, [dl])
  53. AC_SEARCH_LIBS(clock_gettime, [rt])
  54. libfuse_libs=$LIBS
  55. LIBS=
  56. AC_ARG_WITH([libiconv-prefix],
  57. [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
  58. for dir in `echo "$withval" | tr : ' '`; do
  59. if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
  60. if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
  61. done
  62. ])
  63. AM_ICONV
  64. libfuse_libs="$libfuse_libs $LTLIBICONV"
  65. AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = yes)
  66. AC_SUBST(libfuse_libs)
  67. if test -z "$MOUNT_FUSE_PATH"; then
  68. MOUNT_FUSE_PATH=/sbin
  69. AC_MSG_NOTICE([MOUNT_FUSE_PATH env var not set, using default $MOUNT_FUSE_PATH])
  70. fi
  71. AC_SUBST(MOUNT_FUSE_PATH)
  72. if test -z "$UDEV_RULES_PATH"; then
  73. UDEV_RULES_PATH=/etc/udev/rules.d
  74. AC_MSG_NOTICE([UDEV_RULES_PATH env var not set, using default $UDEV_RULES_PATH])
  75. fi
  76. AC_SUBST(UDEV_RULES_PATH)
  77. if test -z "$INIT_D_PATH"; then
  78. INIT_D_PATH=/etc/init.d
  79. AC_MSG_NOTICE([INIT_D_PATH env var not set, using default $INIT_D_PATH])
  80. fi
  81. AC_SUBST(INIT_D_PATH)
  82. AC_SUBST(subdirs2)
  83. AM_CONDITIONAL(LINUX, test "$arch" = linux)
  84. AM_CONDITIONAL(NETBSD, test "$arch" = netbsd)
  85. AM_CONDITIONAL(BSD, test "$arch" = bsd)
  86. util_linux_ok=yes
  87. if test "$arch" = linux -a "$cross_compiling" != "yes"; then
  88. AC_MSG_CHECKING([if umount supports --fake --no-canonicalize])
  89. # exit code of umount is 1 if option is unrecognised, 2 otherwise
  90. umount --fake --no-canonicalize > /dev/null 2>&1
  91. if test $? != 1; then
  92. AC_MSG_RESULT([yes])
  93. else
  94. firstline=`umount --fake --no-canonicalize 2>&1 | head -1`
  95. if test "$firstline" = 'umount: only root can use "--fake" option'; then
  96. AC_MSG_RESULT([yes])
  97. else
  98. AC_MSG_RESULT([$firstline])
  99. util_linux_ok=no
  100. fi
  101. fi
  102. fi
  103. AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile doc/Makefile])
  104. AC_OUTPUT
  105. if test "$util_linux_ok" = no; then
  106. AC_MSG_WARN([
  107. ******************************************************************
  108. * Please install util-linux version 2.18 or later which supports *
  109. * --fake and --no-canonicalize options in mount and umount *
  110. ******************************************************************])
  111. fi