mc/m4.include/vfs/mc-vfs-samba.m4
Andrew Borodin 72ee546a59 Ticket #2419: configure script doesn't set samba configdir.
lib/vfs/mc-vfs/samba/configure can't set the value of SAMBA_CFLAGS
in lib/vfs/mc-vfs/Makefile.am.

The solution: to avoid configuration code duplication, use environment
variables SMBCONFIGDIR and SMBCODEPAGEDIR to set up values of configdir
and codepagedir variables in lib/vfs/mc-vfs/samba/Makefile because
samba configure is child process of main configure.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-03 15:36:47 +03:00

62 lines
1.6 KiB
Plaintext

dnl Samba support
AC_DEFUN([AC_MC_VFS_SMB],
[
AC_ARG_ENABLE([vfs-smb],
AC_HELP_STRING([--enable-vfs-smb], [Support for SMB filesystem [[no]]]),
[
if test "x$enableval" = "xno"; then
enable_vfs_smb=no
else
enable_vfs_smb=yes
fi
],
[enable_vfs_smb=no])
if test "$enable_vfs" = "yes" -a x"$enable_vfs_smb" != x"no"; then
enable_vfs_smb="yes"
AC_MC_VFS_ADDNAME([smb])
AC_DEFINE([ENABLE_VFS_SMB], [1], [Define to enable VFS over SMB])
fi
if test "$enable_vfs_smb" = "yes"; then
AC_CONFIG_SUBDIRS([lib/vfs/mc-vfs/samba])
AM_CONDITIONAL([ENABLE_VFS_SMB], [test "1" = "1"])
# set configuration directory location
smbconfigdir="/etc"
AC_ARG_WITH(smb-configdir,
[ --with-smb-configdir=DIR Where to put configuration files],
[ case "$withval" in
yes|no)
# Just in case anybody does it
AC_MSG_WARN([--with-smb-configdir called without argument - will use default])
;;
*)
smbconfigdir="$withval"
;;
esac])
AC_SUBST(smbconfigdir)
# set codepage directory location
AC_ARG_WITH(smb-codepagedir,
[ --with-smb-codepagedir=DIR Where to put codepage files],
[ case "$withval" in
yes|no)
# Just in case anybody does it
AC_MSG_WARN([--with-smb-codepagedir called without argument - will use default])
;;
*)
smbcodepagedir="$withval"
;;
esac])
# export variable for child process (configure of samba)
export SMBCONFIGDIR="$smbconfigdir"
export SMBCODEPAGEDIR="$smbcodepagedir"
else
AM_CONDITIONAL([ENABLE_VFS_SMB], [test "1" = "2"])
fi
])