xref: /trunk/main/libxml2/makefile.mk (revision f3385db031069db3e0655c6a4d85518bf39a7b68)
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=libxml2
27TARGET=so_libxml2
28
29# --- Settings -----------------------------------------------------
30
31.INCLUDE :  settings.mk
32
33.IF "$(SYSTEM_LIBXML)" == "YES"
34all:
35    @echo "An already available installation of libxml should exist on your system."
36    @echo "Therefore the version provided here does not need to be built in addition."
37.ENDIF
38
39# --- Files --------------------------------------------------------
40
41LIBXML2VERSION=2.9.10
42
43TARFILE_NAME=$(PRJNAME)-$(LIBXML2VERSION)
44TARFILE_MD5=10942a1dc23137a8aa07f0639cbfece5
45
46PATCH_FILES=libxml2-configure.patch \
47    0e1a49c8907645d2e155f0d89d4d9895ac5112b5.patch \
48    50f06b3efb638efb0abd95dc62dca05ae67882c2.patch \
49    7ffcd44d7e6c46704f8af0321d9314cd26e0e18a.patch
50
51# libxml2-global-symbols: #i112480#: Solaris ld won't export non-listed symbols
52#            libxml2-global-symbols.patch
53
54# This is only for UNX environment now
55
56.IF "$(OS)"=="WNT"
57.IF "$(COM)"=="GCC"
58xml2_CC=$(CC) -mthreads
59.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
60xml2_CC+=-shared-libgcc
61.ENDIF
62xml2_LIBS=-lws2_32
63.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
64xml2_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
65.ENDIF
66CONFIGURE_DIR=
67CONFIGURE_ACTION=.$/configure
68CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-lzma --without-iconv --enable-static=no --without-debug --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(xml2_CC)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2 -L$(ILIB:s/;/ -L/)" LIBS="$(xml2_LIBS)" OBJDUMP=objdump
69BUILD_ACTION=$(GNUMAKE)
70BUILD_DIR=$(CONFIGURE_DIR)
71.ELSE
72CONFIGURE_DIR=win32
73CONFIGURE_ACTION=cscript configure.js
74CONFIGURE_FLAGS=iconv=no sax1=yes lzma=no
75.IF "$(debug)"!=""
76CONFIGURE_FLAGS+=debug=yes
77.ENDIF
78BUILD_ACTION=nmake
79BUILD_DIR=$(CONFIGURE_DIR)
80.ENDIF
81.ELSE
82.IF "$(SYSBASE)"!=""
83xml2_CFLAGS+=-I$(SYSBASE)$/usr$/include
84.IF "$(COMNAME)"=="sunpro5"
85xml2_CFLAGS+=$(ARCH_FLAGS) $(C_RESTRICTIONFLAGS)
86.ENDIF          # "$(COMNAME)"=="sunpro5"
87xml2_LDFLAGS+=-L$(SYSBASE)$/usr$/lib
88.ENDIF          # "$(SYSBASE)"!=""
89
90# --without-iconv: no OpenOffice code calls iconv, and libxml2-configure.patch
91# has always meant to turn it off -- it patches the generated xmlversion.h,
92# which configure then regenerates, so it never took effect here. The Windows
93# build has passed iconv=no all along. Dropping it keeps UTF-8/UTF-16/ASCII/
94# Latin-1 and turns on libxml2's built-in ISO-8859-x tables; only encodings
95# like Shift_JIS, Big5 and KOI8-R go.
96CONFIGURE_DIR=
97.IF "$(OS)"=="OS2"
98CONFIGURE_ACTION=sh .$/configure
99CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib --without-lzma --without-iconv --enable-static=yes --with-sax1=yes ADDCFLAGS="$(xml2_CFLAGS)" CFLAGS="$(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS) $(EXTRA_LINKFLAGS)"
100.ELIF "$(OS)"=="MACOSX"
101# Community builds bundle a static libxml2 rather than a dylib -- see
102# main/xmlsecurity/util/makefile.mk and main/forms/util/makefile.mk for
103# the consumer side of this.
104CONFIGURE_ACTION=.$/configure
105CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib --without-lzma --without-iconv --enable-static=yes --enable-shared=no --with-sax1=yes ADDCFLAGS="$(xml2_CFLAGS) $(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS) $(EXTRA_LINKFLAGS)"
106.ELSE
107CONFIGURE_ACTION=.$/configure
108CONFIGURE_FLAGS=--enable-ipv6=no --without-python --without-zlib --without-lzma --without-iconv --enable-static=no --with-sax1=yes ADDCFLAGS="$(xml2_CFLAGS) $(EXTRA_CFLAGS)" LDFLAGS="$(xml2_LDFLAGS) $(EXTRA_LINKFLAGS)"
109.ENDIF
110BUILD_ACTION=$(GNUMAKE)
111BUILD_FLAGS+= -j$(EXTMAXPROCESS)
112BUILD_DIR=$(CONFIGURE_DIR)
113.ENDIF
114
115
116OUTDIR2INC=include$/libxml
117
118.IF "$(OS)"=="MACOSX"
119EXTRPATH=URELIB
120OUT2LIB+=.libs$/libxml2.a
121# With --enable-shared=no (see CONFIGURE_FLAGS above), libtool links xmllint
122# directly against the static lib -- no .libs/ wrapper copy -- so the binary
123# lands at the build root. (Cf. libxslt/makefile.mk's xsltproc handling.)
124OUT2BIN+=xmllint
125OUT2BIN+=xml2-config
126.ELIF "$(OS)"=="WNT"
127.IF "$(COM)"=="GCC"
128OUT2LIB+=.libs$/libxml2*.a
129OUT2BIN+=.libs$/libxml2*.dll
130OUT2BIN+=.libs$/xmllint.exe
131OUT2BIN+=xml2-config
132.ELSE
133OUT2LIB+=win32$/bin.msvc$/*.lib
134OUT2BIN+=win32$/bin.msvc$/*.dll
135OUT2BIN+=win32$/bin.msvc$/xmllint.exe
136.ENDIF
137.ELSE
138OUT2LIB+=.libs$/libxml2.so*
139OUT2BIN+=.libs$/xmllint
140OUT2BIN+=xml2-config
141.ENDIF
142
143# --- Targets ------------------------------------------------------
144
145.INCLUDE : set_ext.mk
146.INCLUDE : target.mk
147.INCLUDE : tg_ext.mk
148