fix
[fuse.git] / configure.in
blob063f68f3a92dd12f0febae3d7271c9ca608eb6da
1 AC_INIT(fuse, 2.6.0-pre3)
2 AC_CANONICAL_TARGET
3 AM_INIT_AUTOMAKE
4 AM_CONFIG_HEADER(include/config.h)
6 AC_PROG_LIBTOOL
7 AC_PROG_CC
9 # compatibility for automake < 1.8
10 if test -z "$mkdir_p"; then
11         mkdir_p="../mkinstalldirs"
12         AC_SUBST(mkdir_p)
15 case $target_os in
16      *linux*)   arch=linux;;
17      *bsd*)     arch=bsd;;
18      *)         arch=unknown;;
19 esac
21 if test "$ac_env_CFLAGS_set" != set; then
22         CFLAGS="-Wall -W -g -O2"
24 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DFUSE_USE_VERSION=26"
26 AC_ARG_ENABLE(kernel-module,
27         [  --enable-kernel-module  Compile kernel module ])
28 AC_ARG_ENABLE(lib,
29         [  --enable-lib            Compile with library ])
30 AC_ARG_ENABLE(util,
31         [  --enable-util           Compile with util ])
32 AC_ARG_ENABLE(example,
33         [  --enable-example        Compile with examples ])
34 AC_ARG_ENABLE(mtab,
35         [  --disable-mtab          Disable and ignore usage of /etc/mtab ])
37 AC_ARG_WITH(pkgconfigdir,
38             [  --with-pkgconfigdir=DIR      pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
39             [pkgconfigdir=$withval],
40             [pkgconfigdir='${libdir}/pkgconfig'])
41 AC_SUBST(pkgconfigdir)
43 subdirs2="include"
45 if test "$arch" = linux -a "$enable_kernel_module" != "no"; then
46         AC_CONFIG_SUBDIRS(kernel)
49 if test "$enable_lib" != "no"; then
50         subdirs2="$subdirs2 lib";
52 if test "$arch" = linux -a "$enable_util" != "no"; then
53         subdirs2="$subdirs2 util";
55 if test "$enable_example" != "no"; then
56         subdirs2="$subdirs2 example";
58 if test "$enable_mtab" = "no"; then
59         AC_DEFINE(IGNORE_MTAB, 1, [Don't update /etc/mtab])
61 AC_CHECK_FUNCS([fork setxattr fdatasync])
62 AC_CHECK_MEMBERS([struct stat.st_atim])
64 libfuse_libs=-pthread
65 LIBS=
66 AC_SEARCH_LIBS(clock_gettime, [rt])
67 libfuse_libs="$libfuse_libs $LIBS"
68 LIBS=
69 AC_SUBST(libfuse_libs)
71 if test -z "$MOUNT_FUSE_PATH"; then
72         MOUNT_FUSE_PATH=/sbin
74 AC_SUBST(MOUNT_FUSE_PATH)
75 if test -z "$UDEV_RULES_PATH"; then
76         UDEV_RULES_PATH=/etc/udev/rules.d
78 AC_SUBST(UDEV_RULES_PATH)
80 AC_SUBST(subdirs2)
82 AM_CONDITIONAL(LINUX, test "$arch" = linux)
83 AM_CONDITIONAL(BSD, test "$arch" = bsd)
85 AC_CHECK_HEADERS(selinux/selinux.h, AC_CHECK_LIB(selinux, getfilecon))
87 AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile])
88 AC_OUTPUT