Makefile revision 5680
168N/A#
168N/A# CDDL HEADER START
168N/A#
292N/A# The contents of this file are subject to the terms of the
295N/A# Common Development and Distribution License (the "License").
168N/A# You may not use this file except in compliance with the License.
168N/A#
168N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
168N/A# or http://www.opensolaris.org/os/licensing.
292N/A# See the License for the specific language governing permissions
292N/A# and limitations under the License.
292N/A#
292N/A# When distributing Covered Code, include this CDDL HEADER in each
168N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
168N/A# If applicable, add the following below this CDDL HEADER, with the
168N/A# fields enclosed by brackets "[]" replaced with your own identifying
292N/A# information: Portions Copyright [yyyy] [name of copyright owner]
292N/A#
292N/A# CDDL HEADER END
292N/A#
292N/A
292N/A#
292N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
292N/A#
292N/A
292N/Ainclude ../../make-rules/shared-macros.mk
292N/A
168N/A# Samba does not work properly on i386 when built by studio with -xO3+.
168N/Aifeq ($(MACH), sparc)
168N/A# standard options
168N/Aelse
168N/A# Both SPRO_VROOT and studio_OPT vars must use the override keyword otherwise
168N/A# Userland will ignore it and use its default value.
168N/A# To use the older 12.3 compiler instead of the default 12.4 compiler uncomment
168N/A# the following line.
168N/A#override SPRO_VROOT = $(SPRO_ROOT)/solarisstudio12.3
168N/Aoverride studio_OPT = -xO1
168N/Aendif
168N/A
168N/ACOMPONENT_NAME= samba
168N/ACOMPONENT_VERSION= 4.1.22
168N/ATPNO= 26541
168N/ACOMPONENT_ARCHIVE_HASH= sha256:5563a1c94a2dac837ccffd1f0821bb25e097affaa7389fef186f9cfb3486cfe5
168N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
168N/ACOMPONENT_PROJECT_URL= http://www.samba.org/
168N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
168N/ACOMPONENT_ARCHIVE_URL= https://download.samba.org/pub/samba/stable/$(COMPONENT_ARCHIVE)
295N/ACOMPONENT_BUGDB= utility/samba
168N/A
168N/Ainclude $(WS_MAKE_RULES)/prep.mk
168N/A
168N/A# waf
295N/AWAF_PATH = PATH=$(BUILD_DIR)/samba/buildtools/bin:$(PROTO_DIR)/usr/bin:$$PATH
295N/A# Verbosed waf produces unreadable output if parallelized.
295N/A# Uncomment to enable verbose build.
295N/A#override WAFOPT1 = -v -j1
295N/A
295N/A# Set build dirs for Samba + Winbind / Winbind (without Samba).
168N/ABUILD_DIR_SMB = $(BUILD_DIR)/samba
168N/ABUILD_DIR_WINB = $(BUILD_DIR)/winbind
168N/A
168N/A# Depends on S12-only libraries from Desktop to build.
168N/Aifeq ($(BUILD_TYPE), evaluation)
168N/APUBLISH_STAMP=
168N/Aendif
168N/Ainclude $(WS_MAKE_RULES)/ips.mk
168N/A
168N/A# directory to search for "include" in samba.p5m
168N/APKG_OPTIONS += -I $(COMPONENT_DIR)
168N/A
168N/A# Oracle HSM is not supported on 12.0 yet but the libsam.so target should rather be commented out than removed
168N/A# (note) change compiler bitness here when Samba became 64bits
168N/A#$(PROTO_DIR)/opt/SUNWsamfs/lib/$(MACH64)/libsam.so: Solaris/libsam.c
168N/A# $(MKDIR) $(@D)
168N/A# $(CC.studio.64) -m64 -G $(studio_PIC) -hlibsam.so Solaris/libsam.c \
168N/A# -I$(COMPONENT_DIR)/Solaris/include \
168N/A# -o $@
168N/A
168N/A# Samba 4 needs extension of krb5 API, which is implemented in a Samba private
168N/A# library libgssapi_krb5.so. Once MIT Kerberos is updated in Solaris 12 to
295N/A# version 1.9 or higher this extension will no longer be needed
168N/A# see Bug 18308792 for details.
295N/A$(PROTO_DIR)/usr/lib/samba/libgssapi_krb5.so: Solaris/dummy.c
168N/A $(MKDIR) $(@D)
168N/A $(CC.studio.32) -m32 -G $(studio_PIC) -hlibgssapi_krb5.so Solaris/dummy.c \
168N/A -R/usr/lib/gss \
168N/A -M$(COMPONENT_DIR)/Solaris/gssapi_krb5-mapfile-vers \
168N/A -o $@
295N/A
168N/A$(PROTO_DIR)/usr/lib/samba/$(MACH64)/libgssapi_krb5.so: Solaris/dummy.c
168N/A $(MKDIR) $(@D)
168N/A $(CC.studio.64) -m64 -G $(studio_PIC) -hlibgssapi_krb5.so Solaris/dummy.c \
168N/A -R/usr/lib/gss/$(MACH64) \
168N/A -M$(COMPONENT_DIR)/Solaris/gssapi_krb5-mapfile-vers \
168N/A -o $@
168N/A
168N/A$(PROTO_DIR)/usr/include/gssapi/gssapi_krb5.h: Solaris/gssapi_krb5.h
168N/A $(MKDIR) $(@D)
168N/A $(CP) Solaris/gssapi_krb5.h $@
168N/A
168N/A$(PROTO_DIR)/usr/bin/krb5-config: Solaris/krb5-config
168N/A $(MKDIR) $(@D)
168N/A sed -e "s#_SAMBA_BUILD_PROTO_#$(PROTO_DIR)#" \
168N/A $(COMPONENT_DIR)/Solaris/krb5-config > $@
168N/A $(CHMOD) 755 $@
168N/A
168N/A# Compiler settings
168N/ACFLAGS.studio += $(studio_C99_ENABLE)
168N/A
168N/ALIBS += -lrt -lsec -lcrypt -lmd5 -lsocket -lnsl
168N/A# More libs needed by smbd (libavahi, libgamin, ...)
168N/ALIBS4SMBD = -lsendfile -lavahi-common -lavahi-core
168N/A
168N/A#CPPFLAGS += -DSAMBA_VERSION_VENDOR_SUFFIX=\\\"Placeholder_for_vendor_suffix\\\"
168N/ACPPFLAGS += $(CPP_LARGEFILES)
168N/ACPPFLAGS += $(CPP_XPG6MODE)
168N/ACPPFLAGS += -I/usr/include/openldap
168N/A
168N/ALDFLAGS += -m$(BITS)
168N/ALDFLAGS += -R/usr/lib/samba$(MACHLIBDIR)
168N/ALDFLAGS += -R/usr/lib/samba/private$(MACHLIBDIR)
168N/ALDFLAGS += $(LIBS)
168N/A$(BUILD_DIR_SMB)/.configured: LDFLAGS += $(LIBS4SMBD)
168N/A
168N/AASLR_MODE = $(ASLR_ENABLE)
168N/ALD_OPTIONS += $(LD_B_DIRECT)
168N/A
168N/A# --enable-fhs should not be on
168N/ACONFIGURE_OPTIONS = --exec-prefix=/usr
168N/ACONFIGURE_OPTIONS += --bindir=/usr/lib/samba/bin
168N/ACONFIGURE_OPTIONS += --sbindir=/usr/lib/samba/sbin
168N/ACONFIGURE_OPTIONS += --libdir=/usr/lib/samba$(MACHLIBDIR)
168N/ACONFIGURE_OPTIONS += --with-privatelibdir=/usr/lib/samba/private$(MACHLIBDIR)
168N/ACONFIGURE_OPTIONS += --sysconfdir=/etc/samba
168N/ACONFIGURE_OPTIONS += --with-pammodulesdir=/usr/lib/samba/security$(MACHLIBDIR)
168N/ACONFIGURE_OPTIONS += --datarootdir=/usr/lib/samba
168N/ACONFIGURE_OPTIONS += --mandir=/usr/share/man
295N/ACONFIGURE_OPTIONS += --htmldir=/usr/share/samba/swat/help
295N/ACONFIGURE_OPTIONS += --includedir=/usr/include/samba
168N/ACONFIGURE_OPTIONS += --with-privatedir=/etc/samba/private
168N/ACONFIGURE_OPTIONS += --localstatedir=/var/samba
168N/ACONFIGURE_OPTIONS += --with-logfilebase=/var/samba/log
295N/ACONFIGURE_OPTIONS += --sharedstatedir=/var/samba/com
295N/ACONFIGURE_OPTIONS += --libexecdir=/usr/lib/samba
168N/A
168N/ACONFIGURE_OPTIONS += --with-static-modules=
168N/A$(BUILD_DIR_SMB)/.configured: CONFIGURE_OPTIONS += \
295N/A --with-shared-modules=vfs_worm,vfs_zfsacl,vfs_prealloc,vfs_cacheprime,vfs_commit,idmap_ldap,idmap_tdb2,idmap_rid,idmap_ad,idmap_hash,idmap_adex,vfs_solarisacl
295N/A$(BUILD_DIR_WINB)/.configured: CONFIGURE_OPTIONS += \
295N/A --with-shared-modules=idmap_ldap,idmap_tdb2,idmap_rid,idmap_ad,idmap_hash,idmap_adex
295N/ACONFIGURE_OPTIONS += --with-ads
295N/ACONFIGURE_OPTIONS += --with-winbind
295N/ACONFIGURE_OPTIONS += --enable-nss-wrapper
295N/ACONFIGURE_OPTIONS += --with-ldap
295N/ACONFIGURE_OPTIONS += --with-libldap=ldap_r
295N/ACONFIGURE_OPTIONS += --with-system-mitkrb5
295N/ACONFIGURE_OPTIONS += --without-ad-dc
295N/A
295N/ACONFIGURE_OPTIONS += --nocache
295N/ACONFIGURE_OPTIONS += --nopyo
295N/ACONFIGURE_OPTIONS += --disable-rpath
295N/ACONFIGURE_OPTIONS += --disable-gnutls
168N/ACONFIGURE_OPTIONS += --bundled-libraries=ALL
168N/A
168N/A#$(BUILD_DIR_SMB)/.configured: CONFIGURE_OPTIONS += --with-samfs=$(PROTO_DIR)/opt/SUNWsamfs/lib
168N/A
168N/ACONFIGURE_ENV += CC="$(CC)"
168N/ACONFIGURE_ENV += CPP="$(CC) -E"
168N/ACONFIGURE_ENV += AWK=gawk
168N/ACONFIGURE_ENV += PERL=$(PERL.5.20)
295N/ACONFIGURE_ENV += PYTHONDIR="$(PYTHON_VENDOR_PACKAGES)"
295N/ACONFIGURE_ENV += PYTHONARCHDIR="$(PYTHON_VENDOR_PACKAGES)/samba"
168N/ACONFIGURE_ENV += LD="$(LD)"
168N/ACONFIGURE_ENV += CFLAGS="$(CFLAGS)"
168N/ACONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS) -I$(PROTO_DIR)/usr/include -I$(COMPONENT_DIR)/Solaris/include"
168N/ACONFIGURE_ENV += LINKFLAGS="$(LD_OPTIONS) $(LDFLAGS)"
168N/ACONFIGURE_ENV.64 += MACH64="$(MACH64)"
295N/ACONFIGURE_ENV += LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)"
295N/ACONFIGURE_ENV += CUPS_CONFIG=$(USRBINDIR)/cups-config
295N/A
295N/A# Propagation of smb.conf with default settings.
295N/A$(PROTO_DIR)/etc/samba/smb.conf-example: $(BUILD_DIR_SMB)/.built
295N/A $(MKDIR) $(@D)
295N/A sed -f $(COMPONENT_DIR)/Solaris/smbconf.sed > $@ \
295N/A $(BUILD_DIR_SMB)/examples/smb.conf.default
295N/A
295N/A# Build targets for WAF:
295N/A# (motivation) Samba started to use WAF (build system from Google) from the 3.x
295N/A# (as a parallel build system) but Samba4 discontinued the use of auto tools
295N/A# definitively.
295N/A# (note) .BDprep target is an additional step between .prep and .configure
168N/A# targets. It was added because there were problems with libtool-like phase of
168N/A# WAF when the not "prepared well". "waf distclean" on CLONEY'ed BUILD_DIR is
168N/A# enough.
168N/A
168N/A# Prepare build dir for Samba + Winbind.
295N/A$(BUILD_DIR_SMB)/.BDprep: $(SOURCE_DIR)/.prep $(PROTO_DIR)/usr/include/gssapi/gssapi_krb5.h \
295N/A $(PROTO_DIR)/usr/bin/krb5-config
295N/A # re-create configure dir
295N/A $(MKDIR) $(@D)
295N/A # Clone SOURCE_DIR
295N/A $(CLONEY) $(SOURCE_DIR) $(@D)
295N/A # clenup of clone
295N/A (cd $(@D) ; $(ENV) $(WAF_PATH) waf distclean $(WAFOPT1) )
295N/A $(TOUCH) $@
295N/A
295N/A# Configure of Samba + Winbind.
295N/A$(BUILD_DIR_SMB)/.configured: $(BUILD_DIR_SMB)/.BDprep $(PROTO_DIR)/usr/lib/samba/$(MACH64)/libgssapi_krb5.so
295N/A (cd $(@D) ; $(ENV) $(WAF_PATH) $(CONFIGURE_ENV) $(CONFIGURE_ENV.$(BITS)) \
168N/A waf configure $(WAFOPT1) $(CONFIGURE_OPTIONS) $(CONFIGURE_OPTIONS.$(BITS)) )
168N/A $(TOUCH) $@
168N/A
168N/A# Depends on S12-only libraries from Desktop to build.
168N/Aifeq ($(BUILD_TYPE), evaluation)
168N/A$(BUILD_DIR_SMB)/.built:
168N/A$(BUILD_DIR_SMB)/.installed:
168N/A$(BUILD_DIR_WINB)/.built:
168N/A$(BUILD_DIR_WINB)/.installed:
168N/APUBLISH_STAMP=
168N/Aelse
168N/A
168N/A# Build of Samba + Winbind.
168N/A$(BUILD_DIR_SMB)/.built: $(BUILD_DIR_SMB)/.configured
168N/A (cd $(@D) ; $(ENV) $(WAF_PATH) LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" waf build $(WAFOPT1) )
168N/A $(TOUCH) $@
168N/A
168N/A# Install of Samba + Winbind.
168N/A$(BUILD_DIR_SMB)/.installed: $(BUILD_DIR_SMB)/.built
168N/A (cd $(@D) ; $(ENV) $(WAF_PATH) LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" waf install $(WAFOPT1) --destdir=$(PROTO_DIR) )
168N/A $(PYTHON) -m compileall $(PROTO_DIR)/$(PYTHON_VENDOR_PACKAGES)/
168N/A $(TOUCH) $@
168N/A
168N/A# Prepare build dir for Winbind (without Samba) for different bitness.
168N/A$(BUILD_DIR_WINB)/.BDprep: $(SOURCE_DIR)/.prep $(PROTO_DIR)/usr/include/gssapi/gssapi_krb5.h \
295N/A $(PROTO_DIR)/usr/bin/krb5-config
168N/A # re-create configure dir
168N/A $(MKDIR) $(@D)
168N/A # Clone SOURCE_DIR
168N/A $(CLONEY) $(SOURCE_DIR) $(@D)
168N/A # clenup of clone
168N/A (cd $(@D) ; $(ENV) $(WAF_PATH) waf distclean $(WAFOPT1) )
168N/A $(TOUCH) $@
168N/A
295N/A# Configure of Winbind (without Samba) for different bitness.
168N/A$(BUILD_DIR_WINB)/.configured: $(BUILD_DIR_WINB)/.BDprep $(PROTO_DIR)/usr/lib/samba/libgssapi_krb5.so
168N/A (cd $(@D) ; $(ENV) $(WAF_PATH) $(CONFIGURE_ENV) $(CONFIGURE_ENV.$(BITS)) \
168N/A waf configure $(WAFOPT1) $(CONFIGURE_OPTIONS) $(CONFIGURE_OPTIONS.$(BITS)) )
168N/A $(TOUCH) $@
168N/A
295N/A# Build of Winbind (without Samba) for different bitness.
168N/AWB_TARGETS = --targets=nss_winbind,pamsmbpass,pamwinbind
168N/A$(BUILD_DIR_WINB)/.built: $(BUILD_DIR_WINB)/.configured
168N/A (cd $(@D) ; $(ENV) $(WAF_PATH) LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" waf build $(WAFOPT1) \
168N/A $(WB_TARGETS) )
295N/A $(TOUCH) $@
168N/A
168N/A# Installf Winbind (without Samba) for different bitness.
$(BUILD_DIR_WINB)/.installed: $(BUILD_DIR_WINB)/.built
/bin/sh -c "cd $(@D) ; \
$(INSTALL) -d $(PROTO_DIR)/usr/lib/samba$(MACHLIBDIR) ; \
$(INSTALL) -m 0555 -t $(PROTO_DIR)/usr/lib/samba$(MACHLIBDIR) bin/shared/!(pam_*).so* ; \
$(INSTALL) -d $(PROTO_DIR)/usr/lib/samba/security$(MACHLIBDIR) ; \
$(INSTALL) -m 0555 -t $(PROTO_DIR)/usr/lib/samba/security$(MACHLIBDIR) bin/shared/pam_*.so* ; \
$(INSTALL) -d $(PROTO_DIR)/usr/lib/samba/private$(MACHLIBDIR) ; \
$(INSTALL) -m 0555 -t $(PROTO_DIR)/usr/lib/samba/private$(MACHLIBDIR) bin/shared/private/*.so* \
"
$(TOUCH) $@
endif
# Set appropriate bitnesses for Samba + Winbind / Winbind (without Samba).
$(BUILD_DIR_SMB)/.configured: BITS=64
$(BUILD_DIR_SMB)/.configured: MACHLIBDIR=/$(MACH64)
$(BUILD_DIR_WINB)/.configured: BITS=32
$(BUILD_DIR_WINB)/.configured $(BUILD_DIR_WINB)/.installed: MACHLIBDIR=
# common targets
build: $(BUILD_DIR_SMB)/.built $(BUILD_DIR_WINB)/.built
include $(WS_MAKE_RULES)/shared-targets.mk
install: $(BUILD_DIR_SMB)/.installed $(BUILD_DIR_WINB)/.installed
test: $(NO_TESTS)
system-test: $(NO_TESTS)
clean::
$(RM) -r $(BUILD_DIR)
REQUIRED_PACKAGES += library/file-monitor/gamin
REQUIRED_PACKAGES += library/openldap
REQUIRED_PACKAGES += library/print/cups-libs
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += runtime/perl-520
REQUIRED_PACKAGES += runtime/python-27
REQUIRED_PACKAGES += service/security/kerberos-5
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/core-os
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/security/crypto
REQUIRED_PACKAGES += system/library/security/gss
REQUIRED_PACKAGES += system/library/security/libsasl
REQUIRED_PACKAGES += system/library/security/libsasl2
REQUIRED_PACKAGES += system/linker
REQUIRED_PACKAGES += system/network
REQUIRED_PACKAGES += system/network/avahi