VFS: cleaned up smbfs.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Enrico Weigelt, metux IT service 2010-07-18 11:32:24 +04:00 committed by Andrew Borodin
parent 67d6ebfd16
commit 9b89d60522
12 changed files with 63 additions and 64 deletions

View File

@ -535,16 +535,11 @@ AC_SUBST(LIBS)
dnl Libraries used only when building the mc binary
AC_SUBST(MCLIBS)
if test -n "$use_smbfs"; then
AC_CONFIG_SUBDIRS([lib/vfs/mc-vfs/samba])
fi
AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
AM_CONDITIONAL(USE_EDIT, [test -n "$use_edit"])
AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
AM_CONDITIONAL(ENABLE_VFS_NET, [test x"$use_net_code" = xtrue])
AM_CONDITIONAL(USE_SAMBA_FS, [test -n "$use_smbfs"])
AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])

View File

@ -1,4 +1,4 @@
if USE_SAMBA_FS
if ENABLE_VFS_SMB
SAMBA_CFLAGS = -DCONFIGDIR=\""@configdir@"\"
SAMBA_SUBDIRS = samba
endif
@ -61,7 +61,7 @@ endif
if ENABLE_VFS_FISH
libvfs_mc_la_SOURCES += $(FISHFILES)
endif
if USE_SAMBA_FS
if ENABLE_VFS_SMB
libvfs_mc_la_SOURCES += $(SMBFILES)
endif

View File

@ -1973,7 +1973,7 @@ vfs_smb_authinfo_new (const char *host, const char *share, const char *domain,
auth->share = g_strdup (share);
auth->domain = g_strdup (domain);
auth->user = g_strdup (user);
auth->password = g_strdup (password);
auth->password = g_strdup (pass);
}
return auth;

View File

@ -68,7 +68,9 @@
#ifdef ENABLE_VFS_FTP
#include "ftpfs.h"
#endif
#ifdef ENABLE_VFS_SMB
#include "smbfs.h"
#endif
#include "local.h"
#if defined(_AIX) && !defined(NAME_MAX)
@ -1416,7 +1418,9 @@ static const struct
{ "sh://", 5, "/#sh:" },
{ "ssh://", 6, "/#sh:" },
#endif
#ifdef ENABLE_VFS_SMB
{ "smb://", 6, "/#smb:" },
#endif
{ "a:", 2, "/#a" }
/* *INDENT-ON* */
};

View File

@ -65,9 +65,6 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[
vfs_type="Midnight Commander Virtual Filesystem"
AC_MSG_NOTICE([Enabling VFS code])
AC_MC_VFS_SAMBA
MC_WITH_VFS
fi
@ -78,6 +75,7 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[
AC_MC_VFS_UNDELFS
AC_MC_VFS_FTP
AC_MC_VFS_FISH
AC_MC_VFS_SMB
AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
])

View File

@ -1,49 +1,47 @@
AC_DEFUN([AC_MC_VFS_SAMBA],
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 "$enable_vfs" != "no" -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])
dnl
dnl Samba support
dnl
use_smbfs=
AC_ARG_WITH(samba,
[ --with-samba Support smb virtual file system [[no]]],
[if test x"$withval" != x"no"; then
AC_DEFINE(ENABLE_VFS_SMB, 1, [Define to enable VFS over SMB])
vfs_flags="$vfs_flags, smbfs"
use_smbfs=yes
fi
])
# set Samba configuration directory location
configdir="/etc"
AC_ARG_WITH([smb-configdir],
AC_HELP_STRING([--with-smb-configdir=DIR], [Where the Samba configuration files are [[/etc]]]),
[ case "$withval" in
yes|no)
# Just in case anybody does it
AC_MSG_WARN([--with-smb-configdir called without argument - will use default])
;;
*)
configdir="$withval"
;;
esac
])
if test -n "$use_smbfs"; then
#################################################
# set Samba configuration directory location
configdir="/etc"
AC_ARG_WITH(configdir,
[ --with-configdir=DIR Where the Samba configuration files are [[/etc]]],
[ case "$withval" in
yes|no)
#
# Just in case anybody does it
#
AC_MSG_WARN([--with-configdir called without argument - will use default])
;;
* )
configdir="$withval"
;;
esac]
)
AC_SUBST(configdir)
AC_ARG_WITH([smb-codepagedir],
AC_HELP_STRING([--with-smb-codepagedir=DIR], [Where the Samba codepage files are]),
[ case "$withval" in
yes|no)
# Just in case anybody does it
AC_MSG_WARN([--with-smb-codepagedir called without argument - will use default])
;;
*)
codepagedir="$withval"
;;
esac
])
AC_ARG_WITH(codepagedir,
[ --with-codepagedir=DIR Where the Samba codepage files are],
[ case "$withval" in
yes|no)
#
# Just in case anybody does it
#
AC_MSG_WARN([--with-codepagedir called without argument - will use default])
;;
esac]
)
fi
AC_SUBST(configdir)
AC_SUBST(codepagedir)
AC_CONFIG_SUBDIRS([lib/vfs/mc-vfs/samba])
fi
AM_CONDITIONAL([ENABLE_VFS_SMB], [test x"$enable_vfs_smb" = x"yes"])
])

