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 ###########################################################################
43 ###########################################################################
45 # Windows specific settings
47 ###########################################################################
48 ifeq "$(PLATFORM)" "windows"
49 # Settings for Windows using Microsoft compiler/linker
65 SHAREDLIB_OUT
=$(OUT_BIN
)
66 UNOPKG_PLATFORM
=Windows
82 CPPUHELPERLIB
=icppuhelper.lib
83 SALHELPERLIB
=isalhelper.lib
84 PURPENVHELPERLIB
=ipurpenvhelper.lib
90 ifeq "$(LIBO_SDK_ENABLE_DBGUTIL)" "TRUE"
91 LIBO_SDK_DETAIL_CFLAGS_MSVCRT
= -MDd
92 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
= msvcrtd.lib
94 LIBO_SDK_DETAIL_CFLAGS_MSVCRT
= -MD
95 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
= msvcrt.lib
98 # use this for release version
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"
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 CC_DEFINES_JNI
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=msci
117 CC_DEFINES
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=msci
120 LIBO_SDK_LDFLAGS_STDLIBS
= $(LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
) kernel32.lib
122 LIBRARY_LINK_FLAGS
=/DLL
/DEBUGTYPE
:cv
123 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
) /DEF
:$(PRJ
)/settings
/component.uno.def
124 EXE_LINK_FLAGS
=/MAP
/OPT
:NOREF
/SUBSYSTEM
:CONSOLE
/BASE
:0x1b000000 /DEBUGTYPE
:cv
$(LIBO_SDK_LDFLAGS_STDLIBS
)
125 ifeq "$(DEBUG)" "yes"
126 LIBRARY_LINK_FLAGS
+=/DEBUG
127 EXE_LINK_FLAGS
+=/DEBUG
130 LINK_JAVA_LIBS
=/LIBPATH
:"$(OO_SDK_JAVA_HOME)/lib"
132 ifneq "$(OO_SDK_URE_HOME)" ""
133 URE_MISC
=$(OO_SDK_URE_HOME
)\misc
136 # use this for release version
137 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
138 #LIBRARY_LINK_FLAGS=/DLL
143 ###########################################################################
145 # Solaris specific settings
147 ###########################################################################
148 ifeq "$(PLATFORM)" "solaris"
149 # Settings for Solaris using GCC
151 ifeq "$(PROCTYPE)" "sparc"
153 UNOPKG_PLATFORM
=Solaris_SPARC
156 ifeq "$(PROCTYPE)" "sparc64"
158 UNOPKG_PLATFORM
=Solaris_SPARC64
159 JAVA_PROC_TYPE
=sparcv9
162 UNOPKG_PLATFORM
=Solaris_x86
179 SHAREDLIB_OUT
=$(OUT_LIB
)
199 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
200 SALHELPERLIB=-luno_salhelper$(COMID)
201 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
206 # -O is necessary for inlining (see gcc documentation)
207 ifeq "$(DEBUG)" "yes"
212 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
213 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
214 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
215 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
217 # define for used compiler necessary for UNO
219 CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=$(CPPU_ENV) -DGCC
220 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE -DGCC
223 LIBO_SDK_LDFLAGS_STDLIBS =
225 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -fPIC -PIC -temp=/tmp '-R
$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
226 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
228 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
229 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
230 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
232 ifeq "$(PROCTYPE)" "sparc64"
234 LIBRARY_LINK_FLAGS+=-m64
238 ifneq "$(OO_SDK_URE_HOME)" ""
239 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
246 ###########################################################################
248 # Linux specific settings
250 ###########################################################################
251 ifeq "$(PLATFORM)" "linux"
252 # Settings for Linux using gcc compiler
254 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
255 JAVA_PROC_TYPE=$(PROCTYPE)
257 ifeq "$(PROCTYPE)" "x86"
261 ifeq "$(PROCTYPE)" "powerpc"
262 UNOPKG_PLATFORM=Linux_PowerPC
266 ifeq "$(PROCTYPE)" "sparc"
267 UNOPKG_PLATFORM=Linux_SPARC
270 ifeq "$(PROCTYPE)" "x86_64"
274 ifeq "$(PROCTYPE)" "powerpc64"
290 SHAREDLIB_OUT=$(OUT_LIB)
292 GCC_VERSION=$(shell $(CC) -dumpversion)
312 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
313 SALHELPERLIB
=-luno_salhelper
$(COMID
)
314 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
319 # -O is necessary for inlining (see gcc documentation)
320 ifeq "$(DEBUG)" "yes"
325 CC_FLAGS_JNI
=-c
-fpic
$(OPT_FLAGS
)
326 CC_FLAGS
=-c
-fpic
-fvisibility
=hidden
$(OPT_FLAGS
)
328 ifeq "$(PROCTYPE)" "powerpc"
332 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/linux"
333 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
334 CC_DEFINES_JNI
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
)
335 CC_DEFINES
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
) -DHAVE_GCC_VISIBILITY_FEATURE
339 LIBO_SDK_LDFLAGS_STDLIBS
=
341 LIBRARY_LINK_FLAGS
=-shared
-Wl
,-z
,origin '-Wl,-rpath,$$ORIGIN'
343 ifeq "$(PROCTYPE)" "powerpc"
344 LIBRARY_LINK_FLAGS
+=-fPIC
346 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
348 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
-Wl
,-export-dynamic
-Wl
,-z
,defs
-Wl
,--no-whole-archive
349 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)"
350 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
352 ifneq "$(OO_SDK_URE_HOME)" ""
353 URE_MISC
=$(OO_SDK_URE_HOME
)/share
/misc
358 ###########################################################################
360 # MacOSX/Darwin specific settings
362 ###########################################################################
363 ifeq "$(PLATFORM)" "macosx"
364 # Settings for MacOSX using gcc 4.0.1 compiler
366 ifeq "$(PROCTYPE)" "x86"
367 UNOPKG_PLATFORM
=MacOSX_x86
369 ifeq "$(PROCTYPE)" "x86_64"
370 UNOPKG_PLATFORM
=MacOSX_x86_64
375 ifeq "$(PROCTYPE)" "x86"
376 GCC_VERSION
=$(shell gcc
-dumpversion| cut
-d
"." -f1
,2)
377 ifeq "$(GCC_VERSION)" "4.2"
378 GCC_ARCH_OPTION
=-arch i386
385 ifeq "$(PROCTYPE)" "x86"
386 CC
=gcc-
$(GCC_VERSION
)
387 LINK
=g
++-$(GCC_VERSION
)
388 LIB
=g
++-$(GCC_VERSION
)
400 SHAREDLIB_OUT
=$(OUT_LIB
)
420 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
421 SALHELPERLIB=-luno_salhelper$(COMID)
422 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
424 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
426 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
431 # -O is necessary for inlining (see gcc documentation)
432 ifeq "$(DEBUG)" "yes"
437 CC_FLAGS_JNI=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) $(OPT_FLAGS)
438 CC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden $(OPT_FLAGS)
440 SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
441 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
442 CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
443 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
447 LIBO_SDK_LDFLAGS_STDLIBS =
449 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
451 # install_name '@executable_path
$/(@
:f
)'
452 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
454 EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
455 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
456 LINK_JAVA_LIBS=-framework JavaVM
458 ifneq "$(OO_SDK_URE_HOME)" ""
459 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
464 ###########################################################################
466 # FreeBSD specific settings
468 ###########################################################################
469 ifneq (,$(findstring freebsd,$(PLATFORM)))
470 # Settings for FreeBSD using gcc compiler
472 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
474 ifeq "$(PROCTYPE)" "x86_64"
475 UNOPKG_PLATFORM=kFreeBSD_x86_64
477 UNOPKG_PLATFORM=kFreeBSD_x86
481 ifeq "$(PROCTYPE)" "x86_64"
482 UNOPKG_PLATFORM=FreeBSD_x86_64
484 UNOPKG_PLATFORM=FreeBSD_x86
488 ifeq "$(PROCTYPE)" "x86_64"
494 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
510 SHAREDLIB_OUT=$(OUT_LIB)
512 GCC_VERSION=$(shell $(CC) -dumpversion)
532 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
533 SALHELPERLIB
=-luno_salhelper
$(COMID
)
534 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
539 # -O is necessary for inlining (see gcc documentation)
540 ifeq "$(DEBUG)" "yes"
545 CC_FLAGS_JNI
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) $(OPT_FLAGS
)
546 CC_FLAGS
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) -fvisibility
=hidden
$(OPT_FLAGS
)
548 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/freebsd"
549 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
550 CC_DEFINES_JNI
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
)
551 CC_DEFINES
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
) -DHAVE_GCC_VISIBILITY_FEATURE
555 LIBO_SDK_LDFLAGS_STDLIBS
=
557 LIBRARY_LINK_FLAGS
=-shared
-Wl
,-z
,origin '-Wl,-rpath,$$ORIGIN'
558 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
560 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
561 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS
)
562 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
564 ifneq "$(OO_SDK_URE_HOME)" ""
565 URE_MISC
=$(OO_SDK_URE_HOME
)/share
/misc