dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT(AUTHORS) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(lufs,0.9.6) dnl "static" FSs opt_fs="localfs locasefs ftpfs gnetfs" AC_ARG_ENABLE(kernel-support, [ --enable-kernel-support enable building of the kernel module (default=yes)], [ KERNEL_SUPPORT=$enableval ],) if test "$KERNEL_SUPPORT" != "no" then dnl Checking os AC_MSG_CHECKING(OS) OS_DIR=`uname -s` if test ! -d kernel/$OS_DIR then AC_MSG_ERROR($OS_DIR - not supported!) else AC_MSG_RESULT($OS_DIR) fi dnl LINUX kernel configuration if test "$OS_DIR"="Linux" then dnl Checking kernel & headers AC_MSG_CHECKING(kernel) AC_ARG_WITH(kernel, [ --with-kernel=VERSION specify a kernel version to compile for], [KERNEL_VERSION=$withval], [KERNEL_VERSION=`uname -r`]) MODULES_DIR=/lib/modules/$KERNEL_VERSION AC_MSG_RESULT($KERNEL_VERSION) AC_MSG_CHECKING(kernel support) KERNEL_DIR=`echo $KERNEL_VERSION | cut -d'.' -f1,2` if test ! -d kernel/$OS_DIR/$KERNEL_DIR then AC_MSG_ERROR([$KERNEL_DIR not supported!]) else AC_MSG_RESULT([supported in kernel/$OS_DIR/$KERNEL_DIR]) fi AC_MSG_CHECKING(kernel headers) AC_ARG_WITH(kheaders, [ --with-kheaders=DIR specify the location of the kernel headers], [KERNEL_HDR=$withval], [KERNEL_HDR=$MODULES_DIR/build/include]) if test ! -f $KERNEL_HDR/linux/fs.h then AC_MSG_ERROR([not found in $KERNEL_HDR. please install them!]) else AC_MSG_RESULT([found in $KERNEL_HDR]) fi AC_MSG_CHECKING(kernel configuration) if test -f $MODULES_DIR/build/.config then tmp=`cat $MODULES_DIR/build/.config | grep CONFIG_MODVERSIONS=y` if test "$tmp" then AC_MSG_RESULT([found, using modversions]) MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h" else AC_MSG_RESULT([found, not using modversions]) fi else AC_MSG_RESULT([not found at $MODULES_DIR/build/.config, assuming modversions support]) MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h" fi AC_ARG_ENABLE(modversions, [ --enable-modversions enable modeversions support (default=auto-detect)], [ if test $enableval = "yes"; then MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"; else MODV_FLAGS=""; fi ],) AC_SUBST(MODV_FLAGS) AC_SUBST(KERNEL_DIR) AC_SUBST(MODULES_DIR) AC_SUBST(KERNEL_HDR) fi fi AC_SUBST(OS_DIR) dnl options AC_ARG_ENABLE(debug, [ --enable-debug enable debug messages to stdout (default=no)], [ DEBUG_FLAGS="-g -DDEBUG" && CXXFLAGS="-g -O2 -Wall -DDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-g -O2 -Wall -DDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"], [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]) AC_SUBST(DEBUG_FLAGS) AC_ARG_ENABLE(kdebug, [ --enable-kdebug enable kernel module debug messages (default=no)], [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], ) AC_SUBST(KDEBUG_FLAGS) AC_ARG_ENABLE(autofs-install, [ --enable-autofs-install enable installing of autofs configuration (default=no)], [ AUTOFS_INSTALL="yes"],) AC_SUBST(AUTOFS_INSTALL) AC_ARG_ENABLE(suid, [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)], [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" ) AC_SUBST(LUFS_SUID) AC_DISABLE_STATIC dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AM_PROG_LIBTOOL AC_PROG_MAKE_SET dnl Checking ssh AC_MSG_CHECKING(for ssh) AC_ARG_WITH(ssh, [ --with-ssh=PATH specify the path to the ssh executable], [SSHPROG=$withval], [SSHPROG=`which ssh 2>/dev/null`]) if test ! -x "$SSHPROG" then AC_MSG_RESULT([not found (sshfs support disabled)]) else AC_MSG_RESULT([found ($SSHPROG)]) AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.]) opt_fs="$opt_fs sshfs" fi AC_SUBST(SSHPROG) dnl Checking gnome AC_CHECK_PROG(GCONF, gnome-config, gnome-config) AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config) AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,) if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS" then AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.]) GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`" GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`" opt_fs="$opt_fs gvfs" fi AC_SUBST(GVFS_LDADD) AC_SUBST(GVFS_CFLAGS) AC_ARG_ENABLE(wavfs, [ --enable-wavfs build wavfs support (default=no)], [ opt_fs="$opt_fs wavfs"],) AC_ARG_ENABLE(cefs, [ --enable-cefs build cefs support (default=no)], [ opt_fs="$opt_fs cefs"],) if test -n "$cefs_dir"; then AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.]) AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library]) fi AC_ARG_ENABLE(cardfs, [ --enable-cardfs build cardfs support (default=no)], [ WITH_CARDFS=true ],) dnl Checks for libraries. AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs)) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h) dnl This will test for endian-swapping headers AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T dnl Checks for library functions. AC_CHECK_FUNCS(mkdir rmdir) if test -n "$WITH_CARDFS"; then echo checking for cardfs AC_MSG_CHECKING(for libchipcard) AC_ARG_WITH(chipcard-dir, [ --with-chipcard-dir=DIR uses libchipcard from given dir], [cc_dir="$withval"], [cc_dir="/usr/local/libchipcard \ /usr/local \ /usr/libchipcard \ /usr \ /"]) for li in $cc_dir; do if test -x "$li/bin/libchipcard-config"; then chipcard_dir="$li" fi done if test -z "$chipcard_dir"; then AC_MSG_RESULT([not found (chipcard support disabled)]) else all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`" all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`" AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.]) define_has_libchipcard="#define HAS_LIBCHIPCARD" AC_SUBST(define_has_libchipcard) LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs" LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`" AC_MSG_RESULT($chipcard_dir) all_libraries="$all_libraries $libchipcard_libs" all_includes="$all_includes $libchipcard_includes" opt_fs="$opt_fs cardfs" fi fi AC_SUBST(LIBCHIPCARD_LIB) AC_SUBST(LIBCHIPCARD_INCLUDES) all_includes="$all_includes -I`pwd`/include" AC_SUBST(opt_fs) AC_SUBST(all_includes) AC_SUBST(all_libraries) AC_OUTPUT(\ Makefile \ lufsd/Makefile \ filesystems/Makefile \ filesystems/localfs/Makefile \ filesystems/locasefs/Makefile \ filesystems/sshfs/Makefile \ filesystems/ftpfs/Makefile \ filesystems/cardfs/Makefile \ filesystems/cefs/Makefile \ filesystems/cefs/asyncd/Makefile \ filesystems/gvfs/Makefile \ filesystems/gnetfs/Makefile \ filesystems/wavfs/Makefile \ util/Makefile \ kernel/Makefile \ kernel/Linux/Makefile \ kernel/Linux/2.4/Makefile \ kernel/Linux/2.5/Makefile \ include/Makefile \ config/Makefile \ docs/Makefile \ man/Makefile \ ) echo "###############################################################################" echo " supported filesystems: $opt_fs" echo -n " suid files: " if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi echo "###############################################################################"