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)
10 opt_fs="localfs locasefs ftpfs gnetfs"
12 AC_ARG_ENABLE(kernel-support,
13 [ --enable-kernel-support enable building of the kernel module (default=yes)],
14 [ KERNEL_SUPPORT=$enableval ],)
16 if test "$KERNEL_SUPPORT" != "no"
22 if test ! -d kernel/$OS_DIR
24 AC_MSG_ERROR($OS_DIR - not supported!)
26 AC_MSG_RESULT($OS_DIR)
29 dnl LINUX kernel configuration
30 if test "$OS_DIR"="Linux"
33 dnl Checking kernel & headers
34 AC_MSG_CHECKING(kernel)
36 [ --with-kernel=VERSION specify a kernel version to compile for],
37 [KERNEL_VERSION=$withval],
38 [KERNEL_VERSION=`uname -r`])
39 MODULES_DIR=/lib/modules/$KERNEL_VERSION
40 AC_MSG_RESULT($KERNEL_VERSION)
42 AC_MSG_CHECKING(kernel support)
43 KERNEL_DIR=`echo $KERNEL_VERSION | cut -d'.' -f1,2`
44 if test ! -d kernel/$OS_DIR/$KERNEL_DIR
46 AC_MSG_ERROR([$KERNEL_DIR not supported!])
48 AC_MSG_RESULT([supported in kernel/$OS_DIR/$KERNEL_DIR])
51 AC_MSG_CHECKING(kernel headers)
53 [ --with-kheaders=DIR specify the location of the kernel headers],
54 [KERNEL_HDR=$withval],
55 [KERNEL_HDR=$MODULES_DIR/build/include])
56 if test ! -f $KERNEL_HDR/linux/fs.h
58 AC_MSG_ERROR([not found in $KERNEL_HDR. please install them!])
60 AC_MSG_RESULT([found in $KERNEL_HDR])
63 AC_MSG_CHECKING(kernel configuration)
64 if test -f $MODULES_DIR/build/.config
66 tmp=`cat $MODULES_DIR/build/.config | grep CONFIG_MODVERSIONS=y`
69 AC_MSG_RESULT([found, using modversions])
70 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
72 AC_MSG_RESULT([found, not using modversions])
75 AC_MSG_RESULT([not found at $MODULES_DIR/build/.config, assuming modversions support])
76 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
79 AC_ARG_ENABLE(modversions,
80 [ --enable-modversions enable modeversions support (default=auto-detect)],
81 [ if test $enableval = "yes"; then MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"; else MODV_FLAGS=""; fi ],)
95 [ --enable-debug enable debug messages to stdout (default=no)],
96 [ 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"],
97 [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"])
100 AC_ARG_ENABLE(kdebug,
101 [ --enable-kdebug enable kernel module debug messages (default=no)],
102 [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], )
103 AC_SUBST(KDEBUG_FLAGS)
105 AC_ARG_ENABLE(autofs-install,
106 [ --enable-autofs-install enable installing of autofs configuration (default=no)],
107 [ AUTOFS_INSTALL="yes"],)
108 AC_SUBST(AUTOFS_INSTALL)
111 [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)],
112 [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" )
117 dnl Checks for programs.
128 AC_MSG_CHECKING(for ssh)
130 [ --with-ssh=PATH specify the path to the ssh executable],
132 [SSHPROG=`which ssh 2>/dev/null`])
133 if test ! -x "$SSHPROG"
135 AC_MSG_RESULT([not found (sshfs support disabled)])
137 AC_MSG_RESULT([found ($SSHPROG)])
138 AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.])
139 opt_fs="$opt_fs sshfs"
145 AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
146 AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
147 AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
148 if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
150 AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
152 GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
153 GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
154 opt_fs="$opt_fs gvfs"
157 AC_SUBST(GVFS_CFLAGS)
160 [ --enable-wavfs build wavfs support (default=no)],
161 [ opt_fs="$opt_fs wavfs"],)
165 [ --enable-cefs build cefs support (default=no)],
166 [ opt_fs="$opt_fs cefs"],)
168 if test -n "$cefs_dir"; then
169 AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.])
170 AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library])
173 AC_ARG_ENABLE(cardfs,
174 [ --enable-cardfs build cardfs support (default=no)],
175 [ WITH_CARDFS=true ],)
177 dnl Checks for libraries.
178 AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs))
181 dnl Checks for header files.
183 AC_CHECK_HEADERS(unistd.h)
186 dnl This will test for endian-swapping headers
187 AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h)
190 dnl Checks for typedefs, structures, and compiler characteristics.
194 dnl Checks for library functions.
195 AC_CHECK_FUNCS(mkdir rmdir)
197 if test -n "$WITH_CARDFS"; then
198 echo checking for cardfs
199 AC_MSG_CHECKING(for libchipcard)
200 AC_ARG_WITH(chipcard-dir,
201 [ --with-chipcard-dir=DIR uses libchipcard from given dir],
203 [cc_dir="/usr/local/libchipcard \
208 for li in $cc_dir; do
209 if test -x "$li/bin/libchipcard-config"; then
213 if test -z "$chipcard_dir"; then
214 AC_MSG_RESULT([not found (chipcard support disabled)])
216 all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`"
217 all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`"
218 AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.])
219 define_has_libchipcard="#define HAS_LIBCHIPCARD"
220 AC_SUBST(define_has_libchipcard)
221 LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs"
222 LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`"
223 AC_MSG_RESULT($chipcard_dir)
224 all_libraries="$all_libraries $libchipcard_libs"
225 all_includes="$all_includes $libchipcard_includes"
226 opt_fs="$opt_fs cardfs"
229 AC_SUBST(LIBCHIPCARD_LIB)
230 AC_SUBST(LIBCHIPCARD_INCLUDES)
232 all_includes="$all_includes -I`pwd`/include"
235 AC_SUBST(all_includes)
236 AC_SUBST(all_libraries)
241 filesystems/Makefile \
242 filesystems/localfs/Makefile \
243 filesystems/locasefs/Makefile \
244 filesystems/sshfs/Makefile \
245 filesystems/ftpfs/Makefile \
246 filesystems/cardfs/Makefile \
247 filesystems/cefs/Makefile \
248 filesystems/cefs/asyncd/Makefile \
249 filesystems/gvfs/Makefile \
250 filesystems/gnetfs/Makefile \
251 filesystems/wavfs/Makefile \
254 kernel/Linux/Makefile \
255 kernel/Linux/2.4/Makefile \
256 kernel/Linux/2.5/Makefile \
263 echo "###############################################################################"
264 echo " supported filesystems: $opt_fs"
265 echo -n " suid files: "
266 if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi
267 echo "###############################################################################"