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
26 ifeq "$(MAKECMDGOALS)" "debug"
30 ###########################################################################
34 ###########################################################################
41 ###########################################################################
43 # Windows specific settings
45 ###########################################################################
46 ifeq "$(PLATFORM)" "windows"
47 # Settings for Windows using Microsoft compiler/linker
64 SHAREDLIB_OUT
=$(OUT_BIN
)
65 UNOPKG_PLATFORM
=Windows
81 CPPUHELPERLIB
=icppuhelper.lib
82 SALHELPERLIB
=isalhelper.lib
83 PURPENVHELPERLIB
=ipurpenvhelper.lib
89 ifeq "$(LIBO_SDK_ENABLE_DBGUTIL)" "TRUE"
90 LIBO_SDK_DETAIL_CFLAGS_MSVCRT
= -MDd
91 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
= msvcrtd.lib
93 LIBO_SDK_DETAIL_CFLAGS_MSVCRT
= -MD
94 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
= msvcrt.lib
97 # use this for release version
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"
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"
121 CC_DEFINES_JNI
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=$(CPPU_ENV
)
122 CC_DEFINES
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=$(CPPU_ENV
)
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
134 EXE_LINK_FLAGS
=/MAP
/OPT
:NOREF
/SUBSYSTEM
:CONSOLE
/BASE
:0x1100000
137 LINK_JAVA_LIBS
=/LIBPATH
:"$(OO_SDK_JAVA_HOME)/lib"
139 URE_MISC
=${OFFICE_PROGRAM_PATH}
145 ###########################################################################
147 # Solaris specific settings
149 ###########################################################################
150 ifeq "$(PLATFORM)" "solaris"
151 # Settings for Solaris using GCC
153 ifeq "$(PROCTYPE)" "sparc"
155 UNOPKG_PLATFORM
=Solaris_SPARC
158 ifeq "$(PROCTYPE)" "sparc64"
160 UNOPKG_PLATFORM
=Solaris_SPARC64
161 JAVA_PROC_TYPE
=sparcv9
164 UNOPKG_PLATFORM
=Solaris_x86
181 SHAREDLIB_OUT
=$(OUT_LIB
)
202 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
203 SALHELPERLIB=-luno_salhelper$(COMID)
204 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
209 # -O is necessary for inlining (see gcc documentation)
210 ifeq "$(DEBUG)" "yes"
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
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"
237 LIBRARY_LINK_FLAGS+=-m64
241 URE_MISC=$(OFFICE_PROGRAM_PATH)
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"
262 ifeq "$(PROCTYPE)" "powerpc"
263 UNOPKG_PLATFORM=Linux_PowerPC
267 ifeq "$(PROCTYPE)" "sparc"
268 UNOPKG_PLATFORM=Linux_SPARC
271 ifeq "$(PROCTYPE)" "x86_64"
275 ifeq "$(PROCTYPE)" "powerpc64"
279 ifeq "$(PROCTYPE)" "powerpc64_le"
280 JAVA_PROC_TYPE=ppc64le
283 ifeq "$(PROCTYPE)" "arm_eabi"
287 ifeq "$(PROCTYPE)" "arm_oabi"
291 ifeq "$(PROCTYPE)" "mips_eb"
295 ifeq "$(PROCTYPE)" "mips_el"
296 JAVA_PROC_TYPE=mipsel
299 ifeq "$(PROCTYPE)" "mips64_el"
300 JAVA_PROC_TYPE=mips64el
303 ifeq "$(PROCTYPE)" "sparc64"
304 UNOPKG_PLATFORM=Linux_SPARC64
305 JAVA_PROC_TYPE=sparcv9
320 SHAREDLIB_OUT=$(OUT_LIB)
322 GCC_VERSION:=$(shell $(CC) -dumpversion)
343 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
344 SALHELPERLIB
=-luno_salhelper
$(COMID
)
345 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
350 # -O is necessary for inlining (see gcc documentation)
351 ifeq "$(DEBUG)" "yes"
356 CC_FLAGS_JNI
=-c
-fpic
$(OPT_FLAGS
)
357 CC_FLAGS
=-c
-fpic
-fvisibility
=hidden
$(OPT_FLAGS
)
359 ifeq "$(PROCTYPE)" "powerpc"
363 ifeq "$(PROCTYPE)" "x86"
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
)
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
382 ifeq "$(PROCTYPE)" "x86"
383 LIBRARY_LINK_FLAGS
+=-m32
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"
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
)
401 ###########################################################################
403 # MacOSX/Darwin specific settings
405 ###########################################################################
406 ifeq "$(PLATFORM)" "macosx"
408 UNOPKG_PLATFORM
=MacOSX_x86_64
422 SHAREDLIB_OUT
=$(OUT_LIB
)
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
454 # -O is necessary for inlining (see gcc documentation)
455 ifeq "$(DEBUG)" "yes"
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)
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
485 ###########################################################################
487 # FreeBSD specific settings
489 ###########################################################################
490 ifneq (,$(findstring freebsd,$(PLATFORM)))
491 # Settings for FreeBSD using gcc compiler
493 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
495 ifeq "$(PROCTYPE)" "x86_64"
496 UNOPKG_PLATFORM=kFreeBSD_x86_64
498 UNOPKG_PLATFORM=kFreeBSD_x86
502 ifeq "$(PROCTYPE)" "x86_64"
503 UNOPKG_PLATFORM=FreeBSD_x86_64
505 UNOPKG_PLATFORM=FreeBSD_x86
509 ifeq "$(PROCTYPE)" "x86_64"
515 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
531 SHAREDLIB_OUT=$(OUT_LIB)
533 GCC_VERSION:=$(shell $(CC) -dumpversion)
554 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
555 SALHELPERLIB
=-luno_salhelper
$(COMID
)
556 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
561 # -O is necessary for inlining (see gcc documentation)
562 ifeq "$(DEBUG)" "yes"
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
)
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
)