(copy_dir_dir): get rid of extra string duplication.
[midnight-commander.git] / m4.include / vfs / mc-vfs-samba.m4
blob1c7960aacf028cb7a2f8073630505cf85906bc62
1 dnl Samba support
2 AC_DEFUN([AC_MC_VFS_SMB],
4     AC_ARG_ENABLE([vfs-smb],
5                 AS_HELP_STRING([--enable-vfs-smb], [Support for SMB filesystem @<:@no@:>@]),
6                 [
7                     if test "x$enableval" = "xno"; then
8                         enable_vfs_smb=no
9                     else
10                         enable_vfs_smb=yes
11                     fi
12                 ],
13                 [enable_vfs_smb=no])
15     if test "$enable_vfs" = "yes" -a x"$enable_vfs_smb" != x"no"; then
16         enable_vfs_smb="yes"
17         AC_MC_VFS_ADDNAME([smb])
18         AC_DEFINE([ENABLE_VFS_SMB], [1], [Define to enable VFS over SMB])
19     fi
21     if test "$enable_vfs_smb" = "yes"; then
22         AC_CONFIG_SUBDIRS([src/vfs/smbfs/helpers])
24         AM_CONDITIONAL([ENABLE_VFS_SMB], [test "1" = "1"])
26         # set configuration directory location
27         smbconfigdir="/etc"
28         AC_ARG_WITH(smb-configdir,
29                     [  --with-smb-configdir=DIR    Where to put configuration files],
30                     [ case "$withval" in
31                             yes|no)
32                                 # Just in case anybody does it
33                                 AC_MSG_WARN([--with-smb-configdir called without argument - will use default])
34                                 ;;
35                             *)
36                                 smbconfigdir="$withval"
37                                 ;;
38                     esac])
40         AC_SUBST(smbconfigdir)
42         # set codepage directory location
43         AC_ARG_WITH(smb-codepagedir,
44                     [  --with-smb-codepagedir=DIR  Where to put codepage files],
45                     [ case "$withval" in
46                         yes|no)
47                             # Just in case anybody does it
48                             AC_MSG_WARN([--with-smb-codepagedir called without argument - will use default])
49                             ;;
50                         *)
51                             smbcodepagedir="$withval"
52                             ;;
53                  esac])
55         # export variable for child process (configure of samba)
56         export SMBCONFIGDIR="$smbconfigdir"
57         export SMBCODEPAGEDIR="$smbcodepagedir"
58     else
59         AM_CONDITIONAL([ENABLE_VFS_SMB], [test "1" = "2"])
60     fi