merged tag ooo/DEV300_m102
[LibreOffice.git] / cppunit / makefile.mk
blob043ce740655d1e10b241b403dc988c68dee20833
1 #*************************************************************************
2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 # Copyright 2000, 2010 Oracle and/or its affiliates.
6 # OpenOffice.org - a multi-platform office productivity suite
8 # This file is part of OpenOffice.org.
10 # OpenOffice.org is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU Lesser General Public License version 3
12 # only, as published by the Free Software Foundation.
14 # OpenOffice.org is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Lesser General Public License version 3 for more details
18 # (a copy is included in the LICENSE file that accompanied this code).
20 # You should have received a copy of the GNU Lesser General Public License
21 # version 3 along with OpenOffice.org. If not, see
22 # <http://www.openoffice.org/license.html>
23 # for a copy of the LGPLv3 License.
24 #***********************************************************************/
26 PRJ = .
27 PRJNAME = cppunit
28 TARGET = cppunit
30 .INCLUDE: settings.mk
32 TARFILE_NAME = cppunit-1.12.1
33 TARFILE_MD5=bd30e9cf5523cdfc019b94f5e1d7fd19
34 # from <https://sourceforge.net/projects/cppunit/files/cppunit/1.12.1/
35 # cppunit-1.12.1.tar.gz/download>
37 PATCH_FILES = solarisfinite.patch warnings.patch windows.patch ldflags.patch
38 # solarisfinite.patch: see <https://sourceforge.net/tracker/?func=detail&
39 # aid=2912590&group_id=11795&atid=311795>
40 # warnings.patch: see <https://sourceforge.net/tracker/?func=detail&
41 # aid=2912630&group_id=11795&atid=311795>
43 .IF "$(OS)" == "WNT"
44 .IF "$(COM)" == "MSC"
46 # On Windows, CppUnit appears to support either the Unix-style configure/make
47 # approach with cygwin and gcc (and libtool fails miserably if gcc is replaced
48 # by MSVC cl), or a Visual Studio project (CppUnitLibraries.dsw). However, the
49 # latter is too old to work with vcbuild from a wntmsci12 tool chain. So, the
50 # easiest way appears to inject hand-crafted dmake makefiles to build the
51 # relevant parts. (Another approach would be to manually use the Visual Studio
52 # IDE to convert CppUnitLibraries.dsw to modern format, inject the resulting
53 # cppunit_dll.vcproj and DllPlugInTester.vcproj and build those with vcbuild.)
55 CONFIGURE_ACTION = $(SED) -e s:@BACKPATH@:../$(BACK_PATH): \
56 < ../$(BACK_PATH)$(PATH_IN_MODULE)/ooo-cppunit_dll.mk \
57 > src/cppunit/ooo-cppunit_dll.mk && \
58 $(SED) -e s:@BACKPATH@:../$(BACK_PATH): \
59 < ../$(BACK_PATH)$(PATH_IN_MODULE)/ooo-DllPlugInTester.mk \
60 > src/DllPlugInTester/ooo-DllPlugInTester.mk
62 BUILD_ACTION = cd src/cppunit && dmake -f ooo-cppunit_dll.mk && \
63 cd ../DllPlugInTester && dmake -f ooo-DllPlugInTester.mk
65 OUTDIR2INC = include/cppunit
67 .INCLUDE: set_ext.mk
68 .INCLUDE: target.mk
69 .INCLUDE: tg_ext.mk
71 $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE): ooo-cppunit_dll.mk ooo-DllPlugInTester.mk
73 .ELSE
74 .IF "$(COM)" == "GCC"
75 EXTRA_CFLAGS += -mthreads
76 LDFLAGS += -Wl,--enable-runtime-pseudo-reloc-v2
78 .IF "$(USE_SYSTEM_STL)" != "YES"
80 OOO_STLPORT_CXXFLAGS = -I$(SOLARINCDIR)/stl
81 .IF "$(USE_STLP_DEBUG)" == "TRUE"
82 OOO_STLPORT_CXXFLAGS += -D_STLP_DEBUG
83 .END
84 OOO_STLPORT_CXXFLAGS += -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH)
86 OOO_STLPORT_LDFLAGS = -L$(SOLARLIBDIR)
87 OOO_STLPORT_LIBS = $(LIBSTLPORT)
89 .END
91 CONFIGURE_ACTION = ./configure
92 CONFIGURE_FLAGS = --prefix=$(shell cd $(PACKAGE_DIR) && \
93 pwd $(PWDFLAGS))/$(TARFILE_ROOTDIR)/ooo-install \
94 --disable-dependency-tracking --disable-static --disable-doxygen \
95 --disable-html-docs --disable-latex-docs CC='$(CC)' CXX='$(CXX)' \
96 CXXFLAGS='$(EXTRA_CFLAGS) $(OOO_STLPORT_CXXFLAGS)' \
97 LDFLAGS='$(LDFLAGS) $(OOO_STLPORT_LDFLAGS)' \
98 LIBS='$(OOO_STLPORT_LIBS) $(MY_LIBS)'
100 BUILD_ACTION = $(GNUMAKE) -j$(EXTMAXPROCESS)
101 BUILD_FLAGS = install
103 OUTDIR2INC = ooo-install/include/cppunit
105 OUT2BIN = ooo-install/bin/DllPlugInTester.exe \
106 ooo-install/bin/cygcppunit-1-12-1.dll
107 OUT2LIB = ooo-install/lib/libcppunit.dll.a
109 .INCLUDE: set_ext.mk
110 .INCLUDE: target.mk
111 .INCLUDE: tg_ext.mk
113 .ENDIF # "$(COM)" == "GCC"
114 .ENDIF # "$(COM)" == "MSC"
116 .ELSE
118 .IF "$(USE_SYSTEM_STL)" != "YES"
120 OOO_STLPORT_CXXFLAGS = -I$(SOLARINCDIR)/stl
121 .IF "$(USE_STLP_DEBUG)" == "TRUE"
122 OOO_STLPORT_CXXFLAGS += -D_STLP_DEBUG
123 .END
124 .IF "$(COM)" == "GCC"
125 OOO_STLPORT_CXXFLAGS += -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH)
126 .END
128 OOO_STLPORT_LDFLAGS = -L$(SOLARLIBDIR)
129 OOO_STLPORT_LIBS = $(LIBSTLPORT)
131 # When "checking for C compiler default output file name" configure
132 # unfortunately uses "$CC $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS" to build
133 # a C program that links against $(LIBSTLPORT); at least on one unxlngi6
134 # machine, this has been observed to fail with "/lib/libm.so.6: undefined
135 # reference to `_rtld_global_ro@GLIBC_PRIVATE'" unless -lm is also specified:
136 .IF "$(OS)" == "LINUX" && "$(COM)" == "GCC" && "$(CPU)" == "I"
137 OOO_STLPORT_LIBS += -lm
138 # #i112124# furthermore, STLPort seems to require libstdc++
139 OOO_STLPORT_LIBS += -lstdc++
140 .END
142 # And later, when "checking whether the C compiler works" configure tries to
143 # execute that program; however, the program would fail to locate the STLport
144 # library (another work-around might be to add something like --as-needed around
145 # $(LIBSTLPORT)):
146 .IF "$(OS)" == "FREEBSD" || "$(OS)" == "LINUX" || "$(OS)" == "SOLARIS"
147 .IF "$(LD_LIBRARY_PATH)" == ""
148 LD_LIBRARY_PATH := $(SOLARLIBDIR)
149 # strictly speaking, this is incorrect if the LD_LIBRARY_PATH environment
150 # variable is set to the empty string
151 .ELSE
152 LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(SOLARLIBDIR)
153 .END
154 .EXPORT: LD_LIBRARY_PATH
155 .END
157 .END
159 # At least on Solaris with Sun CC, linking the cppunit dynamic library fails as
160 # TestAssert.o uses fabs but -lm is missing from the command line (cppunit's
161 # aclocal.m4 contains an unused AC_CHECK_LIBM, maybe using that would be a
162 # better fix):
163 .IF "$(OS)" == "SOLARIS" && "$(COM)" == "C52"
164 MY_LIBS = -lm
165 .END
167 CONFIGURE_ACTION = ./configure
168 CONFIGURE_FLAGS = --prefix=$(shell cd $(PACKAGE_DIR) && \
169 pwd $(PWDFLAGS))/$(TARFILE_ROOTDIR)/ooo-install \
170 --disable-dependency-tracking --disable-static --disable-doxygen \
171 --disable-html-docs --disable-latex-docs CC='$(CC)' CXX='$(CXX)' \
172 CXXFLAGS='$(EXTRA_CFLAGS) $(OOO_STLPORT_CXXFLAGS)' \
173 LDFLAGS='$(LDFLAGS) $(OOO_STLPORT_LDFLAGS)' \
174 LIBS='$(OOO_STLPORT_LIBS) $(MY_LIBS)'
176 BUILD_ACTION = $(GNUMAKE) -j$(EXTMAXPROCESS)
177 BUILD_FLAGS = install
179 OUTDIR2INC = ooo-install/include/cppunit
181 OUT2BIN = ooo-install/bin/DllPlugInTester
182 .IF "$(OS)" == "MACOSX"
183 OUT2LIB = ooo-install/lib/libcppunit-1.12.1.dylib
184 EXTRPATH = NONE
185 .ELSE
186 OUT2LIB = ooo-install/lib/libcppunit-1.12.so.1
187 .END
189 .INCLUDE: set_ext.mk
190 .INCLUDE: target.mk
191 .INCLUDE: tg_ext.mk
193 .END