Windows: Build shared side-by-side assemblies for Heimdal

This commit is contained in:
Asanka Herath
2010-06-21 18:08:14 -04:00
parent b3b43ff9cf
commit 12638c01a9
6 changed files with 263 additions and 50 deletions

View File

@@ -1,20 +1,20 @@
########################################################################
#
# Copyright (c) 2009, Secure Endpoints Inc.
# Copyright (c) 2010, Secure Endpoints Inc.
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
@@ -27,9 +27,10 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
RELDIR=packages
RELDIR=packages
SUBDIRS=windows
!include ../windows/NTMakefile.w32
!include ../windows/NTMakefile.w32

View File

@@ -0,0 +1,36 @@
########################################################################
#
# Copyright (c) 2009, Secure Endpoints Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
RELDIR=packages\windows
SUBDIRS=assembly
!include ../../windows/NTMakefile.w32

View File

@@ -0,0 +1,16 @@
<?xml version="1" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="@name@"
processorArchitecture="@cpu@"
version="@version@"
publicKeyToken="@pkt@" />
<file name="libgssapi.dll" />
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="@krbname@"
processorArchitecture="@cpu@"
version="@krbversion@"
publickeytoken="@pkt@" />
</dependentAssembly>
</dependency>
</assembly>

View File

@@ -0,0 +1,9 @@
<?xml version="1" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="@name@"
processorArchitecture="@cpu@"
version="@version@"
publicKeyToken="@pkt@" />
<file name="heimdal.dll" />
<file name="com_err.dll" />
</assembly>

View File

@@ -0,0 +1,150 @@
########################################################################
#
# Copyright (c) 2010, Secure Endpoints Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
RELDIR=packages\windows\assembly
!include ../../../windows/NTMakefile.w32
# CODESIGN_PKT should be set to the public key token of the code
# signing certificate in use. You can use :
#
# pktextract <path to certificate>
#
# ..to derive the public key token.
#
!ifndef CODESIGN_PKT
! error CODESIGN_PKT should be set to the public key token for codesigning certificate
!endif
prep:: mk-asm-dirs
# ----------------------------------------------------------------------
# Heimdal.Kerberos Assembly
ASMKRBDIR=$(ASMDIR)\Heimdal.Kerberos
ASMKRBVER=$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(VER_PRODUCT_AUX).$(VER_PRODUCT_PATCH)
ASMKRBMAN=$(ASMKRBNAME).manifest
ASMKRBBINS=$(ASMKRBDIR)\heimdal.dll $(ASMKRBDIR)\com_err.dll
$(ASMKRBDIR)\$(ASMKRBMAN).nohash: Heimdal.Kerberos.manifest.in
$(SED) -e "s,[@]name[@],$(ASMKRBNAME),g" \
-e "s,[@]cpu[@],$(MCPU),g" \
-e "s,[@]version[@],$(ASMKRBVER),g" \
-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
$(ASMKRBDIR)\$(ASMKRBMAN) $(ASMKRBDIR)\$(ASMKRBMAN).cdf: \
$(ASMKRBDIR)\$(ASMKRBMAN).nohash $(ASMKRBBINS)
$(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN).nohash -out:$@ -hashupdate -makecdfs
$(ASMKRBDIR)\$(ASMKRBNAME).cat: $(ASMKRBDIR)\$(ASMKRBMAN).cdf
cd $(ASMKRBDIR)
$(MAKECAT) $**
$(_CODESIGN)
# $(RM) $(ASMKRBMAN).cdf
# $(RM) $(ASMKRBMAN).nohash
cd $(SRCDIR)
asm-krb: \
$(ASMKRBBINS) \
$(ASMKRBDIR)\$(ASMKRBMAN) \
$(ASMKRBDIR)\$(ASMKRBNAME).cat
all:: asm-krb
clean::
$(RM) $(ASMKRBDIR)\*.*
{$(BINDIR)}.dll{$(ASMKRBDIR)}.dll:
$(CP) $< $@
# ----------------------------------------------------------------------
# Heimdal.GSSAPI Assembly
ASMGSSDIR=$(ASMDIR)\Heimdal.GSSAPI
ASMGSSVER=$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(VER_PRODUCT_AUX).$(VER_PRODUCT_PATCH)
ASMGSSMAN=$(ASMGSSNAME).manifest
ASMGSSBINS=$(ASMGSSDIR)\libgssapi.dll
$(ASMGSSDIR)\$(ASMGSSMAN).nohash: Heimdal.GSSAPI.manifest.in
$(SED) -e "s,[@]name[@],$(ASMGSSNAME),g" \
-e "s,[@]version[@],$(ASMGSSVER),g" \
-e "s,[@]krbname[@],$(ASMKRBNAME),g" \
-e "s,[@]krbversion[@],$(ASMKRBVER),g" \
-e "s,[@]cpu[@],$(MCPU),g" \
-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
$(ASMGSSDIR)\$(ASMGSSMAN) $(ASMGSSDIR)\$(ASMGSSMAN).cdf: \
$(ASMGSSDIR)\$(ASMGSSMAN).nohash $(ASMGSSBINS)
$(MT) -manifest $(ASMGSSDIR)\$(ASMGSSMAN).nohash -out:$@ -hashupdate -makecdfs
$(ASMGSSDIR)\$(ASMGSSNAME).cat: $(ASMGSSDIR)\$(ASMGSSMAN).cdf
cd $(ASMGSSDIR)
$(MAKECAT) $**
$(_CODESIGN)
# $(RM) $(ASMGSSMAN).cdf
# $(RM) $(ASMGSSMAN).nohash
cd $(SRCDIR)
asm-gss: \
$(ASMGSSBINS) \
$(ASMGSSDIR)\$(ASMGSSMAN) \
$(ASMGSSDIR)\$(ASMGSSNAME).cat
all:: asm-gss
clean::
$(RM) $(ASMGSSDIR)\*.*
{$(BINDIR)}.dll{$(ASMGSSDIR)}.dll:
$(CP) $< $@
# ----------------------------------------------------------------------
.SUFFIXES: .dll
mk-asm-dirs:
! if !exist($(ASMKRBDIR))
$(MKDIR) $(ASMKRBDIR)
! endif
! if !exist($(ASMGSSDIR))
$(MKDIR) $(ASMGSSDIR)
! endif
! if "$(CPU)"=="i386" || "$(CPU)"=="x86"
MCPU=x86
! elseif "$(CPU)"=="AMD64"
MCPU=amd64
! else
! error Unknown CPU
! endif