1 m4_include([version.m4])
4 AC_INIT([usmb], VERSION_)
5 AC_CONFIG_SRCDIR([usmb.c])
6 AC_CONFIG_HEADERS([config.h])
8 AC_DEFINE([USMB_VERSION],[0x]VERSION_,[usmb version])
9 AC_DEFINE([USMB_VERSION_STATUS],'[VERSION_STATUS_]',[Version status])
11 AC_ARG_ENABLE([debug],
12 [AS_HELP_STRING([--enable-debug],
13 [Build in debug mode (default no)])],
14 [AC_DEFINE([DEBUG], [], [Define to build in debug mode])])
17 [AS_HELP_STRING([--with-samba=prefix],
18 [Location of Samba (i.e. libsmbclient)])],
19 [if test no = $withval ; then
20 AC_MSG_ERROR(Samba is required for building AC_PACKAGE_NAME)
22 CFLAGS="$CFLAGS -I$withval/include"
23 LDFLAGS="$LDFLAGS -L$withval/lib"
26 # Checks for programs.
32 AC_DEFINE([_BSD_SOURCE], [], [Define to use BSD APIs (mandatory)])
33 AC_DEFINE([FUSE_USE_VERSION], [26], [Required FUSE API version])
35 m4_define([UNUSED_],[])
36 m4_define([MUSTCHECK_],[])
38 if test "$GCC" = yes ; then
39 m4_define([UNUSED_], [__attribute__ ((unused))])
40 m4_define([MUSTCHECK_], [__attribute__ ((warn_unused_result))])
41 CFLAGS="$CFLAGS -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations"
44 AC_DEFINE([UNUSED], [UNUSED_], [Marks unused parameters])
45 AC_DEFINE([MUSTCHECK], [MUSTCHECK_],
46 [Marks functions whose result values must not be ignored])
48 # Checks for libraries.
49 AC_CHECK_LIB([smbclient], [smbc_init], [],
50 [AC_MSG_ERROR(Cannot find libsmbclient.)])
52 AC_CHECK_LIB([smbclient], [smbc_getFunctionStatVFS],
53 [AC_DEFINE([HAVE_SAMBA33], [],
54 [Whether we have Samba 3.3 or later])
57 AC_CHECK_LIB([smbclient], [smbc_getFunctionOpen],
58 [AC_DEFINE([HAVE_SAMBA32], [],
59 [Whether we have Samba 3.2 or later])
60 if test "$SAMBA_VERSION" = "" ; then
64 if test "$SAMBA_VERSION" = '' ; then
68 AC_SUBST(SAMBA_VERSION,[$SAMBA_VERSION])
71 PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
72 PKG_CHECK_MODULES([GLIB], [glib-2.0])
73 PKG_CHECK_MODULES([FUSE], [fuse])
76 # Checks for header files.
77 AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdlib.h string.h sys/time.h termios.h unistd.h utime.h])
79 # Checks for typedefs, structures, and compiler characteristics.
87 AC_CHECK_TYPES([ptrdiff_t])
89 # Checks for library functions.
92 AC_CHECK_FUNCS([memset strchr strerror])
94 AC_CONFIG_FILES([Makefile])