2 AC_INIT([usmb], [20100212])
3 AC_CONFIG_SRCDIR([usmb.c])
4 AC_CONFIG_HEADERS([config.h])
7 [AS_HELP_STRING([--enable-debug],
8 [Build in debug mode (default no)])],
9 [AC_DEFINE([DEBUG], [], [Define to build in debug mode])])
12 [AS_HELP_STRING([--with-samba=prefix],
13 [Location of Samba (i.e. libsmbclient)])],
14 [if test no = $withval ; then
15 AC_MSG_ERROR(Samba is required for building AC_PACKAGE_NAME)
17 CFLAGS="$CFLAGS -I$withval/include"
18 LDFLAGS="$LDFLAGS -L$withval/lib"
21 # Checks for programs.
27 AC_DEFINE([_BSD_SOURCE], [], [Define to use BSD APIs (mandatory)])
28 AC_DEFINE([FUSE_USE_VERSION], [26], [Required FUSE API version])
30 m4_define([UNUSED_],[])
31 m4_define([MUSTCHECK_],[])
33 if test "$GCC" = yes ; then
34 m4_define([UNUSED_], [__attribute__ ((unused))])
35 m4_define([MUSTCHECK_], [__attribute__ ((warn_unused_result))])
36 CFLAGS="$CFLAGS -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations"
39 AC_DEFINE([UNUSED], [UNUSED_], [Marks unused parameters])
40 AC_DEFINE([MUSTCHECK], [MUSTCHECK_],
41 [Marks functions whose result values must not be ignored])
43 # Checks for libraries.
44 AC_CHECK_LIB([smbclient], [smbc_init], [],
45 [AC_MSG_ERROR(Cannot find libsmbclient.)])
47 AC_CHECK_LIB([smbclient], [smbc_getFunctionStatVFS],
48 [AC_DEFINE([HAVE_SAMBA33], [],
49 [Whether we have Samba 3.3 or later])
52 AC_CHECK_LIB([smbclient], [smbc_getFunctionOpen],
53 [AC_DEFINE([HAVE_SAMBA32], [],
54 [Whether we have Samba 3.2 or later])
55 if test "$SAMBA_VERSION" = "" ; then
59 if test "$SAMBA_VERSION" = '' ; then
63 AC_SUBST(SAMBA_VERSION,[$SAMBA_VERSION])
66 PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
67 PKG_CHECK_MODULES([GLIB], [glib-2.0])
68 PKG_CHECK_MODULES([FUSE], [fuse])
71 # Checks for header files.
72 AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdlib.h string.h sys/time.h termios.h unistd.h utime.h])
74 # Checks for typedefs, structures, and compiler characteristics.
82 AC_CHECK_TYPES([ptrdiff_t])
84 # Checks for library functions.
87 AC_CHECK_FUNCS([memset strchr strerror])
89 AC_CONFIG_FILES([Makefile])