Merge pull request #2948 from ace20022/blu_lang_fix
[vuplus_xbmc] / tools / depends / target / samba / Makefile
1 include ../../Makefile.include
2 DEPS= ../../Makefile.include Makefile samba30-3.0.37-configure.in.patch \
3       samba30-3.0.37-CVE-2010-2063.patch \
4       samba30-3.0.37-silence-receive-warning.patch \
5       samba30-3.0.37-vfs_default.c.patch samba30-3.0.37-wle-fix.patch \
6       samba_android.patch
7
8 # lib name, version
9 LIBNAME=samba
10 VERSION=3.0.37
11 SOURCE=$(LIBNAME)-$(VERSION)
12 ARCHIVE=$(SOURCE).tar.gz
13
14 # configuration settings
15 # android does not really support LFS but we can force it
16 # in libsmbclient by defining off_t to off64_t and changing
17 # libsmbclient.h to match. Defining _OFF_T_DEFINED_ allows
18 # us to change the typedef of off_t in android's sys/type.h.
19 # Then xbmc will correctly access smb shares with LFS enabled
20 # using the altered libsmbclient.h.
21 ifeq ($(OS),android)
22 export CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_OFF_T_DEFINED_ -Doff_t=off64_t -Dlseek=lseek64
23 ANDROID_OFF_T_FIX=sed -ie "s|off_t|off64_t|g" "$(PLATFORM)/source/include/libsmbclient.h"
24 endif
25
26 CONFIGURE= cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \
27           ./configure --prefix=$(PREFIX) \
28         --disable-cups \
29         --enable-static \
30         --disable-shared \
31         --disable-pie \
32         --disable-iprint \
33         --disable-fam \
34         --without-cluster-support \
35         --without-cifsupcall \
36         --without-ads \
37         --without-ldap \
38         --with-included-popt \
39         --with-included-iniparser \
40         --without-sys-quotas \
41         --without-krb5 \
42         --without-automount \
43         --without-sendfile-support \
44         --with-libiconv=$(STAGING_DIR) \
45         --without-cifsmount \
46         --without-winbind \
47
48 LIBDYLIB=$(PLATFORM)/source/bin/libsmbclient.a
49
50 CLEAN_FILES=$(ARCHIVE) $(PLATFORM)
51
52 all: .installed-$(PLATFORM)
53
54 $(TARBALLS_LOCATION)/$(ARCHIVE):
55         cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
56
57 $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
58         rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
59         cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
60         cd $(PLATFORM); patch -p1 < ../samba30-3.0.37-configure.in.patch
61         cd $(PLATFORM); patch -p1 < ../samba30-3.0.37-CVE-2010-2063.patch
62         cd $(PLATFORM); patch -p1 < ../samba30-3.0.37-silence-receive-warning.patch
63         cd $(PLATFORM); patch -p1 < ../samba30-3.0.37-vfs_default.c.patch
64         cd $(PLATFORM); patch -p1 < ../samba30-3.0.37-wle-fix.patch
65         cd $(PLATFORM); patch -p0 < ../samba_android.patch
66         $(ANDROID_OFF_T_FIX)
67         cd $(PLATFORM)/source && ./autogen.sh
68         cd $(PLATFORM)/source; $(CONFIGURE)
69
70 $(LIBDYLIB): $(PLATFORM)
71         $(MAKE) -C $(PLATFORM)/source headers
72         mkdir -p $(PLATFORM)/source/bin
73         $(MAKE) -C $(PLATFORM)/source libsmbclient
74
75 .installed-$(PLATFORM): $(LIBDYLIB)
76         $(MAKE) -C $(PLATFORM)/source installclientlib
77         touch $@
78
79 clean:
80         $(MAKE) -C $(PLATFORM)/source clean
81         rm -f .installed-$(PLATFORM)
82
83 distclean::
84         rm -rf $(PLATFORM) .installed-$(PLATFORM)
85