Update git submodules
[LibreOffice.git] / odk / settings / settings.mk
bloba479dd702fae0324d342edfd9a33678a764e9f07
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 ###########################################################################
43 # Windows specific settings
45 ###########################################################################
46 ifeq "$(PLATFORM)" "windows"
47 # Settings for Windows using Microsoft compiler/linker
49 OS=WIN
50 PS:=$(strip \ )
51 ICL=$$
52 CC=cl
53 LINK=link
54 BUILDLIB=lib
55 ECHO=@echo
56 MKDIR=mkdir
57 MV=move
58 CAT=type
59 OBJ_EXT=obj
60 EXE_EXT=.exe
61 COPY=copy
62 CD=cd /d
63 SHAREDLIB_EXT=dll
64 SHAREDLIB_OUT=$(OUT_BIN)
65 UNOPKG_PLATFORM=Windows
67 OSEP=^<
68 CSEP=^>
69 QUOTE=
70 QM=
71 SQM=
72 ECHOLINE=@echo.
73 P2BG=
75 DEL=del
76 DELRECURSIVE=rd /S /Q
77 URLPREFIX=file:///
79 SALLIB=isal.lib
80 CPPULIB=icppu.lib
81 CPPUHELPERLIB=icppuhelper.lib
82 SALHELPERLIB=isalhelper.lib
83 PURPENVHELPERLIB=ipurpenvhelper.lib
85 BLANK=
86 EMPTYSTRING=
87 PATH_SEPARATOR=;
89 ifeq "$(LIBO_SDK_ENABLE_DBGUTIL)" "TRUE"
90 LIBO_SDK_DETAIL_CFLAGS_MSVCRT = -MDd
91 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT = msvcrtd.lib
92 else
93 LIBO_SDK_DETAIL_CFLAGS_MSVCRT = -MD
94 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT = msvcrt.lib
95 endif
97 # use this for release version
98 ifeq "$(DEBUG)" "yes"
99 OPT_FLAGS=-Zi
100 endif
101 CC_FLAGS_JNI=-c $(LIBO_SDK_DETAIL_CFLAGS_MSVCRT) -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa $(OPT_FLAGS)
102 CC_FLAGS=-c $(LIBO_SDK_DETAIL_CFLAGS_MSVCRT) -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa $(OPT_FLAGS)
103 ifeq "$(CPP_MANIFEST)" "true"
104 LINK_MANIFEST=mt -manifest $@.manifest "-outputresource:$@;2"
105 else
106 LINK_MANIFEST=
107 endif
109 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
110 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/win32"
112 # define for used compiler necessary for UNO
113 # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
115 ifeq "$(PROCTYPE)" "x86_64"
116 CPPU_ENV=mscx
117 else
118 CPPU_ENV=msci
119 endif
121 CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=$(CPPU_ENV)
122 CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=$(CPPU_ENV)
123 CC_OUTPUT_SWITCH=-Fo
125 LIBO_SDK_LDFLAGS_STDLIBS = $(LIBO_SDK_DETAIL_LDFLAGS_MSVCRT) kernel32.lib
127 LIBRARY_LINK_FLAGS=/DLL
128 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) /DEF:$(OO_SDK_HOME)/settings/component.uno.def
129 EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1b000000 /DEBUGTYPE:cv $(LIBO_SDK_LDFLAGS_STDLIBS)
130 ifeq "$(DEBUG)" "yes"
131 LIBRARY_LINK_FLAGS+=/DEBUGTYPE:cv /DEBUG
132 EXE_LINK_FLAGS+=/DEBUG
133 else
134 EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
135 endif
137 LINK_JAVA_LIBS=/LIBPATH:"$(OO_SDK_JAVA_HOME)/lib"
139 URE_MISC=${OFFICE_PROGRAM_PATH}
141 endif
145 ###########################################################################
147 # Solaris specific settings
149 ###########################################################################
150 ifeq "$(PLATFORM)" "solaris"
151 # Settings for Solaris using GCC
153 ifeq "$(PROCTYPE)" "sparc"
154 PLATFORM=solsparc
155 UNOPKG_PLATFORM=Solaris_SPARC
156 JAVA_PROC_TYPE=sparc
157 else
158 ifeq "$(PROCTYPE)" "sparc64"
159 PLATFORM=solsparc
160 UNOPKG_PLATFORM=Solaris_SPARC64
161 JAVA_PROC_TYPE=sparcv9
162 else
163 PLATFORM=solintel
164 UNOPKG_PLATFORM=Solaris_x86
165 JAVA_PROC_TYPE=i386
166 endif
167 endif
169 OS=SOLARIS
170 PS=/
171 ICL=\$$
172 CC=g++
173 LINK=g++
174 LIB=g++
175 ECHO=@echo
176 MKDIR=mkdir -p
177 CAT=cat
178 OBJ_EXT=o
179 SHAREDLIB_EXT=so
180 SHAREDLIB_PRE=lib
181 SHAREDLIB_OUT=$(OUT_LIB)
183 OSEP=\<
184 CSEP=\>
185 QUOTE=$(subst S,\,S)
186 QM=\"
187 SQM='
188 ECHOLINE=@echo
189 P2BG=&
191 DEL=rm -f
192 DELRECURSIVE=rm -rf
193 COPY=cp
194 CD=cd
195 URLPREFIX=file://
197 COMID=gcc3
198 CPPU_ENV=gcc3
200 SALLIB=-luno_sal
201 CPPULIB=-luno_cppu
202 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
203 SALHELPERLIB=-luno_salhelper$(COMID)
204 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
206 EMPTYSTRING=
207 PATH_SEPARATOR=:
209 # -O is necessary for inlining (see gcc documentation)
210 ifeq "$(DEBUG)" "yes"
211 OPT_FLAGS=-g
212 else
213 OPT_FLAGS=-O
214 endif
215 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
216 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
217 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
218 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
220 # define for used compiler necessary for UNO
222 CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=$(CPPU_ENV) -DGCC
223 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=$(CPPU_ENV) -DGCC
224 CC_OUTPUT_SWITCH=-o
226 LIBO_SDK_LDFLAGS_STDLIBS =
228 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -fPIC -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
229 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
231 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
232 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
233 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
235 ifeq "$(PROCTYPE)" "sparc64"
236 CC_FLAGS+=-m64
237 LIBRARY_LINK_FLAGS+=-m64
238 EXE_LINK_FLAGS+=-m64
239 endif
241 URE_MISC=$(OFFICE_PROGRAM_PATH)
243 endif
247 ###########################################################################
249 # Linux specific settings
251 ###########################################################################
252 ifeq "$(PLATFORM)" "linux"
253 # Settings for Linux using gcc compiler
255 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
256 JAVA_PROC_TYPE=$(PROCTYPE)
258 ifeq "$(PROCTYPE)" "x86"
259 JAVA_PROC_TYPE=i386
260 endif
262 ifeq "$(PROCTYPE)" "powerpc"
263 UNOPKG_PLATFORM=Linux_PowerPC
264 JAVA_PROC_TYPE=ppc
265 endif
267 ifeq "$(PROCTYPE)" "sparc"
268 UNOPKG_PLATFORM=Linux_SPARC
269 endif
271 ifeq "$(PROCTYPE)" "x86_64"
272 JAVA_PROC_TYPE=amd64
273 endif
275 ifeq "$(PROCTYPE)" "powerpc64"
276 JAVA_PROC_TYPE=ppc64
277 endif
279 ifeq "$(PROCTYPE)" "powerpc64_le"
280 JAVA_PROC_TYPE=ppc64le
281 endif
283 ifeq "$(PROCTYPE)" "arm_eabi"
284 JAVA_PROC_TYPE=arm
285 endif
287 ifeq "$(PROCTYPE)" "arm_oabi"
288 JAVA_PROC_TYPE=arm
289 endif
291 ifeq "$(PROCTYPE)" "mips_eb"
292 JAVA_PROC_TYPE=mips
293 endif
295 ifeq "$(PROCTYPE)" "mips_el"
296 JAVA_PROC_TYPE=mipsel
297 endif
299 ifeq "$(PROCTYPE)" "mips64_el"
300 JAVA_PROC_TYPE=mips64el
301 endif
303 ifeq "$(PROCTYPE)" "sparc64"
304 UNOPKG_PLATFORM=Linux_SPARC64
305 JAVA_PROC_TYPE=sparcv9
306 endif
308 OS=LINUX
309 PS=/
310 ICL=\$$
311 CC=gcc
312 LINK=g++
313 LIB=g++
314 ECHO=@echo
315 MKDIR=mkdir -p
316 CAT=cat
317 OBJ_EXT=o
318 SHAREDLIB_EXT=so
319 SHAREDLIB_PRE=lib
320 SHAREDLIB_OUT=$(OUT_LIB)
322 GCC_VERSION:=$(shell $(CC) -dumpversion)
324 COMID=gcc3
325 CPPU_ENV=gcc3
327 OSEP=\<
328 CSEP=\>
329 QUOTE=$(subst S,\,S)
330 QM=\"
331 SQM='
332 ECHOLINE=@echo
333 P2BG=&
335 DEL=rm -f
336 DELRECURSIVE=rm -rf
337 COPY=cp
338 CD=cd
339 URLPREFIX=file://
341 SALLIB=-luno_sal
342 CPPULIB=-luno_cppu
343 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
344 SALHELPERLIB=-luno_salhelper$(COMID)
345 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
347 EMPTYSTRING=
348 PATH_SEPARATOR=:
350 # -O is necessary for inlining (see gcc documentation)
351 ifeq "$(DEBUG)" "yes"
352 OPT_FLAGS=-g
353 else
354 OPT_FLAGS=-O
355 endif
356 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
357 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
359 ifeq "$(PROCTYPE)" "powerpc"
360 CC_FLAGS+=-fPIC
361 endif
363 ifeq "$(PROCTYPE)" "x86"
364 CC_FLAGS+=-m32
365 endif
367 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux"
368 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
369 CC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV)
370 CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV)
372 CC_OUTPUT_SWITCH=-o
374 LIBO_SDK_LDFLAGS_STDLIBS =
376 LIBRARY_LINK_FLAGS=-shared -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
378 ifeq "$(PROCTYPE)" "powerpc"
379 LIBRARY_LINK_FLAGS+=-fPIC
380 endif
382 ifeq "$(PROCTYPE)" "x86"
383 LIBRARY_LINK_FLAGS+=-m32
384 endif
386 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
388 EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--no-whole-archive
390 ifeq "$(PROCTYPE)" "x86"
391 EXE_LINK_FLAGS+=-m32
392 endif
394 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
395 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)" -L"$(OO_SDK_JAVA_HOME)/lib"
397 URE_MISC=$(OFFICE_PROGRAM_PATH)
399 endif
401 ###########################################################################
403 # MacOSX/Darwin specific settings
405 ###########################################################################
406 ifeq "$(PLATFORM)" "macosx"
408 UNOPKG_PLATFORM=MacOSX_x86_64
410 OS=MACOSX
411 PS=/
412 ICL=\$$
413 CC=clang++
414 LINK=clang++
415 LIB=clang++
416 ECHO=@echo
417 MKDIR=mkdir -p
418 CAT=cat
419 OBJ_EXT=o
420 SHAREDLIB_EXT=dylib
421 SHAREDLIB_PRE=lib
422 SHAREDLIB_OUT=$(OUT_LIB)
424 COMID=gcc3
425 CPPU_ENV=gcc3
427 OSEP=\<
428 CSEP=\>
429 QUOTE=$(subst S,\,S)
430 QM=\"
431 SQM='
432 ECHOLINE=@echo
433 P2BG=&
435 DEL=rm -f
436 DELRECURSIVE=rm -rf
437 COPY=cp
438 CD=cd
439 URLPREFIX=file://
441 SALLIB=-luno_sal
442 CPPULIB=-luno_cppu
443 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
444 SALHELPERLIB=-luno_salhelper$(COMID)
445 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
447 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
449 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
451 EMPTYSTRING=
452 PATH_SEPARATOR=:
454 # -O is necessary for inlining (see gcc documentation)
455 ifeq "$(DEBUG)" "yes"
456 OPT_FLAGS=-g
457 else
458 OPT_FLAGS=-O
459 endif
460 CC_FLAGS_JNI=-c -fPIC -fno-common $(GCC_ARCH_OPTION) $(OPT_FLAGS)
461 CC_FLAGS=-c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden $(OPT_FLAGS)
463 SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
464 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
465 CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
466 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
468 CC_OUTPUT_SWITCH=-o
470 LIBO_SDK_LDFLAGS_STDLIBS =
472 LIBRARY_LINK_FLAGS=-dynamiclib -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
474 # install_name '@executable_path$/(@:f)'
475 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
477 EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
478 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
479 LINK_JAVA_LIBS=-framework JavaVM
481 URE_MISC=$(OFFICE_HOME)/Contents/Resources/ure/share/misc
483 endif
485 ###########################################################################
487 # FreeBSD specific settings
489 ###########################################################################
490 ifneq (,$(findstring freebsd,$(PLATFORM)))
491 # Settings for FreeBSD using gcc compiler
493 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
494 PLATFORM=kfreebsd
495 ifeq "$(PROCTYPE)" "x86_64"
496 UNOPKG_PLATFORM=kFreeBSD_x86_64
497 else
498 UNOPKG_PLATFORM=kFreeBSD_x86
499 endif
500 else
501 PLATFORM=freebsd
502 ifeq "$(PROCTYPE)" "x86_64"
503 UNOPKG_PLATFORM=FreeBSD_x86_64
504 else
505 UNOPKG_PLATFORM=FreeBSD_x86
506 endif
507 endif
509 ifeq "$(PROCTYPE)" "x86_64"
510 JAVA_PROC_TYPE=amd64
511 else
512 JAVA_PROC_TYPE=i386
513 endif
515 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
516 OS=LINUX
517 else
518 OS=FREEBSD
519 endif
520 PS=/
521 ICL=\$$
522 CC=gcc
523 LINK=g++
524 LIB=g++
525 ECHO=@echo
526 MKDIR=mkdir -p
527 CAT=cat
528 OBJ_EXT=o
529 SHAREDLIB_EXT=so
530 SHAREDLIB_PRE=lib
531 SHAREDLIB_OUT=$(OUT_LIB)
533 GCC_VERSION:=$(shell $(CC) -dumpversion)
535 COMID=gcc3
536 CPPU_ENV=gcc3
538 OSEP=\<
539 CSEP=\>
540 QUOTE=$(subst S,\,S)
541 QM=\"
542 SQM='
543 ECHOLINE=@echo
544 P2BG=&
546 DEL=rm -f
547 DELRECURSIVE=rm -rf
548 COPY=cp
549 CD=cd
550 URLPREFIX=file://
552 SALLIB=-luno_sal
553 CPPULIB=-luno_cppu
554 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
555 SALHELPERLIB=-luno_salhelper$(COMID)
556 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
558 EMPTYSTRING=
559 PATH_SEPARATOR=:
561 # -O is necessary for inlining (see gcc documentation)
562 ifeq "$(DEBUG)" "yes"
563 OPT_FLAGS=-g
564 else
565 OPT_FLAGS=-O
566 endif
567 CC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) $(OPT_FLAGS)
568 CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden $(OPT_FLAGS)
570 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd"
571 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
572 CC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV)
573 CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV)
575 CC_OUTPUT_SWITCH=-o
577 LIBO_SDK_LDFLAGS_STDLIBS =
579 LIBRARY_LINK_FLAGS=-shared -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
580 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
582 EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined
583 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS)
584 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
586 URE_MISC=$(OFFICE_PROGRAM_PATH)
588 endif