build fix
[LibreOffice.git] / odk / settings / settings.mk
blob74bd791c0462256683cd142783d588f9fc25d1ff
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 # Global settings file for the minimal build environment of the SDK
20 # This file have to updated/extended for other platforms.
22 include $(OO_SDK_HOME)/settings/dk.mk
24 # debug option, default is no debug
25 DEBUG=no
26 ifeq "$(MAKECMDGOALS)" "debug"
27 DEBUG=yes
28 endif
30 ###########################################################################
32 # Java settings
34 ###########################################################################
35 JAVAC_FLAGS=
37 ifeq "$(DEBUG)" "yes"
38 JAVAC_FLAGS+=-g
39 endif
41 JAVABIN=bin
43 ###########################################################################
45 # Windows specific settings
47 ###########################################################################
48 ifeq "$(PLATFORM)" "windows"
49 # Settings for Windows using Microsoft compiler/linker
51 OS=WIN
52 PS:=$(strip \ )
53 ICL=$$
54 CC=cl
55 LINK=link
56 BUILDLIB=lib
57 ECHO=@echo
58 MKDIR=mkdir
59 MV=move
60 CAT=type
61 OBJ_EXT=obj
62 EXE_EXT=.exe
63 COPY=copy
64 SHAREDLIB_EXT=dll
65 SHAREDLIB_OUT=$(OUT_BIN)
66 UNOPKG_PLATFORM=Windows
68 OSEP=^<
69 CSEP=^>
70 QUOTE=
71 QM=
72 SQM=
73 ECHOLINE=@echo.
74 P2BG=
76 DEL=del
77 DELRECURSIVE=rd /S /Q
78 URLPREFIX=file:///
80 SALLIB=isal.lib
81 CPPULIB=icppu.lib
82 CPPUHELPERLIB=icppuhelper.lib
83 SALHELPERLIB=isalhelper.lib
84 PURPENVHELPERLIB=ipurpenvhelper.lib
86 BLANK=
87 EMPTYSTRING=
88 PATH_SEPARATOR=;
90 ifeq "$(LIBO_SDK_ENABLE_DBGUTIL)" "TRUE"
91 LIBO_SDK_DETAIL_CFLAGS_MSVCRT = -MDd
92 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT = msvcrtd.lib
93 else
94 LIBO_SDK_DETAIL_CFLAGS_MSVCRT = -MD
95 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT = msvcrt.lib
96 endif
98 # use this for release version
99 ifeq "$(DEBUG)" "yes"
100 OPT_FLAGS=-Zi
101 endif
102 CC_FLAGS_JNI=-c $(LIBO_SDK_DETAIL_CFLAGS_MSVCRT) -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa $(OPT_FLAGS)
103 CC_FLAGS=-c $(LIBO_SDK_DETAIL_CFLAGS_MSVCRT) -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa $(OPT_FLAGS)
104 ifeq "$(CPP_MANIFEST)" "true"
105 LINK_MANIFEST=mt -manifest $@.manifest "-outputresource:$@;2"
106 else
107 LINK_MANIFEST=
108 endif
110 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
111 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/win32"
113 # define for used compiler necessary for UNO
114 # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
116 ifeq "$(PROCTYPE)" "x86_64"
117 CPPU_ENV=mscx
118 else
119 CPPU_ENV=msci
120 endif
122 CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=$(CPPU_ENV)
123 CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=$(CPPU_ENV)
124 CC_OUTPUT_SWITCH=-Fo
126 LIBO_SDK_LDFLAGS_STDLIBS = $(LIBO_SDK_DETAIL_LDFLAGS_MSVCRT) kernel32.lib
128 LIBRARY_LINK_FLAGS=/DLL /DEBUGTYPE:cv
129 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) /DEF:$(PRJ)/settings/component.uno.def
130 EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1b000000 /DEBUGTYPE:cv $(LIBO_SDK_LDFLAGS_STDLIBS)
131 ifeq "$(DEBUG)" "yes"
132 LIBRARY_LINK_FLAGS+=/DEBUG
133 EXE_LINK_FLAGS+=/DEBUG
134 endif
136 LINK_JAVA_LIBS=/LIBPATH:"$(OO_SDK_JAVA_HOME)/lib"
138 URE_MISC=${OFFICE_PROGRAM_PATH}
140 # use this for release version
141 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
142 #LIBRARY_LINK_FLAGS=/DLL
143 endif
147 ###########################################################################
149 # Solaris specific settings
151 ###########################################################################
152 ifeq "$(PLATFORM)" "solaris"
153 # Settings for Solaris using GCC
155 ifeq "$(PROCTYPE)" "sparc"
156 PLATFORM=solsparc
157 UNOPKG_PLATFORM=Solaris_SPARC
158 JAVA_PROC_TYPE=sparc
159 else
160 ifeq "$(PROCTYPE)" "sparc64"
161 PLATFORM=solsparc
162 UNOPKG_PLATFORM=Solaris_SPARC64
163 JAVA_PROC_TYPE=sparcv9
164 else
165 PLATFORM=solintel
166 UNOPKG_PLATFORM=Solaris_x86
167 JAVA_PROC_TYPE=i386
168 endif
169 endif
171 OS=SOLARIS
172 PS=/
173 ICL=\$$
174 CC=g++
175 LINK=g++
176 LIB=g++
177 ECHO=@echo
178 MKDIR=mkdir -p
179 CAT=cat
180 OBJ_EXT=o
181 SHAREDLIB_EXT=so
182 SHAREDLIB_PRE=lib
183 SHAREDLIB_OUT=$(OUT_LIB)
185 OSEP=\<
186 CSEP=\>
187 QUOTE=$(subst S,\,S)
188 QM=\"
189 SQM='
190 ECHOLINE=@echo
191 P2BG=&
193 DEL=rm -f
194 DELRECURSIVE=rm -rf
195 COPY=cp
196 URLPREFIX=file://
198 COMID=gcc3
199 CPPU_ENV=gcc3
201 SALLIB=-luno_sal
202 CPPULIB=-luno_cppu
203 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
204 SALHELPERLIB=-luno_salhelper$(COMID)
205 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
207 EMPTYSTRING=
208 PATH_SEPARATOR=:
210 # -O is necessary for inlining (see gcc documentation)
211 ifeq "$(DEBUG)" "yes"
212 OPT_FLAGS=-g
213 else
214 OPT_FLAGS=-O
215 endif
216 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
217 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
218 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
219 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
221 # define for used compiler necessary for UNO
223 CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=$(CPPU_ENV) -DGCC
224 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=$(CPPU_ENV) -DGCC
225 CC_OUTPUT_SWITCH=-o
227 LIBO_SDK_LDFLAGS_STDLIBS =
229 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -fPIC -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
230 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
232 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
233 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
234 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
236 ifeq "$(PROCTYPE)" "sparc64"
237 CC_FLAGS+=-m64
238 LIBRARY_LINK_FLAGS+=-m64
239 EXE_LINK_FLAGS+=-m64
240 endif
242 URE_MISC=$(OFFICE_PROGRAM_PATH)
244 endif
248 ###########################################################################
250 # Linux specific settings
252 ###########################################################################
253 ifeq "$(PLATFORM)" "linux"
254 # Settings for Linux using gcc compiler
256 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
257 JAVA_PROC_TYPE=$(PROCTYPE)
259 ifeq "$(PROCTYPE)" "x86"
260 JAVA_PROC_TYPE=i386
261 endif
263 ifeq "$(PROCTYPE)" "powerpc"
264 UNOPKG_PLATFORM=Linux_PowerPC
265 JAVA_PROC_TYPE=ppc
266 endif
268 ifeq "$(PROCTYPE)" "sparc"
269 UNOPKG_PLATFORM=Linux_SPARC
270 endif
272 ifeq "$(PROCTYPE)" "x86_64"
273 JAVA_PROC_TYPE=amd64
274 endif
276 ifeq "$(PROCTYPE)" "powerpc64"
277 JAVA_PROC_TYPE=ppc64
278 endif
280 ifeq "$(PROCTYPE)" "sparc64"
281 UNOPKG_PLATFORM=Linux_SPARC64
282 JAVA_PROC_TYPE=sparcv9
283 endif
285 OS=LINUX
286 PS=/
287 ICL=\$$
288 CC=gcc
289 LINK=g++
290 LIB=g++
291 ECHO=@echo
292 MKDIR=mkdir -p
293 CAT=cat
294 OBJ_EXT=o
295 SHAREDLIB_EXT=so
296 SHAREDLIB_PRE=lib
297 SHAREDLIB_OUT=$(OUT_LIB)
299 GCC_VERSION=$(shell $(CC) -dumpversion)
301 COMID=gcc3
302 CPPU_ENV=gcc3
304 OSEP=\<
305 CSEP=\>
306 QUOTE=$(subst S,\,S)
307 QM=\"
308 SQM='
309 ECHOLINE=@echo
310 P2BG=&
312 DEL=rm -f
313 DELRECURSIVE=rm -rf
314 COPY=cp
315 URLPREFIX=file://
317 SALLIB=-luno_sal
318 CPPULIB=-luno_cppu
319 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
320 SALHELPERLIB=-luno_salhelper$(COMID)
321 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
323 EMPTYSTRING=
324 PATH_SEPARATOR=:
326 # -O is necessary for inlining (see gcc documentation)
327 ifeq "$(DEBUG)" "yes"
328 OPT_FLAGS=-g
329 else
330 OPT_FLAGS=-O
331 endif
332 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
333 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
335 ifeq "$(PROCTYPE)" "powerpc"
336 CC_FLAGS+=-fPIC
337 endif
339 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux"
340 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
341 CC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV)
342 CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV)
344 CC_OUTPUT_SWITCH=-o
346 LIBO_SDK_LDFLAGS_STDLIBS =
348 LIBRARY_LINK_FLAGS=-shared -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
350 ifeq "$(PROCTYPE)" "powerpc"
351 LIBRARY_LINK_FLAGS+=-fPIC
352 endif
353 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
355 EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--no-whole-archive
356 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
357 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
359 URE_MISC=$(OFFICE_PROGRAM_PATH)
361 endif
363 ###########################################################################
365 # MacOSX/Darwin specific settings
367 ###########################################################################
368 ifeq "$(PLATFORM)" "macosx"
370 UNOPKG_PLATFORM=MacOSX_x86_64
371 JAVABIN=Commands
373 OS=MACOSX
374 PS=/
375 ICL=\$$
376 CC=clang++
377 LINK=clang++
378 LIB=clang++
379 ECHO=@echo
380 MKDIR=mkdir -p
381 CAT=cat
382 OBJ_EXT=o
383 SHAREDLIB_EXT=dylib
384 SHAREDLIB_PRE=lib
385 SHAREDLIB_OUT=$(OUT_LIB)
387 COMID=gcc3
388 CPPU_ENV=gcc3
390 OSEP=\<
391 CSEP=\>
392 QUOTE=$(subst S,\,S)
393 QM=\"
394 SQM='
395 ECHOLINE=@echo
396 P2BG=&
398 DEL=rm -f
399 DELRECURSIVE=rm -rf
400 COPY=cp
401 URLPREFIX=file://
403 SALLIB=-luno_sal
404 CPPULIB=-luno_cppu
405 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
406 SALHELPERLIB=-luno_salhelper$(COMID)
407 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
409 INSTALL_NAME_URELIBS=$(XCRUN) install_name_tool -change @__________________________________________________URELIB/libuno_sal.dylib.3 @executable_path/urelibs/libuno_sal.dylib.3 -change @__________________________________________________URELIB/libuno_cppu.dylib.3 @executable_path/urelibs/libuno_cppu.dylib.3 -change @__________________________________________________URELIB/libuno_cppuhelper$(COMID).dylib.3 @executable_path/urelibs/libuno_cppuhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3 @executable_path/urelibs/libuno_salhelper$(COMID).dylib.3
411 INSTALL_NAME_URELIBS_BIN=$(XCRUN) install_name_tool -change @__________________________________________________URELIB/libuno_sal.dylib.3 libuno_sal.dylib.3 -change @__________________________________________________URELIB/libuno_cppu.dylib.3 libuno_cppu.dylib.3 -change @__________________________________________________URELIB/libuno_cppuhelper$(COMID).dylib.3 libuno_cppuhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3 libuno_salhelper$(COMID).dylib.3
413 EMPTYSTRING=
414 PATH_SEPARATOR=:
416 # -O is necessary for inlining (see gcc documentation)
417 ifeq "$(DEBUG)" "yes"
418 OPT_FLAGS=-g
419 else
420 OPT_FLAGS=-O
421 endif
422 CC_FLAGS_JNI=-c -fPIC -fno-common $(GCC_ARCH_OPTION) $(OPT_FLAGS)
423 CC_FLAGS=-c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden $(OPT_FLAGS)
425 SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
426 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
427 CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
428 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
430 CC_OUTPUT_SWITCH=-o
432 LIBO_SDK_LDFLAGS_STDLIBS =
434 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
436 # install_name '@executable_path$/(@:f)'
437 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
439 EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
440 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
441 LINK_JAVA_LIBS=-framework JavaVM
443 URE_MISC=$(OFFICE_HOME)/Contents/Resources/ure/share/misc
445 endif
447 ###########################################################################
449 # FreeBSD specific settings
451 ###########################################################################
452 ifneq (,$(findstring freebsd,$(PLATFORM)))
453 # Settings for FreeBSD using gcc compiler
455 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
456 PLATFORM=kfreebsd
457 ifeq "$(PROCTYPE)" "x86_64"
458 UNOPKG_PLATFORM=kFreeBSD_x86_64
459 else
460 UNOPKG_PLATFORM=kFreeBSD_x86
461 endif
462 else
463 PLATFORM=freebsd
464 ifeq "$(PROCTYPE)" "x86_64"
465 UNOPKG_PLATFORM=FreeBSD_x86_64
466 else
467 UNOPKG_PLATFORM=FreeBSD_x86
468 endif
469 endif
471 ifeq "$(PROCTYPE)" "x86_64"
472 JAVA_PROC_TYPE=amd64
473 else
474 JAVA_PROC_TYPE=i386
475 endif
477 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
478 OS=LINUX
479 else
480 OS=FREEBSD
481 endif
482 PS=/
483 ICL=\$$
484 CC=gcc
485 LINK=g++
486 LIB=g++
487 ECHO=@echo
488 MKDIR=mkdir -p
489 CAT=cat
490 OBJ_EXT=o
491 SHAREDLIB_EXT=so
492 SHAREDLIB_PRE=lib
493 SHAREDLIB_OUT=$(OUT_LIB)
495 GCC_VERSION=$(shell $(CC) -dumpversion)
497 COMID=gcc3
498 CPPU_ENV=gcc3
500 OSEP=\<
501 CSEP=\>
502 QUOTE=$(subst S,\,S)
503 QM=\"
504 SQM='
505 ECHOLINE=@echo
506 P2BG=&
508 DEL=rm -f
509 DELRECURSIVE=rm -rf
510 COPY=cp
511 URLPREFIX=file://
513 SALLIB=-luno_sal
514 CPPULIB=-luno_cppu
515 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
516 SALHELPERLIB=-luno_salhelper$(COMID)
517 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
519 EMPTYSTRING=
520 PATH_SEPARATOR=:
522 # -O is necessary for inlining (see gcc documentation)
523 ifeq "$(DEBUG)" "yes"
524 OPT_FLAGS=-g
525 else
526 OPT_FLAGS=-O
527 endif
528 CC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) $(OPT_FLAGS)
529 CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden $(OPT_FLAGS)
531 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd"
532 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
533 CC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV)
534 CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV)
536 CC_OUTPUT_SWITCH=-o
538 LIBO_SDK_LDFLAGS_STDLIBS =
540 LIBRARY_LINK_FLAGS=-shared -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
541 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
543 EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined
544 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS)
545 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
547 URE_MISC=$(OFFICE_PROGRAM_PATH)
549 endif