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 ifeq "$(PROCTYPE)" "x86_64"
122 CC_DEFINES_JNI
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=$(CPPU_ENV
)
123 CC_DEFINES
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=$(CPPU_ENV
)
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
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
147 ###########################################################################
149 # Solaris specific settings
151 ###########################################################################
152 ifeq "$(PLATFORM)" "solaris"
153 # Settings for Solaris using GCC
155 ifeq "$(PROCTYPE)" "sparc"
157 UNOPKG_PLATFORM
=Solaris_SPARC
160 ifeq "$(PROCTYPE)" "sparc64"
162 UNOPKG_PLATFORM
=Solaris_SPARC64
163 JAVA_PROC_TYPE
=sparcv9
166 UNOPKG_PLATFORM
=Solaris_x86
183 SHAREDLIB_OUT
=$(OUT_LIB
)
203 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
204 SALHELPERLIB=-luno_salhelper$(COMID)
205 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
210 # -O is necessary for inlining (see gcc documentation)
211 ifeq "$(DEBUG)" "yes"
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
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"
238 LIBRARY_LINK_FLAGS+=-m64
242 URE_MISC=$(OFFICE_PROGRAM_PATH)
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"
263 ifeq "$(PROCTYPE)" "powerpc"
264 UNOPKG_PLATFORM=Linux_PowerPC
268 ifeq "$(PROCTYPE)" "sparc"
269 UNOPKG_PLATFORM=Linux_SPARC
272 ifeq "$(PROCTYPE)" "x86_64"
276 ifeq "$(PROCTYPE)" "powerpc64"
280 ifeq "$(PROCTYPE)" "sparc64"
281 UNOPKG_PLATFORM=Linux_SPARC64
282 JAVA_PROC_TYPE=sparcv9
297 SHAREDLIB_OUT=$(OUT_LIB)
299 GCC_VERSION=$(shell $(CC) -dumpversion)
319 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
320 SALHELPERLIB
=-luno_salhelper
$(COMID
)
321 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
326 # -O is necessary for inlining (see gcc documentation)
327 ifeq "$(DEBUG)" "yes"
332 CC_FLAGS_JNI
=-c
-fpic
$(OPT_FLAGS
)
333 CC_FLAGS
=-c
-fpic
-fvisibility
=hidden
$(OPT_FLAGS
)
335 ifeq "$(PROCTYPE)" "powerpc"
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
)
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
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
)
363 ###########################################################################
365 # MacOSX/Darwin specific settings
367 ###########################################################################
368 ifeq "$(PLATFORM)" "macosx"
370 UNOPKG_PLATFORM
=MacOSX_x86_64
385 SHAREDLIB_OUT
=$(OUT_LIB
)
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
416 # -O is necessary for inlining (see gcc documentation)
417 ifeq "$(DEBUG)" "yes"
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)
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
447 ###########################################################################
449 # FreeBSD specific settings
451 ###########################################################################
452 ifneq (,$(findstring freebsd,$(PLATFORM)))
453 # Settings for FreeBSD using gcc compiler
455 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
457 ifeq "$(PROCTYPE)" "x86_64"
458 UNOPKG_PLATFORM=kFreeBSD_x86_64
460 UNOPKG_PLATFORM=kFreeBSD_x86
464 ifeq "$(PROCTYPE)" "x86_64"
465 UNOPKG_PLATFORM=FreeBSD_x86_64
467 UNOPKG_PLATFORM=FreeBSD_x86
471 ifeq "$(PROCTYPE)" "x86_64"
477 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
493 SHAREDLIB_OUT=$(OUT_LIB)
495 GCC_VERSION=$(shell $(CC) -dumpversion)
515 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
516 SALHELPERLIB
=-luno_salhelper
$(COMID
)
517 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
522 # -O is necessary for inlining (see gcc documentation)
523 ifeq "$(DEBUG)" "yes"
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
)
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
)