1 dnl Process this file with autoconf to produce a configure script.
4 AM_CONFIG_HEADER(config.h)
6 AM_INIT_AUTOMAKE(lufs,0.9.6)
8 dnl Some Makefiles use additional tests etc.
9 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
12 opt_fs="localfs locasefs ftpfs gnetfs"
14 AC_ARG_ENABLE(kernel-support,
15 [ --enable-kernel-support enable building of the kernel module (default=yes)],
16 [ KERNEL_SUPPORT=$enableval ],)
18 if test "$KERNEL_SUPPORT" != "no"
24 if test ! -d kernel/$OS_DIR
26 AC_MSG_ERROR($OS_DIR - not supported!)
28 AC_MSG_RESULT($OS_DIR)
31 dnl LINUX kernel configuration
32 if test "$OS_DIR"="Linux"
35 dnl Checking kernel & headers
36 AC_MSG_CHECKING(kernel)
38 [ --with-kernel=VERSION specify a kernel version to compile for],
39 [KERNEL_VERSION=$withval],
40 [KERNEL_VERSION=`uname -r`])
41 MODULES_DIR=/lib/modules/$KERNEL_VERSION
42 AC_MSG_RESULT($KERNEL_VERSION)
44 AC_MSG_CHECKING(kernel support)
45 KERNEL_DIR=`echo $KERNEL_VERSION | cut -d'.' -f1,2`
46 if test ! -d kernel/$OS_DIR/$KERNEL_DIR
48 AC_MSG_ERROR([$KERNEL_DIR not supported!])
50 AC_MSG_RESULT([supported in kernel/$OS_DIR/$KERNEL_DIR])
53 AC_MSG_CHECKING(kernel headers)
55 [ --with-kheaders=DIR specify the location of the kernel headers],
56 [KERNEL_HDR=$withval],
57 [KERNEL_HDR=$MODULES_DIR/build/include])
58 if test ! -f $KERNEL_HDR/linux/fs.h
60 AC_MSG_ERROR([not found in $KERNEL_HDR. please install them!])
62 AC_MSG_RESULT([found in $KERNEL_HDR])
65 AC_MSG_CHECKING(kernel configuration)
66 if test -f $MODULES_DIR/build/.config
68 tmp=`cat $MODULES_DIR/build/.config | grep CONFIG_MODVERSIONS=y`
71 AC_MSG_RESULT([found, using modversions])
72 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
74 AC_MSG_RESULT([found, not using modversions])
77 AC_MSG_RESULT([not found at $MODULES_DIR/build/.config, assuming modversions support])
78 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
81 AC_ARG_ENABLE(modversions,
82 [ --enable-modversions enable modeversions support (default=auto-detect)],
83 [ if test $enableval = "yes"; then MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"; else MODV_FLAGS=""; fi ],)
97 [ --enable-debug enable debug messages to stdout (default=no)],
98 [ 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"],
99 [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"])
100 AC_SUBST(DEBUG_FLAGS)
102 AC_ARG_ENABLE(kdebug,
103 [ --enable-kdebug enable kernel module debug messages (default=no)],
104 [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], )
105 AC_SUBST(KDEBUG_FLAGS)
107 AC_ARG_ENABLE(autofs-install,
108 [ --enable-autofs-install enable installing of autofs configuration (default=no)],
109 [ AUTOFS_INSTALL="yes"],)
110 AC_SUBST(AUTOFS_INSTALL)
113 [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)],
114 [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" )
119 dnl Checks for programs.
130 AC_MSG_CHECKING(for ssh)
132 [ --with-ssh=PATH specify the path to the ssh executable],
134 [SSHPROG=`which ssh 2>/dev/null`])
135 if test ! -x "$SSHPROG"
137 AC_MSG_RESULT([not found (sshfs support disabled)])
139 AC_MSG_RESULT([found ($SSHPROG)])
140 AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.])
141 opt_fs="$opt_fs sshfs"
147 AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
148 AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
149 AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
150 if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
152 AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
154 GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
155 GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
156 opt_fs="$opt_fs gvfs"
159 AC_SUBST(GVFS_CFLAGS)
162 [ --enable-wavfs build wavfs support (default=no)],
163 [ opt_fs="$opt_fs wavfs"],)
167 [ --enable-cefs build cefs support (default=no)],
168 [ opt_fs="$opt_fs cefs"],)
170 if test -n "$cefs_dir"; then
171 AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.])
172 AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library])
175 AC_ARG_ENABLE(cardfs,
176 [ --enable-cardfs build cardfs support (default=no)],
177 [ WITH_CARDFS=true ],)
179 dnl Checks for libraries.
180 AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs))
183 dnl Checks for header files.
185 AC_CHECK_HEADERS(unistd.h)
188 dnl This will test for endian-swapping headers
189 AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h)
192 dnl Checks for typedefs, structures, and compiler characteristics.
196 dnl Checks for library functions.
197 AC_CHECK_FUNCS(mkdir rmdir)
199 if test -n "$WITH_CARDFS"; then
200 echo checking for cardfs
201 AC_MSG_CHECKING(for libchipcard)
202 AC_ARG_WITH(chipcard-dir,
203 [ --with-chipcard-dir=DIR uses libchipcard from given dir],
205 [cc_dir="/usr/local/libchipcard \
210 for li in $cc_dir; do
211 if test -x "$li/bin/libchipcard-config"; then
215 if test -z "$chipcard_dir"; then
216 AC_MSG_RESULT([not found (chipcard support disabled)])
218 all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`"
219 all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`"
220 AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.])
221 define_has_libchipcard="#define HAS_LIBCHIPCARD"
222 AC_SUBST(define_has_libchipcard)
223 LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs"
224 LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`"
225 AC_MSG_RESULT($chipcard_dir)
226 all_libraries="$all_libraries $libchipcard_libs"
227 all_includes="$all_includes $libchipcard_includes"
228 opt_fs="$opt_fs cardfs"
231 AC_SUBST(LIBCHIPCARD_LIB)
232 AC_SUBST(LIBCHIPCARD_INCLUDES)
234 all_includes="$all_includes -I`pwd`/include"
237 AC_SUBST(all_includes)
238 AC_SUBST(all_libraries)
243 filesystems/Makefile \
244 filesystems/localfs/Makefile \
245 filesystems/locasefs/Makefile \
246 filesystems/sshfs/Makefile \
247 filesystems/ftpfs/Makefile \
248 filesystems/cardfs/Makefile \
249 filesystems/cefs/Makefile \
250 filesystems/cefs/asyncd/Makefile \
251 filesystems/gvfs/Makefile \
252 filesystems/gnetfs/Makefile \
253 filesystems/wavfs/Makefile \
256 kernel/Linux/Makefile \
257 kernel/Linux/2.4/Makefile \
258 kernel/Linux/2.5/Makefile \
265 echo "###############################################################################"
266 echo " supported filesystems: $opt_fs"
267 echo -n " suid files: "
268 if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi
269 echo "###############################################################################"