xref: /AOO42X/main/libxmlsec/makefile.mk (revision bf92e59e8d891a17f9b48767b3a99bcce7f68ffb)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ=.
25
26PRJNAME=xmlsec1
27TARGET=so_xmlsec1
28EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
29
30# --- Settings -----------------------------------------------------
31
32.INCLUDE :  settings.mk
33
34.IF "$(ENABLE_NSS_MODULE)" == "NO"
35@all:
36    @echo "No nss -> no libxmlsec...."
37.ENDIF
38
39# --- Files --------------------------------------------------------
40
41XMLSEC1VERSION=1.2.14
42
43TARFILE_NAME=$(PRJNAME)-$(XMLSEC1VERSION)
44TARFILE_MD5=1f24ab1d39f4a51faf22244c94a6203f
45
46#xmlsec1-configure.patch: Set up the build. Straightforward configuration
47#xmlsec1-configure-libxml-libxslt.patch: empty "$with_libxml" prepends /bin :-(
48#xmlsec1-olderlibxml2.patch: Allow build against older libxml2, for macosx
49#xmlsec1-nssdisablecallbacks.patch: Disable use of smime3 so don't need to package it
50#xmlsec1-customkeymanage.patch: Could we do this alternatively outside xmlsec
51#xmlsec1-nssmangleciphers.patch: Dubious, do we still need this ?
52#xmlsec1-noverify.patch: As per readme.txt.
53#xmlsec1-mingw32.patch: Mingw32 support.
54#xmlsec1-mingw-customkeymanage-addmscrypto.patch builds the custom keymanager on mingw
55PATCH_FILES=\
56   xmlsec1-configure.patch \
57   xmlsec1-configure-libxml-libxslt.patch \
58   xmlsec1-olderlibxml2.patch \
59   xmlsec1-nssdisablecallbacks.patch \
60   xmlsec1-customkeymanage.patch \
61   xmlsec1-nssmangleciphers.patch \
62   xmlsec1-noverify.patch \
63   xmlsec1-mingw32.patch \
64   xmlsec1-mingw-keymgr-mscrypto.patch
65
66.IF "$(GUI)"=="OS2"
67PATCH_FILES+=xmlsec1-os2.patch
68.ENDIF
69
70ADDITIONAL_FILES= \
71    include$/xmlsec$/mscrypto$/akmngr.h \
72    src$/mscrypto$/akmngr.c \
73    include$/xmlsec$/nss$/akmngr.h \
74    include$/xmlsec$/nss$/ciphers.h \
75    include$/xmlsec$/nss$/tokens.h \
76    src$/nss$/akmngr.c \
77    src$/nss$/keywrapers.c \
78    src$/nss$/tokens.c
79
80.IF "$(GUI)"=="WNT"
81CRYPTOLIB=mscrypto
82#CRYPTOLIB=nss
83#BASEINC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla;$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla$/nspr;$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla$/nss;$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/external
84#BASELIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
85.ELSE
86CRYPTOLIB=nss
87.ENDIF
88
89.IF "$(OS)"=="WNT"
90.IF "$(COM)"=="GCC"
91xmlsec_CC=$(CC) -mthreads
92.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
93xmlsec_CC+=-shared-libgcc
94.ENDIF
95xmlsec_LIBS=
96.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
97xmlsec_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
98.ENDIF
99CONFIGURE_DIR=
100CONFIGURE_ACTION=.$/configure
101CONFIGURE_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"
102
103.IF "$(SYSTEM_NSS)" != "YES"
104CONFIGURE_FLAGS+=--enable-pkgconfig=no
105.ENDIF
106BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
107BUILD_DIR=$(CONFIGURE_DIR)
108.ELSE
109CONFIGURE_DIR=win32
110CONFIGURE_ACTION=cscript configure.js
111.IF "$(product)"!="full" && "$(CCNUMVER)" >= "001399999999"
112CONFIGURE_FLAGS=crypto=$(CRYPTOLIB) debug=yes xslt=no iconv=no static=no include=$(BASEINC) lib=$(BASELIB)
113.ELSE
114CONFIGURE_FLAGS=crypto=$(CRYPTOLIB) xslt=no iconv=no static=no include=$(BASEINC) lib=$(BASELIB)
115.ENDIF
116BUILD_ACTION=nmake
117BUILD_DIR=$(CONFIGURE_DIR)
118.ENDIF
119.ELSE
120.IF "$(GUI)"=="UNX"
121
122.IF "$(COM)"=="C52" && "$(CPU)"=="U"
123xmlsec_CFLAGS+=-m64
124.ENDIF
125
126.IF "$(SYSBASE)"!=""
127xmlsec_CFLAGS+=-I$(SYSBASE)$/usr$/include
128.IF "$(COMNAME)"=="sunpro5"
129xmlsec_CFLAGS+=$(C_RESTRICTIONFLAGS)
130.ENDIF          # "$(COMNAME)"=="sunpro5"
131.IF "$(EXTRA_CFLAGS)"!=""
132xmlsec_CFLAGS+=$(EXTRA_CFLAGS)
133xmlsec_CPPFLAGS+=$(EXTRA_CFLAGS)
134.ENDIF # "$(EXTRA_CFLAGS)"!=""
135xmlsec_LDFLAGS+=-L$(SYSBASE)$/usr$/lib
136.ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!=""
137xmlsec_CPPFLAGS+=$(EXTRA_CDEFS)
138.ENDIF
139
140.IF "$(OS)$(COM)"=="LINUXGCC" || "$(OS)$(COM)"=="FREEBSDGCC"
141xmlsec_LDFLAGS+=-Wl,-rpath,'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib'
142.ENDIF          # "$(OS)$(COM)"=="LINUXGCC"
143.IF "$(OS)$(COM)"=="SOLARISC52"
144xmlsec_LDFLAGS+=-Wl,-R'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib'
145.ENDIF          # "$(OS)$(COM)"=="SOLARISC52"
146
147LDFLAGS:=$(xmlsec_LDFLAGS)
148.EXPORT: LDFLAGS
149
150.ENDIF
151CONFIGURE_DIR=
152CONFIGURE_ACTION=.$/configure ADDCFLAGS="$(xmlsec_CFLAGS)" CPPFLAGS="$(xmlsec_CPPFLAGS)"
153CONFIGURE_FLAGS=--with-pic --disable-shared --disable-crypto-dl --with-libxslt=no --with-openssl=no --with-gnutls=no LIBXML2LIB="$(LIBXML2LIB)"
154# Pin xmlsec's libxml2 lookup to the prefix configure settled on.
155#
156# Without --with-libxml the AOO patches leave xmlsec resolving a bare
157# "xml2-config" off $PATH, which on a Mac carrying MacPorts/Homebrew is
158# often not the one --with-system-libxml named. The mis-pick is silent
159# until link time: newer libxml2 renamed the stack helpers but kept the
160# old spellings as macros (inputPush -> xmlCtxtPushInput, valuePush ->
161# xmlXPathValuePush), so xmlsec 1.2.14 built against post-rename headers
162# emits the new names and the older archive xmlsecurity links lacks them.
163# Compile-side counterpart to the absolute-path link fix in
164# xmlsecurity/util/makefile.mk and forms/util/makefile.mk; both are needed.
165#
166# Guarded on SYSTEM_LIBXML: the internal build already gets an
167# absolute-path xml2-config, which AC_PATH_PROG honors as-is.
168.IF "$(SYSTEM_LIBXML)"=="YES" && "$(LIBXML_PREFIX)"!=""
169CONFIGURE_FLAGS+=--with-libxml=$(LIBXML_PREFIX)
170.ENDIF
171# system-nss needs pkgconfig to get the information about nss
172# FIXME: This also will enable pkg-config usage for libxml2. It *seems*
173# that the internal headers still are used when they are there but....
174# (and that pkg-config is allowed to fail...)
175# I have no real good idea how to get mozilla (nss) pkg-config'ed and libxml2
176# not... We need mozilla-nss pkg-config'ed since we can *not* just use
177# --with-nss or parse -pkg-config --libs / cflags mozilla-nss since
178# the lib may a) be in /usr/lib (Debian) and be not in $with_nss/include
179# $with_nss/lib.
180.IF "$(SYSTEM_NSS)" != "YES"
181CONFIGURE_FLAGS+=--enable-pkgconfig=no
182.ENDIF
183BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
184BUILD_DIR=$(CONFIGURE_DIR)
185.ENDIF
186
187
188OUTDIR2INC=include$/xmlsec
189
190.IF "$(OS)"=="WNT"
191.IF "$(COM)"=="GCC"
192OUT2LIB+=src$/.libs$/libxmlsec1.dll.a src$/nss$/.libs$/libxmlsec1-nss.dll.a src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll.a
193OUT2BIN+=src$/.libs$/libxmlsec1.dll src$/nss$/.libs$/libxmlsec1-nss.dll src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll
194.ELSE
195OUT2LIB+=win32$/binaries$/*.lib
196OUT2BIN+=win32$/binaries$/*.dll
197.ENDIF
198.ELIF "$(OS)"=="OS2"
199OUT2LIB+=src$/.libs$/xmlsec1.lib src$/nss$/.libs$/xmlsec1-nss.lib
200OUT2BIN+=src$/xmlsec1.dll src$/nss$/xmlsec1n.dll
201.ELSE
202OUT2LIB+=src$/.libs$/libxmlsec1.a src$/nss$/.libs$/libxmlsec1-nss.a
203.ENDIF
204
205# --- Targets ------------------------------------------------------
206
207.INCLUDE : set_ext.mk
208.INCLUDE : target.mk
209.INCLUDE : tg_ext.mk
210