1 dnl Process this file with autoconf to produce a configure script.
4 AM_CONFIG_HEADER(config.h)
7 VERSION_EXT=captive7cvs
10 AM_INIT_AUTOMAKE(lufs,$VERSION_BASE$VERSION_EXT)
12 dnl Some Makefiles use additional tests etc.
13 AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"])
16 opt_fs="localfs gnetfs"
18 dnl Checks for programs.
28 [ --with-cxx permit use of C++ compiler for additional filesystems],
31 opt_fs="$opt_fs locasefs ftpfs"
41 if test ! -d kernel/$OS_DIR
43 AC_MSG_ERROR($OS_DIR - not supported!)
45 AC_MSG_RESULT($OS_DIR)
52 [ --enable-debug enable debug messages to stdout (default=no)],
53 [ 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"],
54 [ CXXFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" && CFLAGS="-O2 -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"])
58 [ --enable-kdebug enable kernel module debug messages (default=no)],
59 [ KDEBUG_FLAGS="-DLUFS_DEBUG -DLUFS_VERBOSE" ], )
60 AC_SUBST(KDEBUG_FLAGS)
62 AC_ARG_ENABLE(autofs-install,
63 [ --enable-autofs-install enable installing of autofs configuration (default=no)],
64 [ AUTOFS_INSTALL="yes"],)
65 AC_SUBST(AUTOFS_INSTALL)
68 [ --enable-suid make lufsmnt and lufsumount suid root (default=yes)],
69 [ if test $enableval = "no"; then LUFS_SUID=""; else LUFS_SUID="true"; fi ] , LUFS_SUID="true" )
74 AC_MSG_CHECKING(for ssh)
76 [ --with-ssh=PATH specify the path to the ssh executable],
78 if test "$CXX" = "false"
80 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of sshfs.])
83 if test ! -x "$SSHPROG"
85 AC_MSG_ERROR([Specified --with-ssh $SSHPROG is not executable.])
88 if test "$CXX" = "false"
92 if which ssh 2>/dev/null
100 if test "$SSHPROG" = "no"
102 AC_MSG_RESULT([not found (sshfs support disabled)])
104 AC_MSG_RESULT([found ($SSHPROG)])
105 AC_DEFINE([HAS_SSH], 1 , [Define if ssh is found.])
106 opt_fs="$opt_fs sshfs"
112 if test "$CXX" != "false"
114 AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
115 AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
116 AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
117 if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
119 AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
121 GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
122 GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
123 opt_fs="$opt_fs gvfs"
127 AC_SUBST(GVFS_CFLAGS)
130 [ --enable-wavfs build wavfs support (default=no)],
132 if test "$CXX" = "false"
134 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of wavfs.])
136 opt_fs="$opt_fs wavfs"
141 [ --enable-cefs build cefs support (default=no)],
143 if test "$CXX" = "false"
145 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of cefs.])
147 opt_fs="$opt_fs cefs"
150 if test -n "$cefs_dir"; then
151 AC_DEFINE([HAS_CEFS], 1, [Define if cefs is to be built.])
152 AC_DEFINE([INFOFILE], ["/tmp/cedevices"], [Path to the information file for the RAPI library])
155 AC_ARG_ENABLE(cardfs,
156 [ --enable-cardfs build cardfs support (default=no)],
157 [ WITH_CARDFS=true ],)
159 dnl Checks for libraries.
160 AC_CHECK_LIB(pthread, pthread_detach,,AC_MSG_ERROR(libpthread is needed by lufs))
163 dnl Checks for header files.
165 AC_CHECK_HEADERS(unistd.h)
168 dnl This will test for endian-swapping headers
169 AC_CHECK_HEADERS(byteswap.h sys/byteswap.h endian.h machine/endian.h sys/types.h)
172 dnl Checks for typedefs, structures, and compiler characteristics.
176 dnl Checks for library functions.
177 AC_CHECK_FUNCS(mkdir rmdir)
179 if test -n "$WITH_CARDFS"; then
180 echo checking for cardfs
181 if test "$CXX" = "false"
183 AC_MSG_ERROR([Use --with-cxx to permit C++ compilation of cardfs.])
185 AC_MSG_CHECKING(for libchipcard)
186 AC_ARG_WITH(chipcard-dir,
187 [ --with-chipcard-dir=DIR uses libchipcard from given dir],
189 [cc_dir="/usr/local/libchipcard \
194 for li in $cc_dir; do
195 if test -x "$li/bin/libchipcard-config"; then
199 if test -z "$chipcard_dir"; then
200 AC_MSG_RESULT([not found (chipcard support disabled)])
202 all_libraries="$all_libraries `$chipcard_dir/bin/libchipcard-config --libraries`"
203 all_includes="$all_includes `$chipcard_dir/bin/libchipcard-config --includes`"
204 AC_DEFINE([HAS_LIBCHIPCARD], 1, [Define if libchipcard is present.])
205 define_has_libchipcard="#define HAS_LIBCHIPCARD"
206 AC_SUBST(define_has_libchipcard)
207 LIBCHIPCARD_LIB="`$chipcard_dir/bin/libchipcard-config --libraries` -lcardfs"
208 LIBCHIPCARD_INCLUDES="`$chipcard_dir/bin/libchipcard-config --includes`"
209 AC_MSG_RESULT($chipcard_dir)
210 all_libraries="$all_libraries $libchipcard_libs"
211 all_includes="$all_includes $libchipcard_includes"
212 opt_fs="$opt_fs cardfs"
215 AC_SUBST(LIBCHIPCARD_LIB)
216 AC_SUBST(LIBCHIPCARD_INCLUDES)
218 all_includes="$all_includes -I`pwd`/include"
221 AC_SUBST(all_includes)
222 AC_SUBST(all_libraries)
228 filesystems/Makefile \
229 filesystems/localfs/Makefile \
230 filesystems/locasefs/Makefile \
231 filesystems/sshfs/Makefile \
232 filesystems/ftpfs/Makefile \
233 filesystems/cardfs/Makefile \
234 filesystems/cefs/Makefile \
235 filesystems/cefs/asyncd/Makefile \
236 filesystems/gvfs/Makefile \
237 filesystems/gnetfs/Makefile \
238 filesystems/wavfs/Makefile \
241 kernel/Linux/Makefile \
242 kernel/Linux/2.4/Makefile \
243 kernel/Linux/2.6/Makefile \
244 kernel/Linux/modbin/Makefile \
249 kernel/Linux/prepmod \
251 kernel/Linux/2.4/makefile \
252 kernel/Linux/2.6/makefile \
255 echo "###############################################################################"
256 echo " supported filesystems: $opt_fs"
257 echo -n " suid files: "
258 if test $LUFS_SUID; then echo "lufsmnt & lufsumount."; else echo "none."; fi
259 echo "###############################################################################"