xref: /trunk/main/stlport/makefile.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28PRJ=.
29
30PRJNAME=so_stlport
31TARGET=so_stlport
32
33# --- Settings -----------------------------------------------------
34
35.INCLUDE :	settings.mk
36
37.IF "$(USE_SYSTEM_STL)"=="YES"
38
39.IF "$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
40# System STL when building with SunStudio is just a version of STLport
41# which comes with the compiler
42all:
43	@echo "Nothing to do"
44.ELSE #"$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
45#
46# If you choose to build without stlport, some headers will be used to bring the
47# sgi extensions into the std namespace:
48$(INCCOM)$/stlport$/functional \
49$(INCCOM)$/stlport$/hash_map \
50$(INCCOM)$/stlport$/hash_set \
51$(INCCOM)$/stlport$/numeric \
52$(INCCOM)$/stlport$/slist \
53$(INCCOM)$/stlport$/rope \
54$(INCCOM)$/stlport$/vector: systemstl$/$$(@:f)
55    $(MKDIRHIER) $(@:d)
56    $(COPY) $< $@
57.ENDIF #"$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
58
59.ELSE # "$(USE_SYSTEM_STL)"
60
61# --- Files --------------------------------------------------------
62.EXPORT : CC CXX
63.IF "$(COMID)"=="gcc3"
64	TARFILE_NAME=STLport-4.5
65    TARFILE_MD5=18f577b374d60b3c760a3a3350407632
66    PATCH_FILES=STLport-4.5.patch STLport-4.5-gcc43_warnings.patch
67.ELIF "$(GUI)"=="WNT"
68    .IF "$(CCNUMVER)"<="001300000000"
69        TARFILE_NAME=STLport-4.0
70        TARFILE_MD5=c441926f3a552ed3e5b274b62e86af16
71        PATCH_FILES=STLport-4.0.patch
72    .ELSE
73        TARFILE_NAME=STLport-4.5-0119
74        TARFILE_MD5=7376930b0d3f3d77a685d94c4a3acda8
75        PATCH_FILES=STLport-4.5-0119.patch
76    .ENDIF
77.ELSE
78    TARFILE_NAME=STLport-4.0
79    TARFILE_MD5=c441926f3a552ed3e5b274b62e86af16
80    PATCH_FILES=STLport-4.0.patch STLport-4.0-sunstudio12u1.patch
81        # To disable warnings from within STLport headers on unxsoli4 and
82        # unxsols4, STLport-4.0.patch had to be extended mechanically by
83        #
84        #   cd unxsol.../misc/build/STLport-4.0/stlport && \
85        #   find . -type f -exec sed -i \
86        #     -e 's/^\([ \t]*__STL_BEGIN_NAMESPACE[ \t]*\)$/#if defined \
87        #       __SUNPRO_CC\n#pragma disable_warn\n#endif\n&/' \
88        #     -e 's/^\([ \t]*__STL_END_NAMESPACE[ \t]*\)$/&\n#if defined \
89        #       __SUNPRO_CC\n#pragma enable_warn\n#endif/' {} \;
90        #
91        # (causing lots of files to become modified) and by additionally
92        # changing unxsol.../misc/build/STLport-4.0/stlport/math.h,
93        # unxsol.../misc/build/STLport-4.0/stlport/stl/_config.h,
94        # unxsol.../misc/build/STLport-4.0/stlport/stl/_list.h, and
95        # unxsol.../misc/build/STLport-4.0/stlport/stl/type_traits.h manually.
96        # (Obviously due to the way the C++ compiler generates code for
97        # instantiations of inline function templates from STLport headers, it
98        # does not work to simply add "#pragma disable_warn" to stl/_prolog.h
99        # and "#pragma enable_warn" to stl/_epilog.h, as seemingly some internal
100        # STLport headers are read in by the compiler only at the end of a
101        # compilation unit, outside the scope of stl/_prolog.h and
102        # stl/_epilog.h.)
103.ENDIF
104
105ADDITIONAL_FILES=src$/gcc-3.0.mak src$/gcc-3.0-freebsd.mak src$/sunpro8.mak src$/sunpro11.mak src$/gcc-3.0-mingw.mak \
106	src$/gcc-3.0-os2.mak src$/gcc-3.0-os2.def src$/common_macros_os2.mak
107
108
109CONFIGURE_ACTION=none
110CONFIGURE_FLAGS=
111
112BUILD_DIR=src
113
114.IF "$(COM)"=="MSC"
115BUILD_ACTION=nmake
116.IF "$(CCNUMVER)"<="001400000000"
117BUILD_FLAGS=-f vc7.mak EXFLAGS="/EHsc"
118.ELSE			# "$(CCNUMVER)"<="001400000000"
119BUILD_FLAGS=-f vc7.mak EXFLAGS="/EHa /Zc:wchar_t-" CCNUMVER=$(CCNUMVER)
120.ENDIF			# "$(CCNUMVER)"<="001400000000"
121.ENDIF
122
123.IF "$(COM)"=="GCC"
124	.IF "$(COMID)"=="gcc3"
125		# FreeBSD needs a special makefile
126		.IF "$(OS)"=="FREEBSD"
127			BUILD_FLAGS=-f gcc-3.0-freebsd.mak
128		.ELIF "$(OS)"=="OS2"
129			BUILD_FLAGS=-f gcc-3.0-os2.mak
130		.ELIF "$(GUI)"=="WNT"
131			BUILD_FLAGS=-f gcc-3.0-mingw.mak
132		.ELSE
133			BUILD_FLAGS=-f gcc-3.0.mak
134		.ENDIF
135	.ELSE # "$(COMID)"=="gcc3"
136		.IF "$(OS)"=="FREEBSD"
137			BUILD_FLAGS=-f gcc-freebsd.mak
138		.ELSE
139			BUILD_FLAGS=-f gcc.mak
140		.ENDIF
141	.ENDIF # "$(COMID)"=="gcc3"
142	BUILD_ACTION=$(GNUMAKE)
143	# build in parallel
144	BUILD_FLAGS+= -j$(MAXPROCESS)
145.ENDIF
146.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
147CXX+= -Wl,--hash-style=both
148.ENDIF
149
150.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)"  == "TRUE"
151CXX+= -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
152.ENDIF
153
154.IF "$(COM)"=="C52"
155BUILD_ACTION=make
156.IF "$(CCNUMVER)">="00050008"
157BUILD_FLAGS=-f sunpro11.mak
158.ELIF "$(CCNUMVER)">="00050005"
159BUILD_FLAGS=-f sunpro8.mak
160.ELSE
161BUILD_FLAGS=-f sunpro6.mak
162.ENDIF # "$(CCNUMVER)">="00050008"
163
164OUT2INC= \
165    stlport$/SC5$/*.SUNWCCh
166.ENDIF
167
168OUTDIR2INC= \
169    stlport
170
171.IF "$(GUI)"=="WNT"
172.IF "$(COM)"=="GCC"
173
174OUT2LIB= \
175    lib$/lib*_static.a
176
177OUT2BIN= \
178    lib$/*.dll
179
180.ELSE
181
182OUT2LIB= \
183    lib$/*.lib
184
185OUT2BIN= \
186    lib$/*.dll \
187    lib$/*.pdb
188
189.ENDIF # "$(COM)"=="GCC"
190
191.ELIF "$(GUI)"=="OS2"
192
193OUT2LIB= lib$/*.lib
194OUT2BIN= lib$/*.dll
195
196.ELSE          # "$(GUI)"=="WNT"
197
198OUT2LIB= \
199    lib$/lib*
200
201.ENDIF          # "$(GUI)"=="WNT"
202
203# --- Targets ------------------------------------------------------
204
205.IF "$(STLPORT4)"!="NO_STLPORT4"
206all :
207       @echo "         An already available installation of STLport has been chosen in the configure process."
208       @echo "         Therefore the version provided here does not need to be built in addition."
209.ELIF "$(OS)"=="MACOSX"
210all:
211    @echo '--with-stlport=yes is not supported on Mac OS X'
212    false
213.ENDIF
214
215.INCLUDE : 	set_ext.mk
216.INCLUDE :	target.mk
217.INCLUDE :	tg_ext.mk
218
219.IF "$(GUI)"=="WNT"
220.IF "$(COM)"!="GCC"
221.IF "$(CCNUMVER)"<="001300000000"
222
223$(MISC)$/$(TARFILE_ROOTDIR) : avoid_win32_patches
224avoid_win32_patches :
225	@$(ECHONL)
226	@echo ERROR! this module can't use automated patch creation
227	@echo on windows.
228	@$(ECHONL)
229	force_dmake_to_error
230
231$(PACKAGE_DIR)$/so_custom_patch :  $(PACKAGE_DIR)$/$(PATCH_FLAG_FILE)
232    win32_custom.bat $(PACKAGE_DIR) $(BACK_PATH) && $(TOUCH) $@
233
234$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_custom_patch
235
236.IF "$(USE_NEW_SDK)"!=""
237$(PACKAGE_DIR)$/win32_sdk_patch :  $(PACKAGE_DIR)$/$(PATCH_FLAG_FILE)
238    win32_sdk.bat $(PACKAGE_DIR) $(BACK_PATH) && $(TOUCH) $@
239
240$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/win32_sdk_patch
241.ENDIF			# "$(USE_NEW_SDK)"!=""
242.ENDIF			# COMVER<=001300000000
243.ENDIF "$(COM)"=="GCC"
244.ENDIF          # "$(GUI)"=="WNT"
245
246.ENDIF # "$(USE_SYSTEM_STL)"
247