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.7)
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])
71 # MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
73 AC_MSG_RESULT([found, not using modversions])
76 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 MODVERSIONS="yes"; else MODVERSIONS=""; fi ],)
85 if test $MODVERSIONS; then
86 AC_MSG_CHECKING(modversions.h)
87 if test -f $KERNEL_HDR/linux/modversions.h; then
88 MODV_FILE="$KERNEL_HDR/linux/modversions.h"
91 if test -f $KERNEL_HDR/config/modversions.h; then
92 MODV_FILE="$KERNEL_HDR/config/modversions.h"
95 if test $MODV_FILE; then
96 MODV_FLAGS="-DMODVERSIONS -include $MODV_FILE"
97 AC_MSG_RESULT([$MODV_FILE])
99 AC_MSG_ERROR([not found!])
105 AC_SUBST(MODULES_DIR)
115 [ --enable-debug enable debug messages to stdout (default=no)],
116 [ 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"],
117 [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"])
118 AC_SUBST(DEBUG_FLAGS)
120 AC_ARG_ENABLE(kdebug,
121 [ --enable-kdebug enable kernel module debug messages (default=no)],
122 [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], )
123 AC_SUBST(KDEBUG_FLAGS)
125 AC_ARG_ENABLE(autofs-install,
126 [ --enable-autofs-install enable installing of autofs configuration (default=no)],
127 [ AUTOFS_INSTALL="yes"],)
128 AC_SUBST(AUTOFS_INSTALL)
131 [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)],
132 [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" )
137 dnl Checks for programs.
148 AC_MSG_CHECKING(for ssh)
150 [ --with-ssh=PATH specify the path to the ssh executable],
152 [SSHPROG=`which ssh 2>/dev/null`])
153 if test ! -x "$SSHPROG"
155 AC_MSG_RESULT([not found (sshfs support disabled)])
157 AC_MSG_RESULT([found ($SSHPROG)])
158 AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.])
159 opt_fs="$opt_fs sshfs"
165 AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
166 AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
167 AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
168 if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
170 AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
172 GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
173 GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
174 opt_fs="$opt_fs gvfs"
177 AC_SUBST(GVFS_CFLAGS)
180 [ --enable-wavfs build wavfs support (default=no)],
181 [ opt_fs="$opt_fs wavfs"],)
185 [ --enable-cefs build cefs support (default=no)],
186 [ opt_fs="$opt_fs cefs"],)
188 if test -n "$cefs_dir"; then
189 AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.])
190 AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library])
193 AC_ARG_ENABLE(cardfs,
194 [ --enable-cardfs build cardfs support (default=no)],
195 [ WITH_CARDFS=true ],)
197 dnl Checks for libraries.
198 AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs))
201 dnl Checks for header files.
203 AC_CHECK_HEADERS(unistd.h)
206 dnl This will test for endian-swapping headers
207 AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h)
210 dnl Checks for typedefs, structures, and compiler characteristics.
214 dnl Checks for library functions.
215 AC_CHECK_FUNCS(mkdir rmdir)
217 if test -n "$WITH_CARDFS"; then
218 echo checking for cardfs
219 AC_MSG_CHECKING(for libchipcard)
220 AC_ARG_WITH(chipcard-dir,
221 [ --with-chipcard-dir=DIR uses libchipcard from given dir],
223 [cc_dir="/usr/local/libchipcard \
228 for li in $cc_dir; do
229 if test -x "$li/bin/libchipcard-config"; then
233 if test -z "$chipcard_dir"; then
234 AC_MSG_RESULT([not found (chipcard support disabled)])
236 all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`"
237 all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`"
238 AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.])
239 define_has_libchipcard="#define HAS_LIBCHIPCARD"
240 AC_SUBST(define_has_libchipcard)
241 LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs"
242 LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`"
243 AC_MSG_RESULT($chipcard_dir)
244 all_libraries="$all_libraries $libchipcard_libs"
245 all_includes="$all_includes $libchipcard_includes"
246 opt_fs="$opt_fs cardfs"
249 AC_SUBST(LIBCHIPCARD_LIB)
250 AC_SUBST(LIBCHIPCARD_INCLUDES)
252 all_includes="$all_includes -I`pwd`/include"
255 AC_SUBST(all_includes)
256 AC_SUBST(all_libraries)
261 filesystems/Makefile \
262 filesystems/localfs/Makefile \
263 filesystems/locasefs/Makefile \
264 filesystems/sshfs/Makefile \
265 filesystems/ftpfs/Makefile \
266 filesystems/cardfs/Makefile \
267 filesystems/cefs/Makefile \
268 filesystems/cefs/asyncd/Makefile \
269 filesystems/gvfs/Makefile \
270 filesystems/gnetfs/Makefile \
271 filesystems/wavfs/Makefile \
274 kernel/Linux/Makefile \
275 kernel/Linux/2.4/Makefile \
282 echo "###############################################################################"
283 echo " supported filesystems: $opt_fs"
284 echo -n " suid files: "
285 if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi
286 echo "###############################################################################"