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
52 SHAREDLIB_OUT
=$(OUT_BIN
)
53 PACKAGE_LIB_DIR
=windows.plt
54 UNOPKG_PLATFORM
=Windows
70 CPPUHELPERLIB
=icppuhelper.lib
71 SALHELPERLIB
=isalhelper.lib
74 STLPORTLIB
=stlport_vc71
$(STLDEBUG
).lib
80 # use this for release version
81 CC_FLAGS
=-c
-MT
-Zm500
-Zc
:forScope
,wchar_t-
-wd4251
-wd4275
-wd4290
-wd4675
-wd4786
-wd4800
-Zc
:forScope
-GR
-EHa
82 ifeq "$(CPP_VC8)" "true"
83 #CC_FLAGS+=-EHa -Zc:wchar_t-
84 LINK_MANIFEST_VC8_ONLY
=mt
-manifest
$@.manifest
"-outputresource:$@;2"
87 LINK_MANIFEST_VC8_ONLY
=
93 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
94 STL_INCLUDES
=-I
"$(OO_SDK_HOME)/include/stl"
95 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/win32"
97 # define for used compiler necessary for UNO
98 # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
100 CC_DEFINES
=-DWIN32
-DWNT
-DCPPU_ENV
=msci
103 LIBRARY_LINK_FLAGS
=/NODEFAULTLIB
/DLL
/DEBUGTYPE
:cv
104 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
) /DEF
:$(PRJ
)/settings
/component.uno.def
105 EXE_LINK_FLAGS
=/MAP
/OPT
:NOREF
/SUBSYSTEM
:CONSOLE
/BASE
:0x1b000000 /DEBUGTYPE
:cv
/NODEFAULTLIB msvcrt.lib kernel32.lib
106 ifeq "$(DEBUG)" "yes"
107 LIBRARY_LINK_FLAGS
+=/DEBUG
108 EXE_LINK_FLAGS
+=/DEBUG
111 LINK_JAVA_LIBS
=/LIBPATH
:"$(OO_SDK_JAVA_HOME)/lib"
113 ifneq "$(OO_SDK_URE_HOME)" ""
114 URE_MISC
=$(OO_SDK_URE_HOME
)\misc
117 # use this for release version
118 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
119 #LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL
124 ###########################################################################
126 # Solaris specific settings
128 ###########################################################################
129 ifneq (,$(findstring solaris
,$(PLATFORM
)))
130 # Settings for Solaris using Sun Workshop compiler
132 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)
134 ifeq "$(PROCTYPE)" "sparc"
136 PACKAGE_LIB_DIR
=solaris_sparc.plt
137 UNOPKG_PLATFORM
=Solaris_SPARC
140 ifeq "$(PROCTYPE)" "sparc64"
142 PACKAGE_LIB_DIR
=solaris_sparc64.plt
143 UNOPKG_PLATFORM
=Solaris_SPARC64
144 JAVA_PROC_TYPE
=sparcv9
147 PACKAGE_LIB_DIR
=solaris_x86.plt
148 UNOPKG_PLATFORM
=Solaris_x86
164 SHAREDLIB_OUT
=$(OUT_LIB
)
179 # Include UDK version numbers
180 include $(PRJ)/include/udkversion.mk
184 CPPUHELPERLIB=-luno_cppuhelperC52
185 SALHELPERLIB=-luno_salhelperC52
188 ifeq "$(PROCTYPE)" "sparc64"
189 STLPORTLIB=-library=stlport4
191 STLPORTLIB=-lstlport_sunpro$(STLDEBUG)
198 ifeq "$(DEBUG)" "yes"
201 CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include
202 STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
203 SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris"
205 # define for used compiler necessary for UNO
206 # -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel
208 CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5
211 LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R
$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm
212 # means if used CC is lower then version 5.5 use option -instance=static
213 ifeq ($(OO_SDK_CC_55_OR_HIGHER),)
214 LIBRARY_LINK_FLAGS+=-instances=static
216 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map
218 EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs
219 LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_URE_LIB_DIR)"
220 LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
222 ifeq "$(PROCTYPE)" "sparc64"
224 LIBRARY_LINK_FLAGS+=-m64
228 ifneq "$(OO_SDK_URE_HOME)" ""
229 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
236 ###########################################################################
238 # Linux specific settings
240 ###########################################################################
241 ifneq (,$(findstring linux,$(PLATFORM)))
242 # Settings for Linux using gcc compiler
244 PROCTYPE := $(shell $(PRJ)/config.guess | cut -d "-" -f1 | sed -e 's
/^i
.86$$/i386
/')
247 PACKAGE_LIB_DIR=linux_$(PROCTYPE).plt
248 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
249 JAVA_PROC_TYPE=$(PROCTYPE)
252 ifeq "$(PROCTYPE)" "i386"
253 PACKAGE_LIB_DIR=linux_x86.plt
254 UNOPKG_PLATFORM=Linux_x86
259 ifeq "$(PROCTYPE)" "powerpc"
260 PACKAGE_LIB_DIR=linux_powerpc.plt
261 UNOPKG_PLATFORM=Linux_PowerPC
266 ifeq "$(PROCTYPE)" "sparc"
267 PACKAGE_LIB_DIR=linux_sparc.plt
268 UNOPKG_PLATFORM=Linux_SPARC
273 ifeq "$(PROCTYPE)" "x86_64"
277 ifeq "$(PROCTYPE)" "powerpc64"
292 SHAREDLIB_OUT=$(OUT_LIB)
294 GCC_VERSION=$(shell $(CC) -dumpversion)
312 # Include UDK version numbers
313 include $(PRJ
)/include/udkversion.mk
317 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
318 SALHELPERLIB
=-luno_salhelper
$(COMID
)
321 ifeq "$(STLPORT)" "yes"
322 ifeq "$(STLPORT_VER)" "500"
325 STLPORTLIB
=-lstlport_gcc
$(STLDEBUG
)
334 # -O is necessary for inlining (see gcc documentation)
335 ifeq "$(DEBUG)" "yes"
341 ifeq "$(PROCTYPE)" "ppc"
345 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/linux"
346 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
347 STL_INCLUDES
=-I
"$(OO_SDK_HOME)/include/stl"
348 CC_DEFINES
=-DUNX
-DGCC
-DLINUX
-DCPPU_ENV
=$(CPPU_ENV
) -DGXX_INCLUDE_PATH
=$(SDK_GXX_INCLUDE_PATH
)
350 # define for used compiler necessary for UNO
351 #-DCPPU_ENV=gcc2 -- gcc 2.91/2.95
352 #-DCPPU_ENV=gcc3 -- gcc3 3.0
356 LIBRARY_LINK_FLAGS
=-shared
'-Wl,-rpath,$$ORIGIN'
358 ifeq "$(PROCTYPE)" "ppc"
359 LIBRARY_LINK_FLAGS
+=-fPIC
361 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
) -Wl
,--version-script
,$(PRJ
)/settings
/component.uno.map
363 #EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
364 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
-Wl
,-export-dynamic
-Wl
,-z
,defs
-Wl
,--no-whole-archive
365 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)"
366 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
368 ifneq "$(OO_SDK_URE_HOME)" ""
369 URE_MISC
=$(OO_SDK_URE_HOME
)/share
/misc
374 ###########################################################################
376 # MacOSX/Darwin specific settings
378 ###########################################################################
379 ifneq (,$(findstring darwin
,$(PLATFORM
)))
380 # Settings for MacOSX using gcc 4.0.1 compiler
382 PROCTYPE
:= $(shell $(PRJ
)/config.guess | cut
-d
"-" -f1
)
384 # Default is MacOSX on a Intel machine
387 ifeq "$(PROCTYPE)" "i686"
388 PACKAGE_LIB_DIR
=macosx_x86.plt
389 UNOPKG_PLATFORM
=MacOSX_x86
392 PACKAGE_LIB_DIR
=macosx_ppc.plt
393 UNOPKG_PLATFORM
=MacOSX_PowerPC
409 SHAREDLIB_OUT
=$(OUT_LIB
)
411 GCC_VERSION
=$(shell $(CC
) -dumpversion
)
429 # Include UDK version numbers
430 include $(PRJ)/include/udkversion.mk
434 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
435 SALHELPERLIB=-luno_salhelper$(COMID)
439 SALDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_sal.dylib.3:$(OO_SDK_URE_LIB_DIR)/libuno_sal.dylib
440 CPPUDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppu.dylib.3:$(OO_SDK_URE_LIB_DIR)/libuno_cppu.dylib
441 CPPUHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppuhelper$(COMID).dylib.3:$(OO_SDK_URE_LIB_DIR)/libuno_cppuhelper$(COMID).dylib
442 SALHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3:$(OO_SDK_URE_LIB_DIR)/libuno_salhelper$(COMID).dylib
443 REGDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libreg.dylib.3:$(OO_SDK_URE_LIB_DIR)/libreg.dylib
444 STOREDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libstore.dylib.3:$(OO_SDK_URE_LIB_DIR)/libstore.dylib
446 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
448 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
453 # -O is necessary for inlining (see gcc documentation)
454 ifeq "$(DEBUG)" "yes"
455 CC_FLAGS=-malign-natural -c -g -fPIC -fno-common
457 CC_FLAGS=-malign-natural -c -O -fPIC -fno-common
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 STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl"
463 CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH)
467 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress
470 # install_name '@executable_path
$/(@
:f
)'
471 COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE)
473 #EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs
474 LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_URE_LIB_DIR)"
475 LINK_JAVA_LIBS=-framework JavaVM
476 #LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/Libraries"
478 ifneq "$(OO_SDK_URE_HOME)" ""
479 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
484 ###########################################################################
486 # FreeBSD specific settings
488 ###########################################################################
489 ifneq (,$(findstring freebsd,$(PLATFORM)))
490 # Settings for FreeBSD using gcc compiler
492 PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
494 # Default is freebsd on a intel machine
496 PACKAGE_LIB_DIR=freebsd_x86.plt
497 UNOPKG_PLATFORM=FreeBSD_x86
511 SHAREDLIB_OUT=$(OUT_LIB)
513 GCC_VERSION=$(shell $(CC) -dumpversion)
515 ifeq "$(shell echo $(GCC_VERSION) | cut -c 1)" "3"
536 # Include UDK version numbers
537 include $(PRJ
)/include/udkversion.mk
541 CPPUHELPERLIB
=-luno_cppuhelper
$(COMID
)
542 SALHELPERLIB
=-luno_salhelper
$(COMID
)
545 ifeq "$(STLPORT_VER)" "500"
548 STLPORTLIB
=-lstlport_gcc
$(STLDEBUG
)
554 # -O is necessary for inlining (see gcc documentation)
555 ifeq "$(DEBUG)" "yes"
556 CC_FLAGS
=-c
-g
-fPIC
-DPIC
$(PTHREAD_CFLAGS
)
558 CC_FLAGS
=-c
-O
-fPIC
-DPIC
$(PTHREAD_CFLAGS
)
561 SDK_JAVA_INCLUDES
= -I
"$(OO_SDK_JAVA_HOME)/include" -I
"$(OO_SDK_JAVA_HOME)/include/freebsd"
562 CC_INCLUDES
=-I.
-I
$(OUT
)/inc
-I
$(OUT
)/inc
/examples
-I
$(PRJ
)/include
563 STL_INCLUDES
=-I
"$(OO_SDK_HOME)/include/stl"
564 CC_DEFINES
=-DUNX
-DGCC
-DFREEBSD
-DCPPU_ENV
=$(CPPU_ENV
) -DGXX_INCLUDE_PATH
=$(SDK_GXX_INCLUDE_PATH
)
568 LIBRARY_LINK_FLAGS
=-shared
'-Wl,-rpath,$$ORIGIN'
569 COMP_LINK_FLAGS
=$(LIBRARY_LINK_FLAGS
) -Wl
,--version-script
,$(PRJ
)/settings
/component.uno.map
571 EXE_LINK_FLAGS
=-Wl
,--allow-shlib-undefined
572 #EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs
573 LINK_LIBS
=-L
"$(OUT)/lib" -L
"$(OO_SDK_HOME)/lib" -L
"$(OO_SDK_URE_LIB_DIR)" $(PTHREAD_LIBS
)
574 LINK_JAVA_LIBS
=-L
"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)"
576 ifneq "$(OO_SDK_URE_HOME)" ""
577 URE_MISC
=$(OO_SDK_URE_HOME
)/share
/misc