1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_AUX_DIR(config)
5 AM_CONFIG_HEADER(config.h)
7 AM_INIT_AUTOMAKE(lufs,0.9.6)
9 dnl Some Makefiles use additional tests etc.
10 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
13 opt_fs="localfs locasefs ftpfs gnetfs"
15 AC_ARG_ENABLE(kernel-support,
16 [ --enable-kernel-support enable building of the kernel module (default=yes)],
17 [ KERNEL_SUPPORT=$enableval ],)
19 if test "$KERNEL_SUPPORT" != "no"
25 if test ! -d kernel/$OS_DIR
27 AC_MSG_ERROR($OS_DIR - not supported!)
29 AC_MSG_RESULT($OS_DIR)
32 dnl LINUX kernel configuration
33 if test "$OS_DIR"="Linux"
36 dnl Checking kernel & headers
37 AC_MSG_CHECKING(kernel)
39 [ --with-kernel=VERSION specify a kernel version to compile for],
40 [KERNEL_VERSION=$withval],
41 [KERNEL_VERSION=`uname -r`])
42 MODULES_DIR=/lib/modules/$KERNEL_VERSION
43 AC_MSG_RESULT($KERNEL_VERSION)
45 AC_MSG_CHECKING(kernel support)
46 KERNEL_DIR=`echo $KERNEL_VERSION | cut -d'.' -f1,2`
47 if test ! -d kernel/$OS_DIR/$KERNEL_DIR
49 AC_MSG_ERROR([$KERNEL_DIR not supported!])
51 AC_MSG_RESULT([supported in kernel/$OS_DIR/$KERNEL_DIR])
54 AC_MSG_CHECKING(kernel headers)
56 [ --with-kheaders=DIR specify the location of the kernel headers],
57 [KERNEL_HDR=$withval],
58 [KERNEL_HDR=$MODULES_DIR/build/include])
59 if test ! -f $KERNEL_HDR/linux/fs.h
61 AC_MSG_ERROR([not found in $KERNEL_HDR. please install them!])
63 AC_MSG_RESULT([found in $KERNEL_HDR])
66 AC_MSG_CHECKING(kernel configuration)
67 if test -f $MODULES_DIR/build/.config
69 tmp=`cat $MODULES_DIR/build/.config | grep CONFIG_MODVERSIONS=y`
72 AC_MSG_RESULT([found, using modversions])
73 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
75 AC_MSG_RESULT([found, not using modversions])
78 AC_MSG_RESULT([not found at $MODULES_DIR/build/.config, assuming modversions support])
79 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
82 AC_ARG_ENABLE(modversions,
83 [ --enable-modversions enable modeversions support (default=auto-detect)],
84 [ if test $enableval = "yes"; then MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"; else MODV_FLAGS=""; fi ],)
98 [ --enable-debug enable debug messages to stdout (default=no)],
99 [ 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"],
100 [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"])
101 AC_SUBST(DEBUG_FLAGS)
103 AC_ARG_ENABLE(kdebug,
104 [ --enable-kdebug enable kernel module debug messages (default=no)],
105 [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], )
106 AC_SUBST(KDEBUG_FLAGS)
108 AC_ARG_ENABLE(autofs-install,
109 [ --enable-autofs-install enable installing of autofs configuration (default=no)],
110 [ AUTOFS_INSTALL="yes"],)
111 AC_SUBST(AUTOFS_INSTALL)
114 [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)],
115 [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" )
120 dnl Checks for programs.
131 AC_MSG_CHECKING(for ssh)
133 [ --with-ssh=PATH specify the path to the ssh executable],
135 [SSHPROG=`which ssh 2>/dev/null`])
136 if test ! -x "$SSHPROG"
138 AC_MSG_RESULT([not found (sshfs support disabled)])
140 AC_MSG_RESULT([found ($SSHPROG)])
141 AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.])
142 opt_fs="$opt_fs sshfs"
148 AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
149 AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
150 AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
151 if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
153 AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
155 GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
156 GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
157 opt_fs="$opt_fs gvfs"
160 AC_SUBST(GVFS_CFLAGS)
163 [ --enable-wavfs build wavfs support (default=no)],
164 [ opt_fs="$opt_fs wavfs"],)
168 [ --enable-cefs build cefs support (default=no)],
169 [ opt_fs="$opt_fs cefs"],)
171 if test -n "$cefs_dir"; then
172 AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.])
173 AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library])
176 AC_ARG_ENABLE(cardfs,
177 [ --enable-cardfs build cardfs support (default=no)],
178 [ WITH_CARDFS=true ],)
180 dnl Checks for libraries.
181 AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs))
184 dnl Checks for header files.
186 AC_CHECK_HEADERS(unistd.h)
189 dnl This will test for endian-swapping headers
190 AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h)
193 dnl Checks for typedefs, structures, and compiler characteristics.
197 dnl Checks for library functions.
198 AC_CHECK_FUNCS(mkdir rmdir)
200 if test -n "$WITH_CARDFS"; then
201 echo checking for cardfs
202 AC_MSG_CHECKING(for libchipcard)
203 AC_ARG_WITH(chipcard-dir,
204 [ --with-chipcard-dir=DIR uses libchipcard from given dir],
206 [cc_dir="/usr/local/libchipcard \
211 for li in $cc_dir; do
212 if test -x "$li/bin/libchipcard-config"; then
216 if test -z "$chipcard_dir"; then
217 AC_MSG_RESULT([not found (chipcard support disabled)])
219 all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`"
220 all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`"
221 AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.])
222 define_has_libchipcard="#define HAS_LIBCHIPCARD"
223 AC_SUBST(define_has_libchipcard)
224 LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs"
225 LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`"
226 AC_MSG_RESULT($chipcard_dir)
227 all_libraries="$all_libraries $libchipcard_libs"
228 all_includes="$all_includes $libchipcard_includes"
229 opt_fs="$opt_fs cardfs"
232 AC_SUBST(LIBCHIPCARD_LIB)
233 AC_SUBST(LIBCHIPCARD_INCLUDES)
235 all_includes="$all_includes -I`pwd`/include"
238 AC_SUBST(all_includes)
239 AC_SUBST(all_libraries)
244 filesystems/Makefile \
245 filesystems/localfs/Makefile \
246 filesystems/locasefs/Makefile \
247 filesystems/sshfs/Makefile \
248 filesystems/ftpfs/Makefile \
249 filesystems/cardfs/Makefile \
250 filesystems/cefs/Makefile \
251 filesystems/cefs/asyncd/Makefile \
252 filesystems/gvfs/Makefile \
253 filesystems/gnetfs/Makefile \
254 filesystems/wavfs/Makefile \
257 kernel/Linux/Makefile \
258 kernel/Linux/2.4/Makefile \
259 kernel/Linux/2.5/Makefile \
267 echo "###############################################################################"
268 echo " supported filesystems: $opt_fs"
269 echo -n " suid files: "
270 if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi
271 echo "###############################################################################"