1 # Global settings file for the minimal build environment of the SDK
2 # This file have to updated/extended for other platforms.
4 # test for the platform
5 PLATFORM
:= $(shell $(PRJ
)/config.guess | cut
-d
"-" -f3
,4)
7 # config.guess is missing for windows. We rely on getting "" in this case.
12 # debug option, default is no debug
14 ifeq "$(MAKECMDGOALS)" "debug"
18 ###########################################################################
22 ###########################################################################
31 ###########################################################################
33 # Windows specific settings
35 ###########################################################################
36 ifeq "$(PLATFORM)" "windows"
37 # Settings for Windows using Microsoft compiler/linker
53 SHAREDLIB_OUT
=$(OUT_BIN
)
54 PACKAGE_LIB_DIR
=windows.plt
55 UNOPKG_PLATFORM
=Windows
71 CPPUHELPERLIB
=icppuhelper.lib
72 SALHELPERLIB
=isalhelper.lib
75 STLPORTLIB
=stlport_vc71
$(STLDEBUG
).lib
81 # use this for release version
82 CC_FLAGS_JNI
=-c
-MT
-Zm500
-Zc
:forScope
,wchar_t-
-wd4251
-wd4275
-wd4290
-wd4675
-wd4786
-wd4800
-Zc
:forScope
-GR
-EHa
83 CC_FLAGS
=-c
-MT
-Zm500
-Zc
:forScope
,wchar_t-
-wd4251
-wd4275
-wd4290
-wd4675
-wd4786
-wd4800
-Zc
:forScope
-GR
-EHa
84 ifeq "$(CPP_MANIFEST)" "true"
85 #CC_FLAGS+=-EHa -Zc:wchar_t-
86 LINK_MANIFEST
=mt
-manifest
$@.manifest
"-outputresource:$@;2"
96 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
97 STL_INCLUDES
=-I
"$(OO_SDK_HOME)/include/stl"
98 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/win32"
100 # define for used compiler necessary for UNO
101 # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
103 CC_DEFINES_JNI
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=msci
104 CC_DEFINES
=-DWIN32
-DWNT
-D_DLL
-DCPPU_ENV
=msci
107 LIBRARY_LINK_FLAGS
=/NODEFAULTLIB
/DLL
/DEBUGTYPE
:cv
108 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
) /DEF
:$(PRJ
)/settings
/component.uno.def
109 EXE_LINK_FLAGS
=/MAP
/OPT
:NOREF
/SUBSYSTEM
:CONSOLE
/BASE
:0x1b000000 /DEBUGTYPE
:cv
/NODEFAULTLIB msvcrt.lib kernel32.lib
110 ifeq "$(DEBUG)" "yes"
111 LIBRARY_LINK_FLAGS
+=/DEBUG
112 EXE_LINK_FLAGS
+=/DEBUG
115 LINK_JAVA_LIBS
=/LIBPATH
:"$(OO_SDK_JAVA_HOME)/lib"
117 ifneq "$(OO_SDK_URE_HOME)" ""
118 URE_MISC
=$(OO_SDK_URE_HOME
)\misc
121 # use this for release version
122 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
123 #LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL
128 ###########################################################################
130 # Solaris specific settings
132 ###########################################################################
133 ifneq (,$(findstring solaris
,$(PLATFORM
)))
134 # Settings for Solaris using Sun Workshop compiler
136 PROCTYPE
:= $(shell $(PRJ
)/config.guess | cut
-d
"-" -f1
)$(shell /usr
/ccs
/bin
/elfdump
-e
"$(OO_SDK_URE_HOME)/lib/libuno_sal.so.3" |
/usr
/xpg4
/bin
/grep
-q
-w ELFCLASS64
&& echo
64)
138 ifeq "$(PROCTYPE)" "sparc"
140 PACKAGE_LIB_DIR
=solaris_sparc.plt
141 UNOPKG_PLATFORM
=Solaris_SPARC
144 ifeq "$(PROCTYPE)" "sparc64"
146 PACKAGE_LIB_DIR
=solaris_sparc64.plt
147 UNOPKG_PLATFORM
=Solaris_SPARC64
148 JAVA_PROC_TYPE
=sparcv9
151 PACKAGE_LIB_DIR
=solaris_x86.plt
152 UNOPKG_PLATFORM
=Solaris_x86
169 SHAREDLIB_OUT
=$(OUT_LIB
)
184 # Include UDK version numbers
185 include $(PRJ)/include/udkversion.mk
189 CPPUHELPERLIB=-luno_cppuhelperC52
190 SALHELPERLIB=-luno_salhelperC52
193 ifeq "$(PROCTYPE)" "sparc64"
194 STLPORTLIB=-library=stlport4
196 STLPORTLIB=-lstlport_sunpro$(STLDEBUG)
202 CC_FLAGS_JNI=-c -KPIC
203 CC_FLAGS=-c -KPIC -xldscope=hidden
204 ifeq "$(DEBUG)" "yes"
208 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
209 STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
210 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
212 # define for used compiler necessary for UNO
213 # -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel
215 CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5
216 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE
219 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R
$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
220 # means if used CC is lower then version 5.5 use option -instance=static
221 ifeq ($(OO_SDK_CC_55_OR_HIGHER),)
222 LIBRARY_LINK_FLAGS+=-instances=static
224 #COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map
225 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
227 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
228 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
229 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
231 ifeq "$(PROCTYPE)" "sparc64"
233 LIBRARY_LINK_FLAGS+=-m64
237 ifneq "$(OO_SDK_URE_HOME)" ""
238 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
245 ###########################################################################
247 # Linux specific settings
249 ###########################################################################
250 ifneq (,$(findstring linux,$(PLATFORM)))
251 # Settings for Linux using gcc compiler
253 PROCTYPE := $(shell $(PRJ)/config.guess | cut -d "-" -f1 | sed -e 's
/^i
.86$$/i386
/')
256 PACKAGE_LIB_DIR=linux_$(PROCTYPE).plt
257 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
258 JAVA_PROC_TYPE=$(PROCTYPE)
261 ifeq "$(PROCTYPE)" "i386"
262 PACKAGE_LIB_DIR=linux_x86.plt
263 UNOPKG_PLATFORM=Linux_x86
268 ifeq "$(PROCTYPE)" "powerpc"
269 PACKAGE_LIB_DIR=linux_powerpc.plt
270 UNOPKG_PLATFORM=Linux_PowerPC
275 ifeq "$(PROCTYPE)" "sparc"
276 PACKAGE_LIB_DIR=linux_sparc.plt
277 UNOPKG_PLATFORM=Linux_SPARC
282 ifeq "$(PROCTYPE)" "x86_64"
286 ifeq "$(PROCTYPE)" "powerpc64"
302 SHAREDLIB_OUT=$(OUT_LIB)
304 GCC_VERSION=$(shell $(CC) -dumpversion)
322 # Include UDK version numbers
323 include $(PRJ
)/include/udkversion.mk
327 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
328 SALHELPERLIB
=-luno_salhelper
$(COMID
)
331 ifeq "$(STLPORT)" "yes"
332 ifeq "$(STLPORT_VER)" "500"
335 STLPORTLIB
=-lstlport_gcc
$(STLDEBUG
)
344 CC_FLAGS_JNI
=-c
-fpic
345 CC_FLAGS
=-c
-fpic
-fvisibility
=hidden
346 # -O is necessary for inlining (see gcc documentation)
347 ifeq "$(DEBUG)" "yes"
355 ifeq "$(PROCTYPE)" "ppc"
359 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/linux"
360 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
361 STL_INCLUDES
=-I
"$(OO_SDK_HOME)/include/stl"
362 CC_DEFINES_JNI
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
) -DGXX_INCLUDE_PATH
=$(SDK_GXX_INCLUDE_PATH
)
363 CC_DEFINES
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
) -DGXX_INCLUDE_PATH
=$(SDK_GXX_INCLUDE_PATH
) -DHAVE_GCC_VISIBILITY_FEATURE
365 # define for used compiler necessary for UNO
366 #-DCPPU_ENV=gcc2 -- gcc 2.91/2.95
367 #-DCPPU_ENV=gcc3 -- gcc3 3.0
371 LIBRARY_LINK_FLAGS
=-shared
'-Wl,-rpath,$$ORIGIN'
373 ifeq "$(PROCTYPE)" "ppc"
374 LIBRARY_LINK_FLAGS
+=-fPIC
376 #COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
377 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
379 #EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
380 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
-Wl
,-export-dynamic
-Wl
,-z
,defs
-Wl
,--no-whole-archive
381 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)"
382 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
384 ifneq "$(OO_SDK_URE_HOME)" ""
385 URE_MISC
=$(OO_SDK_URE_HOME
)/share
/misc
390 ###########################################################################
392 # MacOSX/Darwin specific settings
394 ###########################################################################
395 ifneq (,$(findstring darwin
,$(PLATFORM
)))
396 # Settings for MacOSX using gcc 4.0.1 compiler
398 PROCTYPE
:= $(shell $(PRJ
)/config.guess | cut
-d
"-" -f1
)
400 # Default is MacOSX on a Intel machine
403 ifeq "$(PROCTYPE)" "i386"
404 PACKAGE_LIB_DIR
=macosx_x86.plt
405 UNOPKG_PLATFORM
=MacOSX_x86
408 ifeq "$(PROCTYPE)" "x86_64"
409 PACKAGE_LIB_DIR
=macosx_x86.plt
410 UNOPKG_PLATFORM
=MacOSX_x86
413 PACKAGE_LIB_DIR
=macosx_ppc.plt
414 UNOPKG_PLATFORM
=MacOSX_PowerPC
420 GCC_VERSION
=$(shell gcc
-dumpversion| cut
-d
"." -f1
,2)
421 ifeq "$(GCC_VERSION)" "4.2"
422 GCC_ARCH_OPTION
=-arch i386
428 CC
=gcc-
$(GCC_VERSION
)
429 LINK
=g
++-$(GCC_VERSION
)
430 LIB
=g
++-$(GCC_VERSION
)
437 SHAREDLIB_OUT
=$(OUT_LIB
)
455 # Include UDK version numbers
456 include $(PRJ)/include/udkversion.mk
460 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
461 SALHELPERLIB=-luno_salhelper$(COMID)
465 SALDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_sal.dylib.3:'$(OO_SDK_URE_LIB_DIR
)/libuno_sal.dylib
'
466 CPPUDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppu.dylib.3:'$(OO_SDK_URE_LIB_DIR
)/libuno_cppu.dylib
'
467 CPPUHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppuhelper'$(COMID
).dylib
.3:$(OO_SDK_URE_LIB_DIR
)/libuno_cppuhelper
$(COMID
).dylib
'
468 SALHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3:'$(OO_SDK_URE_LIB_DIR
)/libuno_salhelper
$(COMID
).dylib
'
469 REGDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libreg.dylib.3:'$(OO_SDK_URE_LIB_DIR
)/libreg.dylib
'
470 STOREDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libstore.dylib.3:'$(OO_SDK_URE_LIB_DIR
)/libstore.dylib
'
472 INSTALL_NAME_URELIBS=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 -change @__________________________________________________URELIB/libreg.dylib.3 @executable_path/urelibs/libreg.dylib.3 -change @__________________________________________________URELIB/libstore.dylib.3 @executable_path/urelibs/libstore.dylib.3
474 INSTALL_NAME_URELIBS_BIN=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 -change @__________________________________________________URELIB/libreg.dylib.3 libreg.dylib.3 -change @__________________________________________________URELIB/libstore.dylib.3 libstore.dylib.3
479 CC_FLAGS_JNI=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION)
480 CC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden
481 # -O is necessary for inlining (see gcc documentation)
482 ifeq "$(DEBUG)" "yes"
490 SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers
491 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
492 STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
493 CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
494 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE
498 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
501 # install_name '@executable_path
$/(@
:f
)'
502 #COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE)
503 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
505 EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress
506 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
507 LINK_JAVA_LIBS=-framework JavaVM
508 #LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/Libraries"
510 ifneq "$(OO_SDK_URE_HOME)" ""
511 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
516 ###########################################################################
518 # FreeBSD specific settings
520 ###########################################################################
521 ifneq (,$(findstring freebsd,$(PLATFORM)))
522 # Settings for FreeBSD using gcc compiler
524 PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
526 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
528 ifeq "$(PROCTYPE)" "x86_64"
529 PACKAGE_LIB_DIR=kfreebsd_x86_64.plt
530 UNOPKG_PLATFORM=kFreeBSD_x86_64
532 PACKAGE_LIB_DIR=kfreebsd_x86.plt
533 UNOPKG_PLATFORM=kFreeBSD_x86
537 ifeq "$(PROCTYPE)" "x86_64"
538 PACKAGE_LIB_DIR=freebsd_x86_64.plt
539 UNOPKG_PLATFORM=FreeBSD_x86_64
541 PACKAGE_LIB_DIR=freebsd_x86.plt
542 UNOPKG_PLATFORM=FreeBSD_x86
546 ifeq "$(PROCTYPE)" "x86_64"
552 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
568 SHAREDLIB_OUT=$(OUT_LIB)
570 GCC_VERSION=$(shell $(CC) -dumpversion)
588 # Include UDK version numbers
589 include $(PRJ
)/include/udkversion.mk
593 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
594 SALHELPERLIB
=-luno_salhelper
$(COMID
)
597 ifeq "$(STLPORT_VER)" "500"
600 STLPORTLIB
=-lstlport_gcc
$(STLDEBUG
)
606 CC_FLAGS_JNI
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
)
607 CC_FLAGS
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
) -fvisibility
=hidden
608 # -O is necessary for inlining (see gcc documentation)
609 ifeq "$(DEBUG)" "yes"
617 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/freebsd"
618 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
619 STL_INCLUDES
=-I
"$(OO_SDK_HOME)/include/stl"
620 CC_DEFINES_JNI
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
) -DGXX_INCLUDE_PATH
=$(SDK_GXX_INCLUDE_PATH
)
621 CC_DEFINES
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
) -DGXX_INCLUDE_PATH
=$(SDK_GXX_INCLUDE_PATH
) -DHAVE_GCC_VISIBILITY_FEATURE
625 LIBRARY_LINK_FLAGS
=-shared
'-Wl,-rpath,$$ORIGIN'
626 #COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map
627 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
)
629 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
630 #EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs
631 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS
)
632 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
634 ifneq "$(OO_SDK_URE_HOME)" ""
635 URE_MISC
=$(OO_SDK_URE_HOME
)/share
/misc