View File

@ -48,7 +48,7 @@ mc_LDADD = \
$(MCLIBS) $(SLANGLIB) $(GLIB_LIBS) \
$(PCRE_LIBS) $(LIBICONV) $(INTLLIBS)
if USE_SAMBA_FS
if ENABLE_VFS_SMB
# this is a hack for linking with own samba library in simple way
mc_LDADD += ../lib/vfs/mc-vfs/samba/libsamba.a
endif

View File

@ -34,7 +34,9 @@
#include "lib/tty/mouse.h"
#include "lib/strutil.h"
#include "lib/vfs/mc-vfs/vfs.h"
#ifdef ENABLE_VFS_SMB
#include "lib/vfs/mc-vfs/smbfs.h" /* smbfs_set_debugf() */
#endif
#include "src/main.h"
#include "src/textconf.h"

View File

@ -46,9 +46,9 @@
#ifdef ENABLE_VFS_FTP
#include "lib/vfs/mc-vfs/ftpfs.h"
#endif /* ENABLE_VFS_FTP */
#ifdef USE_NETCODE
#ifdef ENABLE_VFS_SMB
#include "lib/vfs/mc-vfs/smbfs.h"
#endif
#endif /* ENABLE_VFS_SMB */
#include "dialog.h" /* The nice dialog manager */
#include "widget.h" /* The widgets for the nice dialog manager */

View File

@ -23,7 +23,9 @@ void ftplink_cmd (void);
#ifdef ENABLE_VFS_FISH
void fishlink_cmd (void);
#endif
#ifdef ENABLE_VFS_SMB
void smblink_cmd (void);
#endif
void undelete_cmd (void);
void help_cmd (void);
void smart_dirsize_cmd (void);

View File

@ -381,9 +381,9 @@ static name_keymap_t command_names[] = {
{ "CmdReverseSelection", CK_ReverseSelectionCmd },
{ "CmdSaveSetup", CK_SaveSetupCmd },
{ "CmdSelect", CK_SelectCmd },
#if defined (USE_NETCODE) && defined (ENABLE_VFS_SMB)
#ifdef ENABLE_VFS_SMB
{ "CmdSmblinkCmd", CK_SmblinkCmd },
#endif /* USE_NETCODE || ENABLE_VFS_SMB */
#endif
{ "CmdSwapPanel", CK_SwapCmd },
{ "CmdSymlink", CK_SymlinkCmd },
{ "CmdTree", CK_TreeCmd },

View File

@ -672,7 +672,7 @@ create_panel_menu (void)
#ifdef HAVE_CHARSET
entries = g_list_append (entries, menu_entry_create (_("&Encoding..."), CK_PanelSetPanelEncoding));
#endif
#ifdef USE_NETCODE
#if defined(ENABLE_VFS_FTP) || defined(ENABLE_VFS_FISH) || defined(ENABLE_VFS_SMB)
entries = g_list_append (entries, menu_separator_create ());
#ifdef ENABLE_VFS_FTP
entries = g_list_append (entries, menu_entry_create (_("FT&P link..."), CK_FtplinkCmd));
@ -683,7 +683,7 @@ create_panel_menu (void)
#ifdef ENABLE_VFS_SMB
entries = g_list_append (entries, menu_entry_create (_("SM&B link..."), CK_SmblinkCmd));
#endif /* ENABLE_VFS_SMB */
#endif /* USE_NETCODE */
#endif /* ENABLE_VFS_FTP || ENABLE_VFS_FISH || ENABLE_VFS_SMB */
entries = g_list_append (entries, menu_separator_create ());
entries = g_list_append (entries, menu_entry_create (_("&Rescan"), CK_RereadCmd));
@ -1369,11 +1369,11 @@ midnight_execute_cmd (Widget * sender, unsigned long command)
case CK_SingleDirsizeCmd:
smart_dirsize_cmd ();
break;
#if defined (USE_NETCODE) && defined (ENABLE_VFS_SMB)
#ifdef ENABLE_VFS_SMB
case CK_SmblinkCmd:
smblink_cmd ();
break;
#endif /* USE_NETCODE && ENABLE_VFS_SMB */
#endif /* ENABLE_VFS_SMB */
case CK_Sort:
sort_cmd ();
break;