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
63 SHAREDLIB_OUT
=$(OUT_BIN
)
64 UNOPKG_PLATFORM
=Windows
80 CPPUHELPERLIB
=icppuhelper.lib
81 SALHELPERLIB
=isalhelper.lib
82 PURPENVHELPERLIB
=ipurpenvhelper.lib
88 ifeq "$(LIBO_SDK_ENABLE_DBGUTIL)" "TRUE"
89 LIBO_SDK_DETAIL_CFLAGS_MSVCRT
= -MDd
90 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
= msvcrtd.lib
92 LIBO_SDK_DETAIL_CFLAGS_MSVCRT
= -MD
93 LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
= msvcrt.lib
96 # use this for release version
100 CC_FLAGS_JNI
=-c
$(LIBO_SDK_DETAIL_CFLAGS_MSVCRT
) -Zm500
-Zc
:wchar_t-
-wd4251
-wd4275
-wd4290
-wd4675
-wd4786
-wd4800
-GR
-EHa
$(OPT_FLAGS
)
101 CC_FLAGS
=-c
$(LIBO_SDK_DETAIL_CFLAGS_MSVCRT
) -Zm500
-Zc
:wchar_t-
-wd4251
-wd4275
-wd4290
-wd4675
-wd4786
-wd4800
-GR
-EHa
$(OPT_FLAGS
)
102 ifeq "$(CPP_MANIFEST)" "true"
103 LINK_MANIFEST
=mt
-manifest
$@.manifest
"-outputresource:$@;2"
108 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
109 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/win32"
111 # define for used compiler necessary for UNO
112 # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
114 ifeq "$(PROCTYPE)" "x86_64"
120 CC_DEFINES_JNI
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=$(CPPU_ENV
)
121 CC_DEFINES
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=$(CPPU_ENV
)
124 LIBO_SDK_LDFLAGS_STDLIBS
= $(LIBO_SDK_DETAIL_LDFLAGS_MSVCRT
) kernel32.lib
126 LIBRARY_LINK_FLAGS
=/DLL
/DEBUGTYPE
:cv
127 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
) /DEF
:$(PRJ
)/settings
/component.uno.def
128 EXE_LINK_FLAGS
=/MAP
/OPT
:NOREF
/SUBSYSTEM
:CONSOLE
/BASE
:0x1b000000 /DEBUGTYPE
:cv
$(LIBO_SDK_LDFLAGS_STDLIBS
)
129 ifeq "$(DEBUG)" "yes"
130 LIBRARY_LINK_FLAGS
+=/DEBUG
131 EXE_LINK_FLAGS
+=/DEBUG
134 LINK_JAVA_LIBS
=/LIBPATH
:"$(OO_SDK_JAVA_HOME)/lib"
136 URE_MISC
=${OFFICE_PROGRAM_PATH}
138 # use this for release version
139 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
140 #LIBRARY_LINK_FLAGS=/DLL
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
)
201 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
202 SALHELPERLIB=-luno_salhelper$(COMID)
203 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
208 # -O is necessary for inlining (see gcc documentation)
209 ifeq "$(DEBUG)" "yes"
214 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
215 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
216 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
217 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
219 # define for used compiler necessary for UNO
221 CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=$(CPPU_ENV) -DGCC
222 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=$(CPPU_ENV) -DGCC
225 LIBO_SDK_LDFLAGS_STDLIBS =
227 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -fPIC -PIC -temp=/tmp '-R
$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
228 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
230 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
231 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
232 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
234 ifeq "$(PROCTYPE)" "sparc64"
236 LIBRARY_LINK_FLAGS+=-m64
240 URE_MISC=$(OFFICE_PROGRAM_PATH)
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"
278 ifeq "$(PROCTYPE)" "powerpc64_le"
279 JAVA_PROC_TYPE=ppc64le
282 ifeq "$(PROCTYPE)" "arm_eabi"
286 ifeq "$(PROCTYPE)" "arm_oabi"
290 ifeq "$(PROCTYPE)" "mips_eb"
294 ifeq "$(PROCTYPE)" "mips_el"
295 JAVA_PROC_TYPE=mipsel
298 ifeq "$(PROCTYPE)" "mips64_el"
299 JAVA_PROC_TYPE=mips64el
302 ifeq "$(PROCTYPE)" "sparc64"
303 UNOPKG_PLATFORM=Linux_SPARC64
304 JAVA_PROC_TYPE=sparcv9
319 SHAREDLIB_OUT=$(OUT_LIB)
321 GCC_VERSION=$(shell $(CC) -dumpversion)
341 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
342 SALHELPERLIB
=-luno_salhelper
$(COMID
)
343 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
348 # -O is necessary for inlining (see gcc documentation)
349 ifeq "$(DEBUG)" "yes"
354 CC_FLAGS_JNI
=-c
-fpic
$(OPT_FLAGS
)
355 CC_FLAGS
=-c
-fpic
-fvisibility
=hidden
$(OPT_FLAGS
)
357 ifeq "$(PROCTYPE)" "powerpc"
361 ifeq "$(PROCTYPE)" "x86"
365 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/linux"
366 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
367 CC_DEFINES_JNI
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
)
368 CC_DEFINES
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
)
372 LIBO_SDK_LDFLAGS_STDLIBS
=
374 LIBRARY_LINK_FLAGS
=-shared
-Wl
,-z
,origin '-Wl,-rpath,$$ORIGIN'
376 ifeq "$(PROCTYPE)" "powerpc"
377 LIBRARY_LINK_FLAGS
+=-fPIC
380 ifeq "$(PROCTYPE)" "x86"
381 LIBRARY_LINK_FLAGS
+=-m32
384 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
386 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
-Wl
,-export-dynamic
-Wl
,-z
,defs
-Wl
,--no-whole-archive
388 ifeq "$(PROCTYPE)" "x86"
392 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)"
393 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)" -L
"$(OO_SDK_JAVA_HOME)/lib"
395 URE_MISC
=$(OFFICE_PROGRAM_PATH
)
399 ###########################################################################
401 # MacOSX/Darwin specific settings
403 ###########################################################################
404 ifeq "$(PLATFORM)" "macosx"
406 UNOPKG_PLATFORM
=MacOSX_x86_64
420 SHAREDLIB_OUT
=$(OUT_LIB
)
440 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
441 SALHELPERLIB=-luno_salhelper$(COMID)
442 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
444 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
446 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 # -O is necessary for inlining (see gcc documentation)
452 ifeq "$(DEBUG)" "yes"
457 CC_FLAGS_JNI=-c -fPIC -fno-common $(GCC_ARCH_OPTION) $(OPT_FLAGS)
458 CC_FLAGS=-c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden $(OPT_FLAGS)
460 SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
461 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
462 CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
463 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
467 LIBO_SDK_LDFLAGS_STDLIBS =
469 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
471 # install_name '@executable_path
$/(@
:f
)'
472 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
474 EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
475 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
476 LINK_JAVA_LIBS=-framework JavaVM
478 URE_MISC=$(OFFICE_HOME)/Contents/Resources/ure/share/misc
482 ###########################################################################
484 # FreeBSD specific settings
486 ###########################################################################
487 ifneq (,$(findstring freebsd,$(PLATFORM)))
488 # Settings for FreeBSD using gcc compiler
490 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
492 ifeq "$(PROCTYPE)" "x86_64"
493 UNOPKG_PLATFORM=kFreeBSD_x86_64
495 UNOPKG_PLATFORM=kFreeBSD_x86
499 ifeq "$(PROCTYPE)" "x86_64"
500 UNOPKG_PLATFORM=FreeBSD_x86_64
502 UNOPKG_PLATFORM=FreeBSD_x86
506 ifeq "$(PROCTYPE)" "x86_64"
512 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
528 SHAREDLIB_OUT=$(OUT_LIB)
530 GCC_VERSION=$(shell $(CC) -dumpversion)
550 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
551 SALHELPERLIB
=-luno_salhelper
$(COMID
)
552 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
557 # -O is necessary for inlining (see gcc documentation)
558 ifeq "$(DEBUG)" "yes"
563 CC_FLAGS_JNI
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) $(OPT_FLAGS
)
564 CC_FLAGS
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) -fvisibility
=hidden
$(OPT_FLAGS
)
566 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/freebsd"
567 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
568 CC_DEFINES_JNI
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
)
569 CC_DEFINES
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
)
573 LIBO_SDK_LDFLAGS_STDLIBS
=
575 LIBRARY_LINK_FLAGS
=-shared
-Wl
,-z
,origin '-Wl,-rpath,$$ORIGIN'
576 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
578 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
579 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS
)
580 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
582 URE_MISC
=$(OFFICE_PROGRAM_PATH
)