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 URE_MISC
=${OFFICE_PROGRAM_PATH}
134 # use this for release version
135 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
136 #LIBRARY_LINK_FLAGS=/DLL
141 ###########################################################################
143 # Solaris specific settings
145 ###########################################################################
146 ifeq "$(PLATFORM)" "solaris"
147 # Settings for Solaris using GCC
149 ifeq "$(PROCTYPE)" "sparc"
151 UNOPKG_PLATFORM
=Solaris_SPARC
154 ifeq "$(PROCTYPE)" "sparc64"
156 UNOPKG_PLATFORM
=Solaris_SPARC64
157 JAVA_PROC_TYPE
=sparcv9
160 UNOPKG_PLATFORM
=Solaris_x86
177 SHAREDLIB_OUT
=$(OUT_LIB
)
197 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
198 SALHELPERLIB=-luno_salhelper$(COMID)
199 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
204 # -O is necessary for inlining (see gcc documentation)
205 ifeq "$(DEBUG)" "yes"
210 CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
211 CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
212 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
213 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
215 # define for used compiler necessary for UNO
217 CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=$(CPPU_ENV) -DGCC
218 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE -DGCC
221 LIBO_SDK_LDFLAGS_STDLIBS =
223 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -fPIC -PIC -temp=/tmp '-R
$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
224 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
226 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
227 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
228 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
230 ifeq "$(PROCTYPE)" "sparc64"
232 LIBRARY_LINK_FLAGS+=-m64
236 URE_MISC=$(OFFICE_PROGRAM_PATH)
242 ###########################################################################
244 # Linux specific settings
246 ###########################################################################
247 ifeq "$(PLATFORM)" "linux"
248 # Settings for Linux using gcc compiler
250 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
251 JAVA_PROC_TYPE=$(PROCTYPE)
253 ifeq "$(PROCTYPE)" "x86"
257 ifeq "$(PROCTYPE)" "powerpc"
258 UNOPKG_PLATFORM=Linux_PowerPC
262 ifeq "$(PROCTYPE)" "sparc"
263 UNOPKG_PLATFORM=Linux_SPARC
266 ifeq "$(PROCTYPE)" "x86_64"
270 ifeq "$(PROCTYPE)" "powerpc64"
286 SHAREDLIB_OUT=$(OUT_LIB)
288 GCC_VERSION=$(shell $(CC) -dumpversion)
308 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
309 SALHELPERLIB
=-luno_salhelper
$(COMID
)
310 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
315 # -O is necessary for inlining (see gcc documentation)
316 ifeq "$(DEBUG)" "yes"
321 CC_FLAGS_JNI
=-c
-fpic
$(OPT_FLAGS
)
322 CC_FLAGS
=-c
-fpic
-fvisibility
=hidden
$(OPT_FLAGS
)
324 ifeq "$(PROCTYPE)" "powerpc"
328 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/linux"
329 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
330 CC_DEFINES_JNI
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
)
331 CC_DEFINES
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
) -DHAVE_GCC_VISIBILITY_FEATURE
335 LIBO_SDK_LDFLAGS_STDLIBS
=
337 LIBRARY_LINK_FLAGS
=-shared
-Wl
,-z
,origin '-Wl,-rpath,$$ORIGIN'
339 ifeq "$(PROCTYPE)" "powerpc"
340 LIBRARY_LINK_FLAGS
+=-fPIC
342 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
344 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
-Wl
,-export-dynamic
-Wl
,-z
,defs
-Wl
,--no-whole-archive
345 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)"
346 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
348 URE_MISC
=$(OFFICE_PROGRAM_PATH
)
352 ###########################################################################
354 # MacOSX/Darwin specific settings
356 ###########################################################################
357 ifeq "$(PLATFORM)" "macosx"
358 # Settings for MacOSX using gcc 4.0.1 compiler
360 ifeq "$(PROCTYPE)" "x86"
361 UNOPKG_PLATFORM
=MacOSX_x86
363 ifeq "$(PROCTYPE)" "x86_64"
364 UNOPKG_PLATFORM
=MacOSX_x86_64
369 ifeq "$(PROCTYPE)" "x86"
370 GCC_VERSION
=$(shell gcc
-dumpversion| cut
-d
"." -f1
,2)
371 ifeq "$(GCC_VERSION)" "4.2"
372 GCC_ARCH_OPTION
=-arch i386
379 ifeq "$(PROCTYPE)" "x86"
380 CC
=gcc-
$(GCC_VERSION
)
381 LINK
=g
++-$(GCC_VERSION
)
382 LIB
=g
++-$(GCC_VERSION
)
394 SHAREDLIB_OUT
=$(OUT_LIB
)
414 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
415 SALHELPERLIB=-luno_salhelper$(COMID)
416 PURPENVHELPERLIB=-luno_purpenvhelper$(COMID)
418 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
420 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
425 # -O is necessary for inlining (see gcc documentation)
426 ifeq "$(DEBUG)" "yes"
431 CC_FLAGS_JNI=-c -fPIC -fno-common $(GCC_ARCH_OPTION) $(OPT_FLAGS)
432 CC_FLAGS=-c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden $(OPT_FLAGS)
434 SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
435 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
436 CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV)
437 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DHAVE_GCC_VISIBILITY_FEATURE
441 LIBO_SDK_LDFLAGS_STDLIBS =
443 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
445 # install_name '@executable_path
$/(@
:f
)'
446 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
448 EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
449 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
450 LINK_JAVA_LIBS=-framework JavaVM
452 URE_MISC=$(OFFICE_HOME)/Contents/Resources/ure/share/misc
456 ###########################################################################
458 # FreeBSD specific settings
460 ###########################################################################
461 ifneq (,$(findstring freebsd,$(PLATFORM)))
462 # Settings for FreeBSD using gcc compiler
464 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
466 ifeq "$(PROCTYPE)" "x86_64"
467 UNOPKG_PLATFORM=kFreeBSD_x86_64
469 UNOPKG_PLATFORM=kFreeBSD_x86
473 ifeq "$(PROCTYPE)" "x86_64"
474 UNOPKG_PLATFORM=FreeBSD_x86_64
476 UNOPKG_PLATFORM=FreeBSD_x86
480 ifeq "$(PROCTYPE)" "x86_64"
486 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
502 SHAREDLIB_OUT=$(OUT_LIB)
504 GCC_VERSION=$(shell $(CC) -dumpversion)
524 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
525 SALHELPERLIB
=-luno_salhelper
$(COMID
)
526 PURPENVHELPERLIB
=-luno_purpenvhelper
$(COMID
)
531 # -O is necessary for inlining (see gcc documentation)
532 ifeq "$(DEBUG)" "yes"
537 CC_FLAGS_JNI
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) $(OPT_FLAGS
)
538 CC_FLAGS
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) -fvisibility
=hidden
$(OPT_FLAGS
)
540 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/freebsd"
541 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
542 CC_DEFINES_JNI
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
)
543 CC_DEFINES
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
) -DHAVE_GCC_VISIBILITY_FEATURE
547 LIBO_SDK_LDFLAGS_STDLIBS
=
549 LIBRARY_LINK_FLAGS
=-shared
-Wl
,-z
,origin '-Wl,-rpath,$$ORIGIN'
550 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
552 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
553 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS
)
554 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
556 URE_MISC
=$(OFFICE_PROGRAM_PATH
)