Permalink
Browse files

Merge pull request #427 from sraue/optional-samba

configure: let select samba support, this patch adds a configure option to en/disable samba support in xbmc. this is usefull if xbmc is not used as a full mediacenter (kiosk systems, embedded systems) where a minimal OS is needed (not using libsmbclient can save around 6MB) or to restrict samba access from xbmc for various reasons. samba support is enabled by default and configure breaks with missing_library if libsmbclient is not found and samba support is not explicity disabled at configure time. on windows samba support is fully enabled
  • Loading branch information...
2 parents 8d7aebd + 6e37158 commit 1d0c129c8a05f531b3db1cc0b475fee2a6ae32ab @sraue sraue committed Sep 19, 2011
View
@@ -111,6 +111,7 @@ libnfs_not_found="== Could not find libnfs. NFS support disabled. =="
libnfs_disabled="== NFS support disabled. =="
libafpclient_not_found="== Could not find libafpclient. AFP support disabled. =="
libafpclient_disabled="== AFP support disabled. =="
+samba_disabled="== SAMBA support disabled. =="
alsa_not_found="== Could not find ALSA. ALSA support disabled. =="
dbus_not_found="== Could not find DBUS. DBUS support disabled. =="
@@ -270,6 +271,12 @@ AC_ARG_ENABLE([rtmp],
[use_librtmp=$enableval],
[use_librtmp=auto])
+AC_ARG_ENABLE([samba],
+ [AS_HELP_STRING([--disable-samba],
+ [disable SAMBA support (default is enabled)])],
+ [use_samba=$enableval],
+ [use_samba=yes])
+
AC_ARG_ENABLE([nfs],
[AS_HELP_STRING([--enable-nfs],
[enable NFS support via libnfs (default is auto)])],
@@ -647,7 +654,6 @@ AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
-AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
AC_CHECK_LIB([yajl], [main],, AC_MSG_ERROR($missing_library))
@@ -934,6 +940,21 @@ else
AC_MSG_NOTICE($librtmp_disabled)
fi
+# samba
+if test "x$use_samba" != "xno"; then
+ AC_CHECK_LIB([smbclient], [main],,
+ use_samba=no;AC_MSG_ERROR($missing_library))
+ USE_LIBSMBCLIENT=0
+else
+ AC_MSG_RESULT($samba_disabled)
+ USE_LIBSMBCLIENT=0
+fi
+
+if test "x$use_samba" != "xno"; then
+ AC_DEFINE([HAVE_LIBSMBCLIENT], [1], [Define to 1 if you have Samba installed])
+ USE_LIBSMBCLIENT=1
+fi
+
# libnfs
if test "$use_libnfs" != "no"; then
AC_CHECK_HEADERS([nfsc/libnfs.h],,
@@ -1562,6 +1583,12 @@ else
final_message="$final_message\n libRTMP support:\tNo"
fi
+if test "x$use_samba" != "xno"; then
+ final_message="$final_message\n libsmbclient support:\tYes"
+else
+ final_message="$final_message\n libsmbclient support:\tNo"
+fi
+
if test "$use_libnfs" != "no"; then
final_message="$final_message\n libnfs support:\tYes"
else
@@ -1683,6 +1710,7 @@ AC_SUBST(USE_OPENGLES)
AC_SUBST(USE_VDPAU)
AC_SUBST(USE_VAAPI)
AC_SUBST(USE_CRYSTALHD)
+AC_SUBST(USE_LIBSMBCLIENT)
AC_SUBST(USE_LIBNFS)
AC_SUBST(USE_LIBAFPCLIENT)
AC_SUBST(USE_VDA)
@@ -237,9 +237,11 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
share1.m_ignore = true;
extraShares.push_back(share1);
+#ifdef HAS_FILESYSTEM_SMB
share1.strPath = "smb://";
share1.strName = g_localizeStrings.Get(20171);
extraShares.push_back(share1);
+#endif
#ifdef HAS_FILESYSTEM_NFS
share1.strPath = "nfs://";
@@ -285,9 +287,11 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
share1.strName = "ReplayTV Devices";
extraShares.push_back(share1);
+#ifdef HAS_FILESYSTEM_SMB
share1.strPath = "smb://";
share1.strName = g_localizeStrings.Get(20171);
extraShares.push_back(share1);
+#endif
#ifdef HAS_FILESYSTEM_NFS
share1.strPath = "nfs://";
@@ -322,9 +326,11 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
extraShares.push_back(share1);
}
+#ifdef HAS_FILESYSTEM_SMB
share1.strPath = "smb://";
share1.strName = g_localizeStrings.Get(20171);
extraShares.push_back(share1);
+#endif
#ifdef HAS_FILESYSTEM_NFS
share1.strPath = "nfs://";
@@ -24,8 +24,6 @@
//////////////////////////////////////////////////////////////////////
#include "system.h"
-
-#if defined(HAS_FILESYSTEM_SMB)
#include "FileSmb.h"
#include "PasswordManager.h"
#include "SMBDirectory.h"
@@ -777,4 +775,3 @@ CStdString CFileSMB::GetAuthenticatedPath(const CURL &url)
CPasswordManager::GetInstance().AuthenticateURL(authURL);
return smb.URLEncode(authURL);
}
-#endif
@@ -31,7 +31,6 @@ SRCS=AddonsDirectory.cpp \
FileRTV.cpp \
FileShoutcast.cpp \
FileSFTP.cpp \
- FileSmb.cpp \
FileSpecialProtocol.cpp \
FileTuxBox.cpp \
FileUDF.cpp \
@@ -70,7 +69,6 @@ SRCS=AddonsDirectory.cpp \
SIDFileDirectory.cpp \
Slingbox.cpp \
SmartPlaylistDirectory.cpp \
- SMBDirectory.cpp \
SourcesDirectory.cpp \
SpecialProtocol.cpp \
SpecialProtocolDirectory.cpp \
@@ -93,6 +91,11 @@ SRCS+=RarDirectory.cpp
SRCS+=RarManager.cpp
endif
+ifeq (@USE_LIBSMBCLIENT@,1)
+SRCS+=FileSmb.cpp
+SRCS+=SMBDirectory.cpp
+endif
+
ifeq (@USE_LIBNFS@,1)
SRCS+=FileNFS.cpp
SRCS+=NFSDirectory.cpp
@@ -33,7 +33,6 @@
#include "system.h"
-#if defined(HAS_FILESYSTEM_SMB)
#include "SMBDirectory.h"
#include "Util.h"
#include "guilib/LocalizeStrings.h"
@@ -501,5 +500,3 @@ CStdString CSMBDirectory::GetMountPoint(const CStdString &strType, const CStdStr
return XBMC_SMB_MOUNT_PATH + strPath;
#endif
}
-
-#endif
@@ -127,7 +127,9 @@ void CGUIDialogNetworkSetup::OnInitWindow()
return;
pSpin->Clear();
+#ifdef HAS_FILESYSTEM_SMB
pSpin->AddLabel(g_localizeStrings.Get(20171), NET_PROTOCOL_SMB);
+#endif
pSpin->AddLabel(g_localizeStrings.Get(20256), NET_PROTOCOL_HTSP);
pSpin->AddLabel(g_localizeStrings.Get(20257), NET_PROTOCOL_VTP);
pSpin->AddLabel(g_localizeStrings.Get(20258), NET_PROTOCOL_MYTH);
@@ -54,7 +54,9 @@ CZeroconfBrowser* CZeroconfBrowser::smp_instance = 0;
CZeroconfBrowser::CZeroconfBrowser():mp_crit_sec(new CCriticalSection),m_started(false)
{
+#ifdef HAS_FILESYSTEM_SMB
AddServiceType("_smb._tcp.");
+#endif
AddServiceType("_ftp._tcp.");
AddServiceType("_htsp._tcp.");
AddServiceType("_daap._tcp.");
View
@@ -52,14 +52,17 @@
#endif
#define HAS_FILESYSTEM
-#define HAS_FILESYSTEM_SMB
#define HAS_FILESYSTEM_CDDA
#define HAS_FILESYSTEM_RTV
#define HAS_FILESYSTEM_DAAP
#define HAS_FILESYSTEM_SAP
#define HAS_FILESYSTEM_VTP
#define HAS_FILESYSTEM_HTSP
+#ifdef HAVE_LIBSMBCLIENT
+ #define HAS_FILESYSTEM_SMB
+#endif
+
#ifdef HAVE_LIBNFS
#define HAS_FILESYSTEM_NFS
#endif
@@ -99,6 +102,7 @@
#define HAVE_LIBBLURAY
#define HAS_ASAP_CODEC
#define HAVE_YAJL_YAJL_VERSION_H
+#define HAS_FILESYSTEM_SMB
#define HAS_FILESYSTEM_NFS
#endif

0 comments on commit 1d0c129

Please sign in to comment.