1include ../common.mak
2
3#srcdir=source
4srcdir=source3
5
6SMBCFLAGS = $(EXTRACFLAGS) -Os -ffunction-sections -fdata-sections
7SMBLDFLAGS = -ffunction-sections -fdata-sections -Wl,--gc-sections
8
9ifeq ($(RTCONFIG_BCMARM), y)
10SMBCFLAGS += -DBCMARM
11SMBLDFLAGS += -lgcc_s
12endif
13
14SMBLDFLAGS += -ldl
15
16ifneq ($(CONFIG_LINUX26),y)
17SMBCFLAGS += -DMAX_DEBUG_LEVEL="-1"
18endif
19
20ifeq ($(RTCONFIG_BCMARM), y)
21HOST = arm
22else
23HOST = mips
24endif
25
26all: .conf apps
27
28apps: .conf
29	mkdir -p $(srcdir)/bin
30	$(MAKE) -C $(srcdir) all
31
32.conf:
33	cd $(srcdir) && \
34	ac_cv_lib_resolv_dn_expand=no \
35	ac_cv_lib_resolv__dn_expand=no \
36	ac_cv_lib_resolv___dn_expand=no \
37	ac_cv_func_prctl=no \
38	SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \
39	linux_getgrouplist_ok=no \
40	samba_cv_fpie=no \
41	samba_cv_have_longlong=yes \
42	samba_cv_HAVE_INO64_T=yes \
43	samba_cv_HAVE_OFF64_T=yes \
44	samba_cv_HAVE_STRUCT_FLOCK64=yes \
45	samba_cv_SIZEOF_OFF_T=yes \
46	samba_cv_HAVE_MMAP=yes \
47	samba_cv_HAVE_FTRUNCATE_EXTEND=yes \
48	samba_cv_REPLACE_READDIR=no \
49	samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no \
50	samba_cv_HAVE_SENDFILE=yes \
51	samba_cv_HAVE_WRFILE_KEYTAB=yes \
52	samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes \
53	samba_cv_HAVE_IFACE_IFCONF=yes \
54	samba_cv_have_setresgid=yes \
55	samba_cv_have_setresuid=yes \
56	samba_cv_USE_SETRESUID=yes \
57	samba_cv_USE_SETREUID=yes \
58	samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \
59	samba_cv_REALPATH_TAKES_NULL=no \
60	samba_cv_HAVE_FCNTL_LOCK=yes \
61	samba_cv_HAVE_SECURE_MKSTEMP=yes \
62	samba_cv_HAVE_NATIVE_ICONV=no \
63	samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no \
64	samba_cv_HAVE_BROKEN_GETGROUPS=no \
65	samba_cv_HAVE_BROKEN_READDIR_NAME=no \
66	samba_cv_HAVE_C99_VSNPRINTF=yes \
67	samba_cv_HAVE_DEV64_T=no \
68	samba_cv_HAVE_DEVICE_MAJOR_FN=yes \
69	samba_cv_HAVE_DEVICE_MINOR_FN=yes \
70	samba_cv_HAVE_IFACE_AIX=no \
71	samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes \
72	samba_cv_HAVE_KERNEL_SHARE_MODES=yes \
73	samba_cv_HAVE_MAKEDEV=yes \
74	samba_cv_HAVE_TRUNCATED_SALT=no \
75	samba_cv_HAVE_UNSIGNED_CHAR=no \
76	samba_cv_HAVE_WORKING_AF_LOCAL=yes \
77	samba_cv_HAVE_Werror=yes \
78	samba_cv_REPLACE_INET_NTOA=no \
79	samba_cv_SIZEOF_DEV_T=yes \
80	samba_cv_SIZEOF_INO_T=yes \
81	samba_cv_SIZEOF_TIME_T=no \
82	samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \
83	CPPFLAGS="-DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D_LARGE_FILES=1" \
84	CFLAGS="$(SMBCFLAGS)" LDFLAGS="$(SMBLDFLAGS)" CC=$(CC) LD=$(LD) AR=$(AR) RANLIB=$(RANLIB) \
85	$(CONFIGURE) \
86		--prefix=/usr \
87		--bindir=/usr/bin \
88		--sbindir=/usr/sbin \
89		--libdir=/etc \
90		--localstatedir=/var \
91		--host=$(HOST)-linux \
92		--with-configdir=/etc \
93		--with-rootsbindir=/usr/sbin \
94		--with-piddir=/var/run/samba \
95		--with-privatedir=/etc/samba \
96		--with-lockdir=/var/lock \
97		--with-syslog \
98		--with-included-popt=no \
99		--with-krb5=no \
100		--with-libsmbclient=yes \
101		--with-shared-modules=MODULES \
102		--disable-static \
103		--disable-cups \
104		--disable-iprint \
105		--disable-pie \
106		--disable-fam \
107		--disable-dmalloc \
108		--disable-krb5developer \
109		--disable-developer \
110		--disable-debug \
111		--without-ads \
112		--without-acl-support \
113		--without-ldap \
114		--without-cifsmount \
115		--without-cifsupcall \
116		--without-cluster-support \
117		--without-utmp \
118		--without-winbind \
119		--without-quotas \
120		--without-sys-quotas
121	touch .conf
122	mkdir -p $(srcdir)/bin
123
124clean:
125	-$(MAKE) -C $(srcdir) distclean
126	@rm -f .conf
127
128distclean: clean
129	@find $(srcdir) -name config.h | xargs rm -f
130	@find $(srcdir) -name Makefile | xargs rm -f
131	@find $(srcdir) -name config.status | xargs rm -f
132	@find $(srcdir) -name config.cache | xargs rm -f
133
134install: all
135	@install -d $(INSTALLDIR)/usr/bin/
136	@install -d $(INSTALLDIR)/usr/sbin/
137	@install -d $(INSTALLDIR)/usr/lib/
138	@install -D $(srcdir)/bin/libsmbclient.so.0 $(INSTALLDIR)/usr/lib/libsmbclient.so.0
139	@ln -sf libsmbclient.so.0 $(INSTALLDIR)/usr/lib/libsmbclient.so
140#	@install -D $(srcdir)/bin/libbigballofmud.so $(INSTALLDIR)/usr/lib/libbigballofmud.so
141###############################Charles Modify##########	
142
143	$(STRIP) -s $(INSTALLDIR)/usr/lib/libsmbclient.so.0
144	# do not strip shared library, it will be optimized by libfoo.pl
145	# $(STRIP) -s $(INSTALLDIR)/usr/lib/libbigballofmud.so
146