*** empty log message ***
[fuse.git] / configure.in
blob0d939ad9336c2970dbbd38cc3865f697c68b2244
1 AC_INIT(fuse, 2.8.3)
2 AC_CONFIG_MACRO_DIR([m4])
3 AC_CANONICAL_TARGET
4 AM_INIT_AUTOMAKE
5 AM_CONFIG_HEADER(include/config.h)
7 AC_PROG_LIBTOOL
8 AC_PROG_CC
9 AM_PROG_CC_C_O
11 # compatibility for automake < 1.8
12 if test -z "$mkdir_p"; then
13         mkdir_p="../mkinstalldirs"
14         AC_SUBST(mkdir_p)
17 case $target_os in
18      *linux*)   arch=linux;;
19      *bsd*)     arch=bsd;;
20      *)         arch=unknown;;
21 esac
23 if test "$ac_env_CFLAGS_set" != set; then
24         CFLAGS="-Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing"
27 AC_ARG_ENABLE(lib,
28         [  --enable-lib            Compile with library ])
29 AC_ARG_ENABLE(util,
30         [  --enable-util           Compile with util ])
31 AC_ARG_ENABLE(example,
32         [  --enable-example        Compile with examples ])
33 AC_ARG_ENABLE(mtab,
34         [  --disable-mtab          Disable and ignore usage of /etc/mtab ])
36 AC_ARG_WITH(pkgconfigdir,
37             [  --with-pkgconfigdir=DIR      pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
38             [pkgconfigdir=$withval],
39             [pkgconfigdir='${libdir}/pkgconfig'])
40 AC_SUBST(pkgconfigdir)
42 subdirs2="include"
44 if test "$enable_lib" != "no"; then
45         subdirs2="$subdirs2 lib";
47 if test "$arch" = linux -a "$enable_util" != "no"; then
48         subdirs2="$subdirs2 util";
50 if test "$enable_example" != "no"; then
51         subdirs2="$subdirs2 example";
53 if test "$enable_mtab" = "no"; then
54         AC_DEFINE(IGNORE_MTAB, 1, [Don't update /etc/mtab])
56 AC_CHECK_FUNCS([fork setxattr fdatasync])
57 AC_CHECK_MEMBERS([struct stat.st_atim])
58 AC_CHECK_MEMBERS([struct stat.st_atimespec])
60 libfuse_libs="-pthread"
61 LIBS=
62 AC_SEARCH_LIBS(dlopen, [dl])
63 AC_SEARCH_LIBS(clock_gettime, [rt])
64 libfuse_libs="$libfuse_libs $LIBS"
65 LIBS=
66 AC_ARG_WITH([libiconv-prefix],
67 [  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
68     for dir in `echo "$withval" | tr : ' '`; do
69       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
70       if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
71     done
72    ])
73 AM_ICONV
74 libfuse_libs="$libfuse_libs $LIBICONV"
75 AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = yes)
76 AC_SUBST(libfuse_libs)
78 if test -z "$MOUNT_FUSE_PATH"; then
79         MOUNT_FUSE_PATH=/sbin
81 AC_SUBST(MOUNT_FUSE_PATH)
82 if test -z "$UDEV_RULES_PATH"; then
83         UDEV_RULES_PATH=/etc/udev/rules.d
85 AC_SUBST(UDEV_RULES_PATH)
86 if test -z "$INIT_D_PATH"; then
87         INIT_D_PATH=/etc/init.d
89 AC_SUBST(INIT_D_PATH)
91 AC_SUBST(subdirs2)
93 AM_CONDITIONAL(LINUX, test "$arch" = linux)
94 AM_CONDITIONAL(BSD, test "$arch" = bsd)
96 AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile])
97 AC_OUTPUT