mirror of
https://github.com/libfuse/libfuse.git
synced 2024-11-27 14:14:28 +08:00
89 lines
2.4 KiB
Plaintext
89 lines
2.4 KiB
Plaintext
AC_INIT(lib/fuse.c)
|
|
AM_INIT_AUTOMAKE(fuse, 1.1)
|
|
AM_CONFIG_HEADER(include/config.h)
|
|
|
|
AC_PROG_CC
|
|
AC_PROG_RANLIB
|
|
|
|
if test -z "$LD"; then
|
|
LD=ld
|
|
fi
|
|
AC_SUBST(LD)
|
|
|
|
CFLAGS="-Wall -W -g -O2"
|
|
|
|
AC_ARG_ENABLE(kernel-module,
|
|
[ --enable-kernel-module Compile kernel module, requires --with-kernel option ])
|
|
AC_ARG_ENABLE(lib,
|
|
[ --enable-lib Compile with library ])
|
|
AC_ARG_ENABLE(util,
|
|
[ --enable-util Compile with util ])
|
|
AC_ARG_ENABLE(example,
|
|
[ --enable-example Compile with examples ])
|
|
|
|
subdirs="include patch"
|
|
|
|
if test "$enable_kernel_module" != "no"; then
|
|
AC_MSG_CHECKING([kernel source directory])
|
|
kernelsrc=
|
|
AC_ARG_WITH(kernel,
|
|
[ --with-kernel Specify location of kernel source ],
|
|
[kernelsrc="$withval"])
|
|
|
|
if test -z "$kernelsrc"; then
|
|
buildlink=/lib/modules/`uname -r`/build
|
|
if test -e $buildlink; then
|
|
kernelsrc=`(cd $buildlink; /bin/pwd)`
|
|
else
|
|
AC_MSG_RESULT([Not found])
|
|
AC_MSG_ERROR([
|
|
*** Please specify the location of the kernel source with
|
|
*** the '--with-kernel=SRCDIR' option])
|
|
fi
|
|
fi
|
|
AC_MSG_RESULT([$kernelsrc])
|
|
|
|
AC_MSG_CHECKING([kernel source version])
|
|
if test -r $kernelsrc/include/linux/version.h; then
|
|
kernsrcver=`(echo "#include <linux/version.h>"; echo "kernsrcver=UTS_RELEASE") | cpp -I $kernelsrc/include | grep "^kernsrcver=" | cut -d \" -f 2`
|
|
fi
|
|
if test -z "$kernsrcver"; then
|
|
AC_MSG_RESULT([Not found])
|
|
AC_MSG_ERROR([
|
|
*** Cannot determine the version of the linux kernel source. Please
|
|
*** configure the kernel before running this script])
|
|
fi
|
|
AC_MSG_RESULT([$kernsrcver])
|
|
majver=`echo "$kernsrcver" | cut -f-2 -d.`
|
|
kmoduledir=/lib/modules/$kernsrcver
|
|
AC_SUBST(kernelsrc)
|
|
AC_SUBST(majver)
|
|
AC_SUBST(kmoduledir)
|
|
subdirs="$subdirs kernel"
|
|
|
|
if echo "$kernsrcver" | grep -q "^2.4"; then
|
|
old_cflags="$CFLAGS"
|
|
CFLAGS="-I${kernelsrc}/include -Wall -O2 -fno-strict-aliasing -D__KERNEL__"
|
|
AC_CHECK_DECL(i_size_read,
|
|
AC_DEFINE(HAVE_I_SIZE_FUNC, 1,
|
|
[Kernel has i_size_read() and i_size_write() functions]),,
|
|
[#include <linux/fs.h>])
|
|
CFLAGS="$old_cflags"
|
|
fi
|
|
fi
|
|
|
|
if test "$enable_lib" != "no"; then
|
|
subdirs="$subdirs lib";
|
|
fi
|
|
if test "$enable_util" != "no"; then
|
|
subdirs="$subdirs util";
|
|
fi
|
|
if test "$enable_example" != "no"; then
|
|
subdirs="$subdirs example";
|
|
fi
|
|
|
|
AC_SUBST(subdirs)
|
|
|
|
AC_OUTPUT([Makefile kernel/Makefile lib/Makefile util/Makefile example/Makefile include/Makefile include/linux/Makefile patch/Makefile])
|
|
|