components/samba/samba/samba36/Makefile
changeset 4371 29fdb14099eb
parent 4339 6501cf9c29f9
equal deleted inserted replaced
4370:7043c27399f1 4371:29fdb14099eb
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 
       
    22 #
       
    23 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 
       
    26 # Samba does not work properly on i86 when built by studio.
       
    27 # Samba on SPARC has serious performance drop when built by gcc.
       
    28 ifeq ($(uname -p),sparc)
       
    29 COMPILER =	studio
       
    30 else
       
    31 COMPILER =	gcc
       
    32 endif
       
    33 
       
    34 # parfait seems to spin on us
       
    35 export PARFAIT_BUILD=no
       
    36 
       
    37 include ../../../../make-rules/shared-macros.mk
       
    38 
       
    39 COMPONENT_NAME=		samba
       
    40 COMPONENT_VERSION=	$(SAMBA36VER)
       
    41 TPNO=			21657
       
    42 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
       
    43 #COMPONENT_PROJECT_URL=	http://www.samba.org/
       
    44 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
       
    45 COMPONENT_ARCHIVE_HASH= sha256:8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751
       
    46 COMPONENT_ARCHIVE_URL=	http://ftp.samba.org/pub/samba/stable/$(COMPONENT_ARCHIVE)
       
    47 COMPONENT_BUGDB=	utility/samba
       
    48 
       
    49 include $(WS_MAKE_RULES)/prep.mk
       
    50 
       
    51 SRC_OFFSET =	source3
       
    52 # Now we override paths to .built
       
    53 BUILD_DIR_32 = $(BUILD_DIR)/$(MACH32)/$(SRC_OFFSET)
       
    54 BUILD_DIR_64 = $(BUILD_DIR)/$(MACH64)/$(SRC_OFFSET)
       
    55 
       
    56 include $(WS_MAKE_RULES)/configure.mk
       
    57 # ips.mk is needed for:
       
    58 # gmake sample-manifest SAMBA36VER=3.6.25 METADATA_TEMPLATE=
       
    59 # cp build/manifest-sparc-generated.p5m ../samba36.proto-objects
       
    60 include $(WS_MAKE_RULES)/ips.mk
       
    61 # ...only
       
    62 
       
    63 CONFIGURE_SCRIPT = $(BUILD_DIR_$(BITS))/configure
       
    64 
       
    65 # Solve dependencies before the 32bits configure.
       
    66 $(BUILD_DIR_32)/.configured: $(PROTO_DIR)/opt/SUNWsamfs/lib/libsam.so
       
    67 
       
    68 # Start 64bits configure after the 32bits one is finished
       
    69 # to have all dependecies solved.
       
    70 $(BUILD_DIR_64)/.configured: $(BUILD_DIR_32)/.configured
       
    71 
       
    72 # re-create configure dir with respect of SRC_OFFSET
       
    73 # (target $(BUILD_DIR_64)/.configured does not know about
       
    74 # the lower level of directories)
       
    75 COMPONENT_PRE_CONFIGURE_ACTION = \
       
    76 	$(RM) -r $(BUILD_DIR)/$(MACH$(BITS)) ; \
       
    77 	$(MKDIR) $(BUILD_DIR)/$(MACH$(BITS)) ;
       
    78 
       
    79 # Clone SOURCE_DIR and remove links to all of the files generated
       
    80 # from *.in to distinguish then between the 32/64bits builds.
       
    81 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    82 	( $(CLONEY) $(SOURCE_DIR) $(BUILD_DIR)/$(MACH$(BITS)) ; \
       
    83 	  find $(@D)/.. -name '*.in' | sed -e 's/.in$$//' | xargs $(RM) ) ;
       
    84 
       
    85 # finish preparation
       
    86 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    87 	( cd $(@D) ; $(CONFIG_SHELL) autogen.sh )
       
    88 
       
    89 COMPONENT_PRE_BUILD_ACTION = $(ENV) ; echo $(COMPONENT_BUILD_ENV)
       
    90 
       
    91 # It should create $(PROTO_DIR).
       
    92 $(PROTO_DIR)/opt/SUNWsamfs/lib/libsam.so: ../Solaris/libsam.c
       
    93 	$(MKDIR) $(PROTO_DIR)/opt/SUNWsamfs/lib
       
    94 	$(CC.studio.32) -G $(studio_PIC) -hlibsam.so ../Solaris/libsam.c \
       
    95 		-I$(COMPONENT_DIR)/../Solaris/include \
       
    96 		-o $(PROTO_DIR)/opt/SUNWsamfs/lib/libsam.so
       
    97 
       
    98 CFLAGS.studio	+=	$(studio_C99_ENABLE)
       
    99 CFLAGS.gcc	+=	-std=c99
       
   100 CFLAGS.gcc3	+=	-std=c99
       
   101 
       
   102 SAMBA36DIR	=	/usr/lib/samba/samba36
       
   103 CONFIGURE_PREFIX =	$(SAMBA36DIR)
       
   104 SAMBA36INCDIR	=	$(SAMBA36DIR)/include
       
   105 
       
   106 #CPPFLAGS +=	-DSAMBA_VERSION_VENDOR_SUFFIX=\\\"Placeholder_for_vendor_suffix\\\"
       
   107 CPPFLAGS +=	$(CPP_LARGEFILES)
       
   108 CPPFLAGS +=	$(CPP_XPG6MODE)
       
   109 CPPFLAGS +=	-I$(PROTO_DIR)$(SAMBA36INCDIR) -I$(USRINCDIR)/samba/ldap6 -I$(BUILD_DIR_$(BITS))/include
       
   110 
       
   111 LIBS +=		-lrt -lsocket -lnsl
       
   112 # libavahi is not for 64bits but we do not need it
       
   113 LIBS32 =	-lsendfile -lavahi-common -lavahi-core
       
   114 
       
   115 LDFLAGS +=	-L $(PROTO_DIR)$(CONFIGURE_LIBDIR.$(BITS)) -R$(CONFIGURE_LIBDIR.$(BITS))
       
   116 
       
   117 LDFLAGS.32 +=	-L $(PROTO_DIR)/opt/SUNWsamfs/lib
       
   118 LDFLAGS.32 +=	$(LIBS) $(LIBS32)
       
   119 
       
   120 LDFLAGS.64 +=	$(LIBS)
       
   121 
       
   122 ifeq ($(COMPILER), studio)
       
   123 LDFLAGS +=	$(LDFLAGS.$(BITS)) $(LD_OPTIONS)
       
   124 else
       
   125 LDFLAGS +=      $(LDFLAGS.$(BITS)) $(LD_OPTIONS:%=-Xlinker %)
       
   126 endif
       
   127 
       
   128 ASLR_MODE =	$(ASLR_ENABLE)
       
   129 
       
   130 CONFIGURE_OPTIONS +=	--includedir=$(SAMBA36INCDIR)
       
   131 CONFIGURE_OPTIONS +=	--sysconfdir=/etc/samba
       
   132 CONFIGURE_OPTIONS +=	--with-configdir=/etc/samba
       
   133 CONFIGURE_OPTIONS +=	--with-privatedir=/etc/samba/private
       
   134 CONFIGURE_OPTIONS +=	--with-swatdir=$(SAMBA36DIR)/swat
       
   135 CONFIGURE_OPTIONS +=	--localstatedir=/var/samba
       
   136 CONFIGURE_OPTIONS +=	--with-lockdir=/var/samba/locks
       
   137 CONFIGURE_OPTIONS +=	--with-piddir=/var/samba/locks
       
   138 CONFIGURE_OPTIONS +=	--with-logfilebase=/var/samba/log
       
   139 CONFIGURE_OPTIONS +=	--enable-shared=yes
       
   140 CONFIGURE_OPTIONS +=	--enable-static=no
       
   141 CONFIGURE_OPTIONS.32 +=	--with-static-modules=vfs_solarisacl
       
   142 CONFIGURE_OPTIONS.32 += --with-shared-modules=vfs_worm,vfs_zfsacl,vfs_aio_pthread,vfs_samfs,vfs_prealloc,vfs_cacheprime,vfs_commit,idmap_ldap,idmap_tdb2,idmap_rid,idmap_ad,idmap_hash,idmap_adex
       
   143 CONFIGURE_OPTIONS.64 +=	--with-static-modules=
       
   144 CONFIGURE_OPTIONS.64 += --with-shared-modules=
       
   145 CONFIGURE_OPTIONS +=	--with-readline
       
   146 CONFIGURE_OPTIONS +=	--enable-cups
       
   147 CONFIGURE_OPTIONS +=	--with-aio-support
       
   148 CONFIGURE_OPTIONS +=	--with-acl-support
       
   149 CONFIGURE_OPTIONS +=	--with-ads
       
   150 CONFIGURE_OPTIONS +=	--with-ldap
       
   151 CONFIGURE_OPTIONS +=	--with-automount
       
   152 CONFIGURE_OPTIONS +=	--with-dnsupdate=no
       
   153 CONFIGURE_OPTIONS +=	--with-pam
       
   154 CONFIGURE_OPTIONS +=	--with-winbind
       
   155 
       
   156 CONFIGURE_OPTIONS += 	LD="$(LD)"
       
   157 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
       
   158 CONFIGURE_OPTIONS.32 +=	CPPFLAGS="$(CPPFLAGS) -I$(COMPONENT_DIR)/../Solaris/include"
       
   159 CONFIGURE_OPTIONS.64 +=	CPPFLAGS="$(CPPFLAGS)"
       
   160 CONFIGURE_OPTIONS +=	LDFLAGS="$(LDFLAGS)"
       
   161 CONFIGURE_OPTIONS.32 +=	LIBS="$(LIBS) $(LIBS32)"
       
   162 CONFIGURE_OPTIONS.64 +=	LIBS="$(LIBS)"
       
   163 CONFIGURE_OPTIONS +=	LDAP_LIBS="-lldap60 -lssldap60"
       
   164 CONFIGURE_OPTIONS +=	CUPS_CONFIG=$(USRBINDIR)/cups-config
       
   165 CONFIGURE_OPTIONS.32 +=	SAMFS_LIBS="-R/opt/SUNWsamfs/lib -lsam"
       
   166 
       
   167 # Samba targets
       
   168 $(BUILD_32): COMPONENT_BUILD_TARGETS = showlayout all libsmbclient modules smbtorture
       
   169 $(BUILD_64): COMPONENT_BUILD_TARGETS = showlayout nss_modules pam_modules pam_smbpass wins pam_winbind
       
   170 $(INSTALL_32): COMPONENT_INSTALL_TARGETS = showlayout install-everything
       
   171 $(INSTALL_64): COMPONENT_INSTALL_TARGETS = showlayout installpammodules
       
   172 
       
   173 # common targets
       
   174 configure:	$(CONFIGURE_32_and_64)
       
   175 
       
   176 build:		$(BUILD_32_and_64)
       
   177 
       
   178 install:	$(INSTALL_32_and_64)
       
   179 
       
   180 test:		$(NO_TESTS)
       
   181 
       
   182 system-test:    $(NO_TESTS)
       
   183 
       
   184 REQUIRED_PACKAGES += library/file-monitor/gamin
       
   185 REQUIRED_PACKAGES += library/ncurses
       
   186 REQUIRED_PACKAGES += library/popt
       
   187 REQUIRED_PACKAGES += library/print/cups-libs
       
   188 REQUIRED_PACKAGES += library/readline
       
   189 REQUIRED_PACKAGES += library/samba/libsmbclient
       
   190 REQUIRED_PACKAGES += library/zlib
       
   191 REQUIRED_PACKAGES += runtime/perl-512
       
   192 REQUIRED_PACKAGES += runtime/perl-516
       
   193 REQUIRED_PACKAGES += service/security/kerberos-5
       
   194 REQUIRED_PACKAGES += shell/ksh93
       
   195 REQUIRED_PACKAGES += system/core-os
       
   196 REQUIRED_PACKAGES += system/library
       
   197 REQUIRED_PACKAGES += system/library/gcc-3-runtime
       
   198 REQUIRED_PACKAGES += system/library/gcc-45-runtime
       
   199 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
       
   200 REQUIRED_PACKAGES += system/library/security/crypto
       
   201 REQUIRED_PACKAGES += system/library/security/gss
       
   202 REQUIRED_PACKAGES += system/network
       
   203 REQUIRED_PACKAGES += system/network/avahi