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