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 gnetfs"
14 dnl Checks for programs.
24 [ --with-cxx permit use of C++ compiler for additional filesystems],
27 opt_fs="$opt_fs locasefs ftpfs"
34 AC_ARG_ENABLE(kernel-support,
35 [ --enable-kernel-support enable building of the kernel module (default=yes)],
36 [ KERNEL_SUPPORT=$enableval ],)
38 if test "$KERNEL_SUPPORT" != "no"
44 if test ! -d kernel/$OS_DIR
46 AC_MSG_ERROR($OS_DIR - not supported!)
48 AC_MSG_RESULT($OS_DIR)
51 dnl LINUX kernel configuration
52 if test "$OS_DIR"="Linux"
55 dnl Checking kernel & headers
56 AC_MSG_CHECKING(kernel)
58 [ --with-kernel=VERSION specify a kernel version to compile for],
59 [KERNEL_VERSION=$withval],
60 [KERNEL_VERSION=`uname -r`])
61 MODULES_DIR=/lib/modules/$KERNEL_VERSION
62 AC_MSG_RESULT($KERNEL_VERSION)
64 AC_MSG_CHECKING(kernel support)
65 KERNEL_DIR=`echo $KERNEL_VERSION | cut -d'.' -f1,2`
66 if test ! -d kernel/$OS_DIR/$KERNEL_DIR
68 AC_MSG_ERROR([$KERNEL_DIR not supported!])
70 AC_MSG_RESULT([supported in kernel/$OS_DIR/$KERNEL_DIR])
73 AC_MSG_CHECKING(kernel headers)
75 [ --with-kheaders=DIR specify the location of the kernel headers],
76 [KERNEL_HDR=$withval],
77 [KERNEL_HDR=$MODULES_DIR/build/include])
78 if test ! -f $KERNEL_HDR/linux/fs.h
80 AC_MSG_ERROR([not found in $KERNEL_HDR. please install them!])
82 AC_MSG_RESULT([found in $KERNEL_HDR])
85 AC_MSG_CHECKING(kernel configuration)
86 if test -f $MODULES_DIR/build/.config
88 tmp=`cat $MODULES_DIR/build/.config | grep CONFIG_MODVERSIONS=y`
91 AC_MSG_RESULT([found, using modversions])
92 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
94 AC_MSG_RESULT([found, not using modversions])
97 AC_MSG_RESULT([not found at $MODULES_DIR/build/.config, assuming modversions support])
98 MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
101 AC_ARG_ENABLE(modversions,
102 [ --enable-modversions enable modeversions support (default=auto-detect)],
103 [ if test $enableval = "yes"; then MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"; else MODV_FLAGS=""; fi ],)
107 AC_SUBST(MODULES_DIR)
117 [ --enable-debug enable debug messages to stdout (default=no)],
118 [ 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"],
119 [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"])
120 AC_SUBST(DEBUG_FLAGS)
122 AC_ARG_ENABLE(kdebug,
123 [ --enable-kdebug enable kernel module debug messages (default=no)],
124 [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], )
125 AC_SUBST(KDEBUG_FLAGS)
127 AC_ARG_ENABLE(autofs-install,
128 [ --enable-autofs-install enable installing of autofs configuration (default=no)],
129 [ AUTOFS_INSTALL="yes"],)
130 AC_SUBST(AUTOFS_INSTALL)
133 [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)],
134 [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" )
139 AC_MSG_CHECKING(for ssh)
141 [ --with-ssh=PATH specify the path to the ssh executable],
143 if test "$CXX" = "false"
145 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of sshfs.])
148 if test ! -x "$SSHPROG"
150 AC_MSG_ERROR([Specified --with-ssh $SSHPROG is not executable.])
153 if test "$CXX" = "false"
157 if which ssh 2>/dev/null
165 if test "$SSHPROG" = "no"
167 AC_MSG_RESULT([not found (sshfs support disabled)])
169 AC_MSG_RESULT([found ($SSHPROG)])
170 AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.])
171 opt_fs="$opt_fs sshfs"
177 if test "$CXX" != "false"
179 AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
180 AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
181 AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
182 if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
184 AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
186 GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
187 GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
188 opt_fs="$opt_fs gvfs"
192 AC_SUBST(GVFS_CFLAGS)
195 [ --enable-wavfs build wavfs support (default=no)],
197 if test "$CXX" = "false"
199 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of wavfs.])
201 opt_fs="$opt_fs wavfs"
206 [ --enable-cefs build cefs support (default=no)],
208 if test "$CXX" = "false"
210 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of cefs.])
212 opt_fs="$opt_fs cefs"
215 if test -n "$cefs_dir"; then
216 AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.])
217 AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library])
220 AC_ARG_ENABLE(cardfs,
221 [ --enable-cardfs build cardfs support (default=no)],
222 [ WITH_CARDFS=true ],)
224 dnl Checks for libraries.
225 AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs))
228 dnl Checks for header files.
230 AC_CHECK_HEADERS(unistd.h)
233 dnl This will test for endian-swapping headers
234 AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h)
237 dnl Checks for typedefs, structures, and compiler characteristics.
241 dnl Checks for library functions.
242 AC_CHECK_FUNCS(mkdir rmdir)
244 if test -n "$WITH_CARDFS"; then
245 echo checking for cardfs
246 if test "$CXX" = "false"
248 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of cardfs.])
250 AC_MSG_CHECKING(for libchipcard)
251 AC_ARG_WITH(chipcard-dir,
252 [ --with-chipcard-dir=DIR uses libchipcard from given dir],
254 [cc_dir="/usr/local/libchipcard \
259 for li in $cc_dir; do
260 if test -x "$li/bin/libchipcard-config"; then
264 if test -z "$chipcard_dir"; then
265 AC_MSG_RESULT([not found (chipcard support disabled)])
267 all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`"
268 all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`"
269 AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.])
270 define_has_libchipcard="#define HAS_LIBCHIPCARD"
271 AC_SUBST(define_has_libchipcard)
272 LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs"
273 LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`"
274 AC_MSG_RESULT($chipcard_dir)
275 all_libraries="$all_libraries $libchipcard_libs"
276 all_includes="$all_includes $libchipcard_includes"
277 opt_fs="$opt_fs cardfs"
280 AC_SUBST(LIBCHIPCARD_LIB)
281 AC_SUBST(LIBCHIPCARD_INCLUDES)
283 all_includes="$all_includes -I`pwd`/include"
286 AC_SUBST(all_includes)
287 AC_SUBST(all_libraries)
292 filesystems/Makefile \
293 filesystems/localfs/Makefile \
294 filesystems/locasefs/Makefile \
295 filesystems/sshfs/Makefile \
296 filesystems/ftpfs/Makefile \
297 filesystems/cardfs/Makefile \
298 filesystems/cefs/Makefile \
299 filesystems/cefs/asyncd/Makefile \
300 filesystems/gvfs/Makefile \
301 filesystems/gnetfs/Makefile \
302 filesystems/wavfs/Makefile \
305 kernel/Linux/Makefile \
306 kernel/Linux/2.4/Makefile \
307 kernel/Linux/2.5/Makefile \
314 echo "###############################################################################"
315 echo " supported filesystems: $opt_fs"
316 echo -n " suid files: "
317 if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi
318 echo "###############################################################################"