usr/src/cmd/openldap/Makefile.sfw
author Jon Tibble <meths@btinternet.com>
Mon, 18 Nov 2013 20:10:04 +0000
branchoi_151a
changeset 245 a5aeb10de831
parent 242 37c993a03359
permissions -rw-r--r--
Bump OpenLDAP to 2.4.38

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# ident	"@(#)Makefile.sfw	1.4	10/06/02 SMI"
#

include ../Makefile.cmd

# Library subversion number
LVER=2.10.1
# release version number
VER=openldap-2.4.38
VER64=${VER}-64
VERP=/usr/openldap/2.4
BDB=bdb-4.5.20.b
BDBDIST=${BDB}/source/4.5.20.b/dist
BDBBLD=${BDB}/source/4.5.20.b/build_unix
BDBLP=${SRC}/cmd/openldap/${BDB}/source/4.5.20.b/build_unix
BDB64=${BDB}-64
BDB64DIST=${BDB64}/source/4.5.20.b/dist
BDB64BLD=${BDB64}/source/4.5.20.b/build_unix
BDB64LP=${SRC}/cmd/openldap/${BDB64}/source/4.5.20.b/build_unix
VERI=${SRC}/cmd/openldap/${VER}/include
SDFVER=sdf-2.001
SDF=${SDFVER}/blib/script/sdf
SDFBLIB=../../../../${SDFVER}/blib

CFLAGS += -mt -xstrconst -ztext -zdefs -Bdirect -W2,-Rcond_elim
CFLAGS64 += -mt -xstrconst -ztext -zdefs -Bdirect -W2,-Rcond_elim
LDFLAGS = -L${ROOT}/lib -L${ROOT}/usr/lib -lumem -L${BDBLP} \
    -L${ROOT}/usr/sfw/lib -L/usr/sfw/lib -R/usr/sfw/lib
LDFLAGS64 = -L${ROOT}/lib/${MACH64} -L${ROOT}/usr/lib/${MACH64} \
    -lumem -L${BDB64LP} -L${ROOT}/usr/sfw/lib/${MACH64} \
    -L/usr/sfw/lib/${MACH64} -R/usr/sfw/lib/${MACH64}
BLDFLAGS = -L${ROOT}/usr/lib -lumem -L${ROOT}/usr/sfw/lib
BLDFLAGS64 = -L${ROOT}/usr/lib/${MACH64} -lumem -L${ROOT}/usr/sfw/lib/${MACH64}

# DEFAULTS
# Where --prefix=PREFIX and --exec-prefix=EPREFIX
#  --bindir=DIR           user executables [EPREFIX/bin]
#  --sbindir=DIR          system admin executables [EPREFIX/sbin]
#  --libexecdir=DIR       program executables [EPREFIX/libexec]
#  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
#  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
#  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
#  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
#  --libdir=DIR           object code libraries [EPREFIX/lib]
#  --includedir=DIR       C header files [PREFIX/include]
#  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
#  --infodir=DIR          info documentation [PREFIX/info]
#  --mandir=DIR           man documentation [PREFIX/man]
CONFDIRS= --prefix= --exec-prefix=/usr --libexecdir=/usr/lib \
    --sysconfdir=/etc --localstatedir=/var/openldap \
    --includedir=/usr/include/openldap --mandir=/usr/share/man

all:	all32 all64

all32: $(BDBBLD)/libdb.a $(SDF) .WAIT $(VER)/config.status
	(cd $(VER); env \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
	    $(GMAKE))
	(cd $(VER)/doc/guide/admin; \
	 perl -I$(SDFBLIB)/lib $(SDFBLIB)/script/sdf -2html guide.sdf; \
	 perl -I$(SDFBLIB)/lib $(SDFBLIB)/script/sdf -2html index.sdf)
	@find . -name core -exec rm -f {} \;

all64: $(BDB64BLD)/libdb.a .WAIT $(VER64)/config.status
	(cd $(VER64); env \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
	    $(GMAKE))
	@find . -name core -exec rm -f {} \;

test: 	all .WAIT test32 .WAIT test64

test32:	all32
	(cd $(VER); env \
	    LD_LIBRARY_PATH=${ROOT}/usr/lib \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
	    $(GMAKE) test)

test64:	all64
	(cd $(VER64); env \
	    LD_LIBRARY_PATH=${ROOT}/usr/lib/${MACH64} \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
	    $(GMAKE) test)

# Build libdb first before configuring openldap

$(BDBBLD)/libdb.a:	$(BDBBLD)/config.status
	(cd $(BDBBLD); env \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
	    $(GMAKE))

$(BDB64BLD)/libdb.a:	$(BDB64BLD)/config.status
	(cd $(BDB64BLD); env \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
	    $(GMAKE))

# Install binaries included in package into ROOT
install: all
	$(SH) ./install-openldap $(VER) $(LVER)
	$(SH) ./install-openldap64 $(VER64) $(LVER) $(MACH64)

# Configure BDB for compilation.
$(BDBBLD)/config.status: $(BDBDIST)/configure
	(cd $(BDBBLD); env \
	    LD_OPTIONS="-M $(SRC)/cmd/mapfile_noexstk" \
	    CC=$(CC) CXX=$(CCC) \
	    CFLAGS="$(CFLAGS)" \
	    CXXFLAGS="$(CCFLAGS)" \
	    LDFLAGS="$(BLDFLAGS)" \
	    MAKE=$(GMAKE) \
            LD_LIBRARY_PATH=/usr/sfw/lib \
	    ../dist/configure \
		--disable-cryptography  \
		--disable-hash          \
		--disable-queue         \
		--disable-replication   \
		--disable-statistics    \
		--disable-compat185     \
		--disable-cxx           \
		--disable-debug         \
		--disable-debug_rop     \
		--disable-debug_wop     \
		--disable-diagnostic    \
		--disable-dump185       \
		--disable-java          \
		--disable-mingw         \
		--disable-rpc           \
		--enable-smallbuild     \
		--disable-tcl           \
		--disable-test          \
		--disable-shared        \
		--enable-static)

