AC_INIT(lib/fuse.c) AM_INIT_AUTOMAKE(fuse, 0.9) AM_CONFIG_HEADER(include/config.h) AC_PROG_CC AC_PROG_RANLIB CFLAGS="-Wall -W -g -O2" 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]) kernsrcver=`AC_TRY_RUN([ #include "$kernelsrc/include/linux/version.h" #include int main() { printf("%s\n", UTS_RELEASE); return 0; } ], , , true)` 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]) KERNINCLUDE=$kernelsrc/include AC_SUBST(KERNINCLUDE) kmoduledir=/lib/modules/$kernsrcver AC_SUBST(kmoduledir) AC_OUTPUT([Makefile kernel/Makefile lib/Makefile util/Makefile example/Makefile include/Makefile include/linux/Makefile patch/Makefile])