dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT(AUTHORS) AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(lufs,0.9.6) AM_MAINTAINER_MODE dnl Some Makefiles use additional tests etc. AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"]) dnl "static" FSs opt_fs="localfs gnetfs" dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_DISABLE_STATIC AM_PROG_LIBTOOL AC_PROG_MAKE_SET AC_ARG_WITH(cxx, [ --with-cxx permit use of C++ compiler for additional filesystems], [ AC_PROG_CXX opt_fs="$opt_fs locasefs ftpfs" ], [ AC_PROG_CXX(true) CXX=false ]) OS_DIR=Linux 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) dnl Checking ssh AC_MSG_CHECKING(for ssh) AC_ARG_WITH(ssh, [ --with-ssh=PATH specify the path to the ssh executable], [ if test "$CXX" = "false" then AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of sshfs.]) fi SSHPROG=$withval if test ! -x "$SSHPROG" then AC_MSG_ERROR([Specified --with-ssh $SSHPROG is not executable.]) fi ],[ if test "$CXX" = "false" then SSHPROG=no else if which ssh 2>/dev/null then SSHPROG=`which ssh` else SSHPROG=no fi fi ]) if test "$SSHPROG" = "no" 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 if test "$CXX" != "false" then 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 fi AC_SUBST(GVFS_LDADD) AC_SUBST(GVFS_CFLAGS) AC_ARG_ENABLE(wavfs, [ --enable-wavfs build wavfs support (default=no)], [ if test "$CXX" = "false" then AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of wavfs.]) fi opt_fs="$opt_fs wavfs" ],) AC_ARG_ENABLE(cefs, [ --enable-cefs build cefs support (default=no)], [ if test "$CXX" = "false" then AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of cefs.]) fi 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 if test "$CXX" = "false" then AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of cardfs.]) fi 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 \ kernel/Linux/modbin/Makefile \ include/Makefile \ docs/Makefile \ man/Makefile \ lufs.spec \ kernel/Linux/prepmod \ ) echo "###############################################################################" echo " supported filesystems: $opt_fs" echo -n " suid files: " if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi echo "###############################################################################"