xref: /trunk/main/libxmlsec/makefile.mk (revision 66d4592e)
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# system-nss needs pkgconfig to get the information about nss
155# FIXME: This also will enable pkg-config usage for libxml2. It *seems*
156# that the internal headers still are used when they are there but....
157# (and that pkg-config is allowed to fail...)
158# I have no real good idea how to get mozilla (nss) pkg-config'ed and libxml2
159# not... We need mozilla-nss pkg-config'ed since we can *not* just use
160# --with-nss or parse -pkg-config --libs / cflags mozilla-nss since
161# the lib may a) be in /usr/lib (Debian) and be not in $with_nss/include
162# $with_nss/lib.
163.IF "$(SYSTEM_NSS)" != "YES"
164CONFIGURE_FLAGS+=--enable-pkgconfig=no
165.ENDIF
166BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
167BUILD_DIR=$(CONFIGURE_DIR)
168.ENDIF
169
170
171OUTDIR2INC=include$/xmlsec
172
173.IF "$(OS)"=="WNT"
174.IF "$(COM)"=="GCC"
175OUT2LIB+=src$/.libs$/libxmlsec1.dll.a src$/nss$/.libs$/libxmlsec1-nss.dll.a src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll.a
176OUT2BIN+=src$/.libs$/libxmlsec1.dll src$/nss$/.libs$/libxmlsec1-nss.dll src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll
177.ELSE
178OUT2LIB+=win32$/binaries$/*.lib
179OUT2BIN+=win32$/binaries$/*.dll
180.ENDIF
181.ELIF "$(OS)"=="OS2"
182OUT2LIB+=src$/.libs$/xmlsec1.lib src$/nss$/.libs$/xmlsec1-nss.lib
183OUT2BIN+=src$/xmlsec1.dll src$/nss$/xmlsec1n.dll
184.ELSE
185OUT2LIB+=src$/.libs$/libxmlsec1.a src$/nss$/.libs$/libxmlsec1-nss.a
186.ENDIF
187
188# --- Targets ------------------------------------------------------
189
190.INCLUDE : set_ext.mk
191.INCLUDE : target.mk
192.INCLUDE : tg_ext.mk
193
194
195