diff --git a/configure.ac b/configure.ac index 46a1e466f..05d490c36 100644 --- a/configure.ac +++ b/configure.ac @@ -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"]) diff --git a/lib/vfs/mc-vfs/Makefile.am b/lib/vfs/mc-vfs/Makefile.am index 07de3069b..d7f154196 100644 --- a/lib/vfs/mc-vfs/Makefile.am +++ b/lib/vfs/mc-vfs/Makefile.am @@ -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 diff --git a/lib/vfs/mc-vfs/smbfs.c b/lib/vfs/mc-vfs/smbfs.c index 3ecde027d..e85a70c9f 100644 --- a/lib/vfs/mc-vfs/smbfs.c +++ b/lib/vfs/mc-vfs/smbfs.c @@ -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; diff --git a/lib/vfs/mc-vfs/vfs.c b/lib/vfs/mc-vfs/vfs.c index 61511a475..5f78ce699 100644 --- a/lib/vfs/mc-vfs/vfs.c +++ b/lib/vfs/mc-vfs/vfs.c @@ -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* */ }; diff --git a/m4.include/mc-vfs.m4 b/m4.include/mc-vfs.m4 index 3e1f8edb7..f388ac03f 100644 --- a/m4.include/mc-vfs.m4 +++ b/m4.include/mc-vfs.m4 @@ -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"]) ]) diff --git a/m4.include/vfs/mc-vfs-samba.m4 b/m4.include/vfs/mc-vfs-samba.m4 index 4405dc85c..db1ad8bc5 100644 --- a/m4.include/vfs/mc-vfs-samba.m4 +++ b/m4.include/vfs/mc-vfs-samba.m4 @@ -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"]) ]) diff --git a/src/Makefile.am b/src/Makefile.am index 8af25cb7c..229be59f3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/args.c b/src/args.c index 74f8050d2..54a819a83 100644 --- a/src/args.c +++ b/src/args.c @@ -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" diff --git a/src/boxes.c b/src/boxes.c index 6a17c8893..aee991cbf 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -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 */ diff --git a/src/cmd.h b/src/cmd.h index 6a8e09657..c47cc98af 100644 --- a/src/cmd.h +++ b/src/cmd.h @@ -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); diff --git a/src/keybind.c b/src/keybind.c index 14010a444..25c0b9fee 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -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 }, diff --git a/src/main.c b/src/main.c index b3b208d72..6f8475249 100644 --- a/src/main.c +++ b/src/main.c @@ -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;