$(BDB64BLD)/config.status: $(BDB64DIST)/configure
	(cd $(BDB64BLD); env \
	    LD_OPTIONS="-M $(SRC)/cmd/mapfile_noexstk" \
	    CC=$(CC) CXX=$(CCC64) \
	    CFLAGS="$(CFLAGS64)" \
	    CXXFLAGS="$(CCFLAGS64)" \
	    LDFLAGS="$(BLDFLAGS64)" \
	    MAKE=$(GMAKE) \
            LD_LIBRARY_PATH=/usr/sfw/lib/${MACH64} \
	    ../dist/configure \
		--disable-cryptography  \
		--disable-hash          \
		--disable-queue         \
		--disable-replication   \
		--disable-statistics    \
		--disable-compat185     \
		--disable-cxx           \
		--disable-debug         \
		--disable-debug_rop     \
		--disable-debug_wop     \
		--disable-diagnostic    \
		--disable-dump185       \
		--disable-java          \
		--disable-mingw         \
		--disable-rpc           \
		--enable-smallbuild     \
		--disable-tcl           \
		--disable-test          \
		--disable-shared        \
		--enable-static)

# Configure OpenLDAP ready for compilation.
$(VER)/config.status: $(VER)/configure
	(cd $(VER); env \
	    CC=$(CC) CXX=$(CCC) \
	    "CPPFLAGS=$(CPPFLAGS) -I/usr/sfw/include -I$(BDBLP) -I$(VERI)" \
	    "CFLAGS=$(CFLAGS)" \
	    "CXXFLAGS=$(CCFLAGS)" \
	    "LDFLAGS=$(LDFLAGS)" \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
            LD_LIBRARY_PATH=/usr/sfw/lib \
	    ./configure --with-libtool \
		$(CONFDIRS) \
		--with-openssl \
		--disable-static \
		--enable-overlays \
		--disable-dynamic \
		--enable-crypt \
		--enable-shared \
		--enable-bdb \
		--enable-hdb \
		--enable-null \
		--enable-passwd	  \
		--enable-shell \
		--with-cyrus-sasl \
		--with-threads \
		--without-gnutls \
		--with-tls=openssl \
		--disable-openssl-version-check)

$(VER64)/config.status: $(VER64)/configure
	(cd $(VER64); env \
	    CC=$(CC) CXX=$(CCC64) \
	    "CPPFLAGS=$(CPPFLAGS) -I/usr/sfw/include -I$(BDB64LP) -I$(VERI)" \
	    "CFLAGS=$(CFLAGS64)" \
	    "CXXFLAGS=$(CCFLAGS64)" \
	    "LDFLAGS=$(LDFLAGS64)" \
	    PATH=$(SFW_PATH) \
	    MAKE=$(GMAKE) \
            LD_LIBRARY_PATH=/usr/sfw/lib/${MACH64} \
	    ./configure --with-libtool \
		$(CONFDIRS) \
		--libdir=/usr/lib/${MACH64} \
		--with-openssl \
		--disable-static \
		--enable-overlays \
		--disable-dynamic \
		--enable-crypt \
		--enable-shared \
		--enable-bdb \
		--enable-hdb \
		--enable-null \
		--enable-passwd	  \
		--enable-shell \
		--with-cyrus-sasl \
		--with-threads \
		--without-gnutls \
		--with-tls=openssl \
		--disable-openssl-version-check)


# configure: unpack and patch  (if required) ISC version of BIND.
#
# Should a Sun Specific patch need to be applied then do so here.
# This insures that the shipped source includes any new files
# and directories.  Ideally no patches should be required, where they
# are needed for a release they should be incorporated or obsoleted in
# the next ISC release.
#
$(BDBDIST)/configure: $(BDB).tgz $(FRC)
	gzip -dc $(BDB).tgz | tar xopf -
	$(TOUCH) $(BDBDIST)/configure

$(BDB64DIST)/configure: $(BDB).tgz $(FRC)
	mkdir -p tmp
	gzip -dc $(BDB).tgz | (cd tmp; tar xopf -)
	rm -rf $(BDB64)
	mv tmp/$(BDB) $(BDB64); rmdir tmp
	$(TOUCH) $(BDB64DIST)/configure

$(VER)/configure: $(VER).tgz $(FRC)
	gzip -dc $(VER).tgz | tar xopf -
	$(TOUCH) $(VER)/configure

$(VER64)/configure: $(VER).tgz $(FRC)
	mkdir -p tmp
	gzip -dc $(VER).tgz | (cd tmp; tar xopf -)
	rm -rf $(VER64)
	mv tmp/$(VER) $(VER64); rmdir tmp
	$(TOUCH) $(VER64)/configure

# Build SDF so that OpenLDAP admin guide can be generated
# SDF is used for interal build purposes only.
# The code base was frozen at v2.001 in 1998.

$(SDF):	$(SDFVER).tar.gz $(FRC)
	gzip -dc $(SDFVER).tar.gz | tar xopf -
	(cd $(SDFVER); perl Makefile.PL; \
	 $(MAKE))

clean:
	-/usr/bin/rm -rf $(VER) $(VER64) $(BDB) $(BDB64) $(SDFVER)

include ../Makefile.targ

FRC: