components/samba/samba/Makefile
changeset 264 84a67a54e8fd
child 446 ba4f3a6be7f7
equal deleted inserted replaced
263:1057446c9ee5 264:84a67a54e8fd
       
     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, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 include ../../../make-rules/shared-macros.mk
       
    26 
       
    27 COMPONENT_NAME=		samba
       
    28 COMPONENT_VERSION=	3.5.8
       
    29 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
       
    30 COMPONENT_PROJECT_URL=	http://www.samba.org/
       
    31 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
       
    32 COMPONENT_ARCHIVE_HASH=	sha1:ffb71de38442eee14aafb44f819671354dc5cce9
       
    33 COMPONENT_ARCHIVE_URL=	http://www.samba.org/samba/ftp/stable/$(COMPONENT_ARCHIVE)
       
    34 
       
    35 COMPONENT_NAME_1=		docbook-xsl
       
    36 COMPONENT_VERSION_1=		1.76.1
       
    37 COMPONENT_SRC_1=		$(COMPONENT_NAME_1)-$(COMPONENT_VERSION_1)
       
    38 COMPONENT_ARCHIVE_1=		$(COMPONENT_SRC_1).tar.bz2
       
    39 COMPONENT_ARCHIVE_HASH_1=	sha1:dc9fa422c53e0a4f0e32b5c8ec896b39080bc14d
       
    40 COMPONENT_ARCHIVE_URL_1=	http://sourceforge.net/projects/docbook/files/$(COMPONENT_NAME_1)/$(COMPONENT_VERSION_1)/$(COMPONENT_ARCHIVE_1)
       
    41 
       
    42 COMPONENT_ARCHIVE_2=		libsam-LGPL.tar
       
    43 COMPONENT_ARCHIVE_HASH_2=	sha1:58871eebb9ebfe57a3db0490616786972cb858fe
       
    44 COMPONENT_ARCHIVE_URL_2=	http://hub.opensolaris.org/bin/download/Project+samqfs/files/libsam%2DLGPL.tar
       
    45 
       
    46 include ../../../make-rules/prep.mk
       
    47 
       
    48 SRC_OFFSET =	source3
       
    49 # Now we override paths to .built
       
    50 BUILD_DIR_32 = $(BUILD_DIR)/$(MACH32)/$(SRC_OFFSET)
       
    51 BUILD_DIR_64 = $(BUILD_DIR)/$(MACH64)/$(SRC_OFFSET)
       
    52 
       
    53 include ../../../make-rules/configure.mk
       
    54 include ../../../make-rules/ips.mk
       
    55 
       
    56 PATCH_LEVEL =	0
       
    57 CONFIGURE_SCRIPT = $(BUILD_DIR_$(BITS))/configure
       
    58 
       
    59 PKG_OPTIONS += -I $(COMPONENT_DIR)
       
    60 
       
    61 DOCS-XML_DIR =	$(SOURCE_DIR)/docs-xml
       
    62 
       
    63 # Build mozldap if not yet built.
       
    64 $(COMPONENT_DIR)/../mozldap/build/$(MACH32)/.installed \
       
    65 $(COMPONENT_DIR)/../mozldap/build/$(MACH64)/.installed:
       
    66 	$(GMAKE) -C $(COMPONENT_DIR)/../mozldap install
       
    67 
       
    68 # Clone mozldap libs and headers to $(PROTO_DIR).
       
    69 # Create also $(PROTO_DIR).
       
    70 $(PROTO_DIR)/.mozldap:	   $(COMPONENT_DIR)/../mozldap/build/$(MACH32)/.installed \
       
    71 			   $(COMPONENT_DIR)/../mozldap/build/$(MACH64)/.installed
       
    72 	$(MKDIR) $(PROTO_DIR)
       
    73 	$(CLONEY) $(COMPONENT_DIR)/../mozldap/build/prototype/$(MACH) $(PROTO_DIR)
       
    74 	$(TOUCH) $@
       
    75 
       
    76 # Solve dependencies before the 32bits configure.
       
    77 $(BUILD_DIR_32)/.configured: $(DOCS-XML_DIR)/.built $(PROTO_DIR)/.mozldap \
       
    78 			$(PROTO_DIR)/opt/SUNWsamfs/lib/libsam.so
       
    79 
       
    80 # Start 64bits configure after the 32bits one is finished
       
    81 # to have all dependecies solved.
       
    82 $(BUILD_DIR_64)/.configured: $(BUILD_DIR_32)/.configured
       
    83 
       
    84 # re-create configure dir with respect of SRC_OFFSET
       
    85 # (target $(BUILD_DIR_64)/.configured does not know about
       
    86 # the lower level of directories)
       
    87 COMPONENT_PRE_CONFIGURE_ACTION = \
       
    88 	$(RM) -r $(BUILD_DIR)/$(MACH$(BITS)) ; \
       
    89 	$(MKDIR) $(BUILD_DIR)/$(MACH$(BITS)) ;
       
    90 
       
    91 # Clone SOURCE_DIR and remove links to all of the files generated
       
    92 # from *.in to distinguish then between the 32/64bits builds.
       
    93 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    94 	( $(CLONEY) $(SOURCE_DIR) $(BUILD_DIR)/$(MACH$(BITS)) ; \
       
    95 	  find $(@D)/.. -name '*.in' | sed -e 's/.in$$//' | xargs $(RM) ) ;
       
    96 
       
    97 # finish preparation
       
    98 COMPONENT_PRE_CONFIGURE_ACTION += \
       
    99 	( cd $(@D) ; $(CONFIG_SHELL) autogen.sh )
       
   100 
       
   101 # Depend on $(PROTO_DIR)/.mozldap because this target creates $(PROTO_DIR).
       
   102 $(PROTO_DIR)/opt/SUNWsamfs/lib/libsam.so: Solaris/libsam.c \
       
   103 		$(COMPONENT_ARCHIVE_2) $(PROTO_DIR)/.mozldap
       
   104 	$(MKDIR) $(PROTO_DIR)/opt/SUNWsamfs/lib
       
   105 	$(CC) -G -Kpic -hlibsam.so Solaris/libsam.c \
       
   106 		-o $(PROTO_DIR)/opt/SUNWsamfs/lib/libsam.so
       
   107 	cd $(BUILD_DIR) ; $(UNPACK) $(UNPACK_ARGS) ../$(COMPONENT_ARCHIVE_2)
       
   108 
       
   109 CFLAGS +=	$(CC_BITS)
       
   110 CFLAGS +=	$(studio_C99_ENABLE)
       
   111 CFLAGS +=	$(CFLAGS.studio)
       
   112 
       
   113 CPPFLAGS +=	-I$(PROTOINCDIR)/samba -I$(PROTOINCDIR)/samba/ldap6
       
   114 
       
   115 LIBS +=		-lrt -lsocket -lnsl
       
   116 # libavahi is not for 64bits but we do not need it
       
   117 LIBS32 =	-lsendfile -lavahi-common -lavahi-core
       
   118 
       
   119 LDFLAGS.32 +=	-L $(PROTOUSRLIBDIR)
       
   120 LDFLAGS.32 +=	-L $(PROTOUSRLIBDIR)/samba -R/usr/lib/samba
       
   121 LDFLAGS.32 +=	-L $(PROTO_DIR)/opt/SUNWsamfs/lib
       
   122 LDFLAGS.32 +=	$(LIBS) $(LIBS32)
       
   123 
       
   124 LDFLAGS.64 +=	-L $(PROTOUSRLIBDIR)/$(MACH64)
       
   125 LDFLAGS.64 +=	-L $(PROTOUSRLIBDIR)/samba/$(MACH64) -R/usr/lib/samba/$(MACH64)
       
   126 LDFLAGS.64 +=	$(LIBS)
       
   127 
       
   128 LDFLAGS +=	$(LDFLAGS.$(BITS)) $(LD_OPTIONS)
       
   129 
       
   130 CONFIGURE_LIBDIR.32 = /usr/lib/samba
       
   131 CONFIGURE_LIBDIR.64 = /usr/lib/samba/$(MACH64)
       
   132 CONFIGURE_OPTIONS += --includedir=/usr/include/samba
       
   133 CONFIGURE_OPTIONS += --sysconfdir=/etc/samba
       
   134 CONFIGURE_OPTIONS += --with-configdir=/etc/samba
       
   135 CONFIGURE_OPTIONS += --with-privatedir=/etc/samba/private
       
   136 CONFIGURE_OPTIONS += --with-swatdir=/usr/share/samba/swat
       
   137 CONFIGURE_OPTIONS += --localstatedir=/var/samba
       
   138 CONFIGURE_OPTIONS += --with-lockdir=/var/samba/locks
       
   139 CONFIGURE_OPTIONS += --with-piddir=/var/samba/locks
       
   140 CONFIGURE_OPTIONS += --with-logfilebase=/var/samba/log
       
   141 CONFIGURE_OPTIONS += --enable-shared=yes
       
   142 CONFIGURE_OPTIONS += --enable-static=no
       
   143 CONFIGURE_OPTIONS += --with-static-modules=
       
   144 CONFIGURE_OPTIONS.32 += --with-shared-modules=vfs_zfsacl,vfs_samfs,vfs_prealloc,vfs_cacheprime,vfs_commit,idmap_ldap,idmap_tdb2,idmap_rid,idmap_ad,idmap_hash,idmap_adex
       
   145 CONFIGURE_OPTIONS.64 += --with-shared-modules=
       
   146 CONFIGURE_OPTIONS += --with-readline
       
   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
       
   153 CONFIGURE_OPTIONS += --with-pam
       
   154 CONFIGURE_OPTIONS += --with-winbind
       
   155 CONFIGURE_OPTIONS += 	LD="$(LD)"
       
   156 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
       
   157 CONFIGURE_OPTIONS.32 +=	CPPFLAGS="$(CPPFLAGS) -I$(BUILD_DIR)/libsam-LGPL/include"
       
   158 CONFIGURE_OPTIONS.64 +=	CPPFLAGS="$(CPPFLAGS)"
       
   159 CONFIGURE_OPTIONS +=	LDFLAGS="$(LDFLAGS)"
       
   160 CONFIGURE_OPTIONS.32 +=	LIBS="$(LIBS) $(LIBS32)"
       
   161 CONFIGURE_OPTIONS.64 +=	LIBS="$(LIBS)"
       
   162 CONFIGURE_OPTIONS +=	LDAP_LIBS=-lldap60
       
   163 CONFIGURE_OPTIONS +=	CUPS_CONFIG=$(USRBINDIR)/cups-config
       
   164 CONFIGURE_OPTIONS.32 +=	SAMFS_LIBS="-R/opt/SUNWsamfs/lib -lsam"
       
   165 
       
   166 # download recent docbook-xsl and unpack it
       
   167 $(BUILD_DIR)/$(COMPONENT_SRC_1)/.docbook-xsl-prep: $(COMPONENT_ARCHIVE_1) \
       
   168 		$(SOURCE_DIR)/.prep $(PROTO_DIR)/.mozldap
       
   169 	cd $(BUILD_DIR) ; $(UNPACK) $(UNPACK_ARGS) ../$(COMPONENT_ARCHIVE_1)
       
   170 	cd $(DOCS-XML_DIR) ; $(GMAKE) clobber
       
   171 	$(TOUCH) $@
       
   172 
       
   173 # create also the: $(DOCS-XML_DIR)/configure and $(DOCS-XML_DIR)/build/catalog.xml
       
   174 # needed to buils docs from XML sources
       
   175 $(DOCS-XML_DIR)/Makefile.settings: $(BUILD_DIR)/$(COMPONENT_SRC_1)/.docbook-xsl-prep
       
   176 	cd $(@D) ; $(GMAKE) configure \
       
   177 		BUILDDIR=$(@D) \
       
   178 		DOCBOOKXSLVER=$(COMPONENT_VERSION_1) \
       
   179 		DOCBOOKXSLDIR=$(BUILD_DIR)/$(COMPONENT_SRC_1)
       
   180 
       
   181 # Build docs from DocBook XML sources.
       
   182 $(DOCS-XML_DIR)/.built: $(DOCS-XML_DIR)/Makefile.settings
       
   183 	cd $(@D) ; \
       
   184 	env - XML_CATALOG_FILES="catalog.xml file:///$(@D)/build/catalog.xml" \
       
   185 		$(GMAKE) smbdotconf/parameters.all.xml manpages3 htmlman3
       
   186 	$(TOUCH) $@
       
   187 
       
   188 $(PROTO_DIR)/etc/samba/smb.conf-example: $(BUILD_32)
       
   189 	$(MKDIR) $(@D)
       
   190 	sed -f $(COMPONENT_DIR)/Solaris/smbconf.sed > $@ \
       
   191 	   $(BUILD_DIR)/$(MACH32)/examples/smb.conf.default
       
   192 
       
   193 # Samba targets
       
   194 $(BUILD_32): COMPONENT_BUILD_TARGETS = showlayout everything
       
   195 $(BUILD_64): COMPONENT_BUILD_TARGETS = showlayout nss_modules pam_modules pam_smbpass wins pam_winbind
       
   196 $(INSTALL_32): COMPONENT_INSTALL_TARGETS = showlayout install-everything
       
   197 $(INSTALL_64): COMPONENT_INSTALL_TARGETS = showlayout installpammodules
       
   198 
       
   199 # common targets
       
   200 build:		$(BUILD_32_and_64)
       
   201 
       
   202 include ../../../make-rules/shared-targets.mk
       
   203 
       
   204 install:	$(PROTO_DIR)/etc/samba/smb.conf-example $(INSTALL_32_and_64)
       
   205 
       
   206 test:		$(NO_TESTS)
       
   207 
       
   208 clean::
       
   209 	$(GMAKE) -C $(COMPONENT_DIR)/../mozldap clean
       
   210 
       
   211 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
       
   212 
       
   213 include ../../../make-rules/depend.mk