xref: /aoo42x/main/libxmlsec/makefile.mk (revision 66d4592e)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=.
25cdf0e10cSrcweir
26cdf0e10cSrcweirPRJNAME=xmlsec1
27cdf0e10cSrcweirTARGET=so_xmlsec1
28cdf0e10cSrcweirEXTERNAL_WARNINGS_NOT_ERRORS := TRUE
29cdf0e10cSrcweir
30cdf0e10cSrcweir# --- Settings -----------------------------------------------------
31cdf0e10cSrcweir
32cdf0e10cSrcweir.INCLUDE :	settings.mk
33cdf0e10cSrcweir
3496e0c447SPavel Janík.IF "$(ENABLE_NSS_MODULE)" == "NO"
35cdf0e10cSrcweir@all:
3696e0c447SPavel Janík	@echo "No nss -> no libxmlsec...."
37cdf0e10cSrcweir.ENDIF
38cdf0e10cSrcweir
39cdf0e10cSrcweir# --- Files --------------------------------------------------------
40cdf0e10cSrcweir
41cdf0e10cSrcweirXMLSEC1VERSION=1.2.14
42cdf0e10cSrcweir
43cdf0e10cSrcweirTARFILE_NAME=$(PRJNAME)-$(XMLSEC1VERSION)
44cdf0e10cSrcweirTARFILE_MD5=1f24ab1d39f4a51faf22244c94a6203f
45cdf0e10cSrcweir
46cdf0e10cSrcweir#xmlsec1-configure.patch: Set up the build. Straightforward configuration
47cdf0e10cSrcweir#xmlsec1-configure-libxml-libxslt.patch: empty "$with_libxml" prepends /bin :-(
48cdf0e10cSrcweir#xmlsec1-olderlibxml2.patch: Allow build against older libxml2, for macosx
49cdf0e10cSrcweir#xmlsec1-nssdisablecallbacks.patch: Disable use of smime3 so don't need to package it
50cdf0e10cSrcweir#xmlsec1-customkeymanage.patch: Could we do this alternatively outside xmlsec
51cdf0e10cSrcweir#xmlsec1-nssmangleciphers.patch: Dubious, do we still need this ?
52cdf0e10cSrcweir#xmlsec1-noverify.patch: As per readme.txt.
53cdf0e10cSrcweir#xmlsec1-mingw32.patch: Mingw32 support.
54cdf0e10cSrcweir#xmlsec1-mingw-customkeymanage-addmscrypto.patch builds the custom keymanager on mingw
55cdf0e10cSrcweirPATCH_FILES=\
56cdf0e10cSrcweir   xmlsec1-configure.patch \
57cdf0e10cSrcweir   xmlsec1-configure-libxml-libxslt.patch \
58cdf0e10cSrcweir   xmlsec1-olderlibxml2.patch \
59cdf0e10cSrcweir   xmlsec1-nssdisablecallbacks.patch \
60cdf0e10cSrcweir   xmlsec1-customkeymanage.patch \
61cdf0e10cSrcweir   xmlsec1-nssmangleciphers.patch \
62cdf0e10cSrcweir   xmlsec1-noverify.patch \
63cdf0e10cSrcweir   xmlsec1-mingw32.patch \
64cdf0e10cSrcweir   xmlsec1-mingw-keymgr-mscrypto.patch
65cdf0e10cSrcweir
66*66d4592eSYuri Dario.IF "$(GUI)"=="OS2"
67*66d4592eSYuri DarioPATCH_FILES+=xmlsec1-os2.patch
68*66d4592eSYuri Dario.ENDIF
69cdf0e10cSrcweir
70cdf0e10cSrcweirADDITIONAL_FILES= \
71cdf0e10cSrcweir    include$/xmlsec$/mscrypto$/akmngr.h \
72cdf0e10cSrcweir    src$/mscrypto$/akmngr.c \
73cdf0e10cSrcweir    include$/xmlsec$/nss$/akmngr.h \
74cdf0e10cSrcweir    include$/xmlsec$/nss$/ciphers.h \
75cdf0e10cSrcweir    include$/xmlsec$/nss$/tokens.h \
76cdf0e10cSrcweir    src$/nss$/akmngr.c \
77cdf0e10cSrcweir    src$/nss$/keywrapers.c \
78cdf0e10cSrcweir    src$/nss$/tokens.c
79cdf0e10cSrcweir
80cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
81cdf0e10cSrcweirCRYPTOLIB=mscrypto
82cdf0e10cSrcweir#CRYPTOLIB=nss
83cdf0e10cSrcweir#BASEINC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla;$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla$/nspr;$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla$/nss;$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/external
84cdf0e10cSrcweir#BASELIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
85cdf0e10cSrcweir.ELSE
86cdf0e10cSrcweirCRYPTOLIB=nss
87cdf0e10cSrcweir.ENDIF
88cdf0e10cSrcweir
89cdf0e10cSrcweir.IF "$(OS)"=="WNT"
90cdf0e10cSrcweir.IF "$(COM)"=="GCC"
91cdf0e10cSrcweirxmlsec_CC=$(CC) -mthreads
92cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
93cdf0e10cSrcweirxmlsec_CC+=-shared-libgcc
94cdf0e10cSrcweir.ENDIF
95cdf0e10cSrcweirxmlsec_LIBS=
96cdf0e10cSrcweir.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
97cdf0e10cSrcweirxmlsec_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
98cdf0e10cSrcweir.ENDIF
99cdf0e10cSrcweirCONFIGURE_DIR=
100cdf0e10cSrcweirCONFIGURE_ACTION=.$/configure
1010a2e1b2fSHerbert DürrCONFIGURE_FLAGS=--with-libxslt=no --with-openssl=no --with-gnutls=no --enable-mscrypto --disable-crypto-dl --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(xmlsec_CC)" LDFLAGS="-no-undefined -L$(ILIB:s/;/ -L/)" LIBS="$(xmlsec_LIBS)" LIBXML2LIB=$(LIBXML2LIB) ZLIB3RDLIB=$(ZLIB3RDLIB) OBJDUMP="$(WRAPCMD) objdump"
102cdf0e10cSrcweir
1030a2e1b2fSHerbert Dürr.IF "$(SYSTEM_NSS)" != "YES"
104cdf0e10cSrcweirCONFIGURE_FLAGS+=--enable-pkgconfig=no
105cdf0e10cSrcweir.ENDIF
106cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
107cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
108cdf0e10cSrcweir.ELSE
109cdf0e10cSrcweirCONFIGURE_DIR=win32
110cdf0e10cSrcweirCONFIGURE_ACTION=cscript configure.js
111cdf0e10cSrcweir.IF "$(product)"!="full" && "$(CCNUMVER)" >= "001399999999"
112cdf0e10cSrcweirCONFIGURE_FLAGS=crypto=$(CRYPTOLIB) debug=yes xslt=no iconv=no static=no include=$(BASEINC) lib=$(BASELIB)
113cdf0e10cSrcweir.ELSE
114cdf0e10cSrcweirCONFIGURE_FLAGS=crypto=$(CRYPTOLIB) xslt=no iconv=no static=no include=$(BASEINC) lib=$(BASELIB)
115cdf0e10cSrcweir.ENDIF
116cdf0e10cSrcweirBUILD_ACTION=nmake
117cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
118cdf0e10cSrcweir.ENDIF
119cdf0e10cSrcweir.ELSE
120cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
121cdf0e10cSrcweir
122cdf0e10cSrcweir.IF "$(COM)"=="C52" && "$(CPU)"=="U"
123cdf0e10cSrcweirxmlsec_CFLAGS+=-m64
124cdf0e10cSrcweir.ENDIF
125cdf0e10cSrcweir
126cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
127cdf0e10cSrcweirxmlsec_CFLAGS+=-I$(SYSBASE)$/usr$/include
128cdf0e10cSrcweir.IF "$(COMNAME)"=="sunpro5"
129cdf0e10cSrcweirxmlsec_CFLAGS+=$(C_RESTRICTIONFLAGS)
130cdf0e10cSrcweir.ENDIF			# "$(COMNAME)"=="sunpro5"
131cdf0e10cSrcweir.IF "$(EXTRA_CFLAGS)"!=""
132cdf0e10cSrcweirxmlsec_CFLAGS+=$(EXTRA_CFLAGS)
133cdf0e10cSrcweirxmlsec_CPPFLAGS+=$(EXTRA_CFLAGS)
134cdf0e10cSrcweir.ENDIF # "$(EXTRA_CFLAGS)"!=""
135cdf0e10cSrcweirxmlsec_LDFLAGS+=-L$(SYSBASE)$/usr$/lib
136cdf0e10cSrcweir.ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!=""
137cdf0e10cSrcweirxmlsec_CPPFLAGS+=$(EXTRA_CDEFS)
138cdf0e10cSrcweir.ENDIF
139cdf0e10cSrcweir
140cdf0e10cSrcweir.IF "$(OS)$(COM)"=="LINUXGCC" || "$(OS)$(COM)"=="FREEBSDGCC"
141cdf0e10cSrcweirxmlsec_LDFLAGS+=-Wl,-rpath,'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib'
142cdf0e10cSrcweir.ENDIF			# "$(OS)$(COM)"=="LINUXGCC"
143cdf0e10cSrcweir.IF "$(OS)$(COM)"=="SOLARISC52"
144cdf0e10cSrcweirxmlsec_LDFLAGS+=-Wl,-R'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib'
145cdf0e10cSrcweir.ENDIF			# "$(OS)$(COM)"=="SOLARISC52"
146cdf0e10cSrcweir
147cdf0e10cSrcweirLDFLAGS:=$(xmlsec_LDFLAGS)
148cdf0e10cSrcweir.EXPORT: LDFLAGS
149cdf0e10cSrcweir
150cdf0e10cSrcweir.ENDIF
151cdf0e10cSrcweirCONFIGURE_DIR=
152cdf0e10cSrcweirCONFIGURE_ACTION=.$/configure ADDCFLAGS="$(xmlsec_CFLAGS)" CPPFLAGS="$(xmlsec_CPPFLAGS)"
153cdf0e10cSrcweirCONFIGURE_FLAGS=--with-pic --disable-shared --disable-crypto-dl --with-libxslt=no --with-openssl=no --with-gnutls=no LIBXML2LIB="$(LIBXML2LIB)"
1540a2e1b2fSHerbert Dürr# system-nss needs pkgconfig to get the information about nss
155cdf0e10cSrcweir# FIXME: This also will enable pkg-config usage for libxml2. It *seems*
156cdf0e10cSrcweir# that the internal headers still are used when they are there but....
157cdf0e10cSrcweir# (and that pkg-config is allowed to fail...)
158cdf0e10cSrcweir# I have no real good idea how to get mozilla (nss) pkg-config'ed and libxml2
159cdf0e10cSrcweir# not... We need mozilla-nss pkg-config'ed since we can *not* just use
160cdf0e10cSrcweir# --with-nss or parse -pkg-config --libs / cflags mozilla-nss since
161cdf0e10cSrcweir# the lib may a) be in /usr/lib (Debian) and be not in $with_nss/include
162cdf0e10cSrcweir# $with_nss/lib.
1630a2e1b2fSHerbert Dürr.IF "$(SYSTEM_NSS)" != "YES"
164cdf0e10cSrcweirCONFIGURE_FLAGS+=--enable-pkgconfig=no
165cdf0e10cSrcweir.ENDIF
166cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
167cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
168cdf0e10cSrcweir.ENDIF
169cdf0e10cSrcweir
170cdf0e10cSrcweir
171cdf0e10cSrcweirOUTDIR2INC=include$/xmlsec
172cdf0e10cSrcweir
173cdf0e10cSrcweir.IF "$(OS)"=="WNT"
174cdf0e10cSrcweir.IF "$(COM)"=="GCC"
175cdf0e10cSrcweirOUT2LIB+=src$/.libs$/libxmlsec1.dll.a src$/nss$/.libs$/libxmlsec1-nss.dll.a src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll.a
176cdf0e10cSrcweirOUT2BIN+=src$/.libs$/libxmlsec1.dll src$/nss$/.libs$/libxmlsec1-nss.dll src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll
177cdf0e10cSrcweir.ELSE
178cdf0e10cSrcweirOUT2LIB+=win32$/binaries$/*.lib
179cdf0e10cSrcweirOUT2BIN+=win32$/binaries$/*.dll
180cdf0e10cSrcweir.ENDIF
181*66d4592eSYuri Dario.ELIF "$(OS)"=="OS2"
182*66d4592eSYuri DarioOUT2LIB+=src$/.libs$/xmlsec1.lib src$/nss$/.libs$/xmlsec1-nss.lib
183*66d4592eSYuri DarioOUT2BIN+=src$/xmlsec1.dll src$/nss$/xmlsec1n.dll
184cdf0e10cSrcweir.ELSE
185cdf0e10cSrcweirOUT2LIB+=src$/.libs$/libxmlsec1.a src$/nss$/.libs$/libxmlsec1-nss.a
186cdf0e10cSrcweir.ENDIF
187cdf0e10cSrcweir
188cdf0e10cSrcweir# --- Targets ------------------------------------------------------
189cdf0e10cSrcweir
190cdf0e10cSrcweir.INCLUDE : set_ext.mk
191cdf0e10cSrcweir.INCLUDE : target.mk
192cdf0e10cSrcweir.INCLUDE : tg_ext.mk
193cdf0e10cSrcweir
194cdf0e10cSrcweir
195