merged tag ooo/DEV300_m102
[LibreOffice.git] / odk / settings / settings.mk
blob748800b265c15da3f371ad6839039626540b63c4
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.
8 ifeq "$(PLATFORM)" ""
9 PLATFORM = windows
10 endif
12 # debug option, default is no debug
13 DEBUG=no
14 ifeq "$(MAKECMDGOALS)" "debug"
15 DEBUG=yes
16 endif
18 ###########################################################################
20 # Java settings
22 ###########################################################################
23 JAVAC_FLAGS=
25 ifeq "$(DEBUG)" "yes"
26 JAVAC_FLAGS+=-g
27 endif
29 JAVABIN=bin
31 ###########################################################################
33 # Windows specific settings
35 ###########################################################################
36 ifeq "$(PLATFORM)" "windows"
37 # Settings for Windows using Microsoft compiler/linker
39 OS=WIN
40 PS=\\
41 ICL=$$
42 CC=cl
43 LINK=link
44 BUILDLIB=lib
45 ECHO=@echo
46 MKDIR=mkdir
47 MV=move
48 CAT=type
49 OBJ_EXT=obj
50 EXE_EXT=.exe
51 COPY=copy
52 SHAREDLIB_EXT=dll
53 SHAREDLIB_OUT=$(OUT_BIN)
54 PACKAGE_LIB_DIR=windows.plt
55 UNOPKG_PLATFORM=Windows
57 OSEP=^<
58 CSEP=^>
59 QUOTE=
60 QM=
61 SQM=
62 ECHOLINE=@echo.
63 P2BG=
65 DEL=del
66 DELRECURSIVE=rd /S /Q
67 URLPREFIX=file:///
69 SALLIB=isal.lib
70 CPPULIB=icppu.lib
71 CPPUHELPERLIB=icppuhelper.lib
72 SALHELPERLIB=isalhelper.lib
73 REGLIB=ireg.lib
74 STORELIB=istore.lib
75 STLPORTLIB=stlport_vc71$(STLDEBUG).lib
77 BLANK=
78 EMPTYSTRING=
79 PATH_SEPARATOR=;
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"
87 else
88 #CC_FLAGS+=
89 LINK_MANIFEST=
90 endif
91 ifeq "$(DEBUG)" "yes"
92 CC_FLAGS_JNI+=-Zi
93 CC_FLAGS+=-Zi
94 endif
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
105 CC_OUTPUT_SWITCH=-Fo
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
113 endif
115 LINK_JAVA_LIBS=/LIBPATH:"$(OO_SDK_JAVA_HOME)/lib"
117 ifneq "$(OO_SDK_URE_HOME)" ""
118 URE_MISC=$(OO_SDK_URE_HOME)\misc
119 endif
121 # use this for release version
122 #EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000
123 #LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL
124 endif
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"
139 PLATFORM=solsparc
140 PACKAGE_LIB_DIR=solaris_sparc.plt
141 UNOPKG_PLATFORM=Solaris_SPARC
142 JAVA_PROC_TYPE=sparc
143 else
144 ifeq "$(PROCTYPE)" "sparc64"
145 PLATFORM=solsparc
146 PACKAGE_LIB_DIR=solaris_sparc64.plt
147 UNOPKG_PLATFORM=Solaris_SPARC64
148 JAVA_PROC_TYPE=sparcv9
149 else
150 PLATFORM=solintel
151 PACKAGE_LIB_DIR=solaris_x86.plt
152 UNOPKG_PLATFORM=Solaris_x86
153 JAVA_PROC_TYPE=i386
154 endif
155 endif
157 OS=SOLARIS
158 PS=/
159 ICL=\$$
160 CC=CC
161 LINK=CC
162 LIB=CC
163 ECHO=@echo
164 MKDIR=mkdir -p
165 CAT=cat
166 OBJ_EXT=o
167 SHAREDLIB_EXT=so
168 SHAREDLIB_PRE=lib
169 SHAREDLIB_OUT=$(OUT_LIB)
171 OSEP=\<
172 CSEP=\>
173 QUOTE=$(subst S,\,S)
174 QM=\"
175 SQM='
176 ECHOLINE=@echo
177 P2BG=&
179 DEL=rm -f
180 DELRECURSIVE=rm -rf
181 COPY=cp
182 URLPREFIX=file://
184 # Include UDK version numbers
185 include $(PRJ)/include/udkversion.mk
187 SALLIB=-luno_sal
188 CPPULIB=-luno_cppu
189 CPPUHELPERLIB=-luno_cppuhelperC52
190 SALHELPERLIB=-luno_salhelperC52
191 REGLIB=-lreg
192 STORELIB=-lstore
193 ifeq "$(PROCTYPE)" "sparc64"
194 STLPORTLIB=-library=stlport4
195 else
196 STLPORTLIB=-lstlport_sunpro$(STLDEBUG)
197 endif
199 EMPTYSTRING=
200 PATH_SEPARATOR=:
202 CC_FLAGS_JNI=-c -KPIC
203 CC_FLAGS=-c -KPIC -xldscope=hidden
204 ifeq "$(DEBUG)" "yes"
205 CC_FLAGS_JNI+=-g
206 CC_FLAGS+=-g
207 endif
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
217 CC_OUTPUT_SWITCH=-o
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
223 endif
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"
232 CC_FLAGS+=-m64
233 LIBRARY_LINK_FLAGS+=-m64
234 EXE_LINK_FLAGS+=-m64
235 endif
237 ifneq "$(OO_SDK_URE_HOME)" ""
238 URE_MISC=$(OO_SDK_URE_HOME)/share/misc
239 endif
241 endif
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/')
254 PLATFORM=linux
256 PACKAGE_LIB_DIR=linux_$(PROCTYPE).plt
257 UNOPKG_PLATFORM=Linux_$(PROCTYPE)
258 JAVA_PROC_TYPE=$(PROCTYPE)
259 STLPORT=no
261 ifeq "$(PROCTYPE)" "i386"
262 PACKAGE_LIB_DIR=linux_x86.plt
263 UNOPKG_PLATFORM=Linux_x86
264 JAVA_PROC_TYPE=i386
265 STLPORT=yes
266 endif
268 ifeq "$(PROCTYPE)" "powerpc"
269 PACKAGE_LIB_DIR=linux_powerpc.plt
270 UNOPKG_PLATFORM=Linux_PowerPC
271 JAVA_PROC_TYPE=ppc
272 STLPORT=yes
273 endif
275 ifeq "$(PROCTYPE)" "sparc"
276 PACKAGE_LIB_DIR=linux_sparc.plt
277 UNOPKG_PLATFORM=Linux_SPARC
278 JAVA_PROC_TYPE=sparc
279 STLPORT=yes
280 endif
282 ifeq "$(PROCTYPE)" "x86_64"
283 JAVA_PROC_TYPE=amd64
284 endif
286 ifeq "$(PROCTYPE)" "powerpc64"
287 JAVA_PROC_TYPE=ppc64
288 endif
290 OS=LINUX
291 PS=/
292 ICL=\$$
293 CC=gcc
294 LINK=g++
295 LIB=g++
296 ECHO=@echo
297 MKDIR=mkdir -p
298 CAT=cat
299 OBJ_EXT=o
300 SHAREDLIB_EXT=so
301 SHAREDLIB_PRE=lib
302 SHAREDLIB_OUT=$(OUT_LIB)
304 GCC_VERSION=$(shell $(CC) -dumpversion)
306 COMID=gcc3
307 CPPU_ENV=gcc3
309 OSEP=\<
310 CSEP=\>
311 QUOTE=$(subst S,\,S)
312 QM=\"
313 SQM='
314 ECHOLINE=@echo
315 P2BG=&
317 DEL=rm -f
318 DELRECURSIVE=rm -rf
319 COPY=cp
320 URLPREFIX=file://
322 # Include UDK version numbers
323 include $(PRJ)/include/udkversion.mk
325 SALLIB=-luno_sal
326 CPPULIB=-luno_cppu
327 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
328 SALHELPERLIB=-luno_salhelper$(COMID)
329 REGLIB=-lreg
330 STORELIB=-lstore
331 ifeq "$(STLPORT)" "yes"
332 ifeq "$(STLPORT_VER)" "500"
333 STLPORTLIB=-lstlport
334 else
335 STLPORTLIB=-lstlport_gcc$(STLDEBUG)
336 endif
337 else
338 STLPORTLIB=
339 endif
341 EMPTYSTRING=
342 PATH_SEPARATOR=:
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"
348 CC_FLAGS_JNI+=-g
349 CC_FLAGS+=-g
350 else
351 CC_FLAGS_JNI+=-O
352 CC_FLAGS+=-O
353 endif
355 ifeq "$(PROCTYPE)" "ppc"
356 CC_FLAGS+=-fPIC
357 endif
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
369 CC_OUTPUT_SWITCH=-o
371 LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN'
373 ifeq "$(PROCTYPE)" "ppc"
374 LIBRARY_LINK_FLAGS+=-fPIC
375 endif
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
386 endif
388 endif
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
401 PLATFORM=macosx
403 ifeq "$(PROCTYPE)" "i386"
404 PACKAGE_LIB_DIR=macosx_x86.plt
405 UNOPKG_PLATFORM=MacOSX_x86
406 JAVA_PROC_TYPE=x86
407 else
408 ifeq "$(PROCTYPE)" "x86_64"
409 PACKAGE_LIB_DIR=macosx_x86.plt
410 UNOPKG_PLATFORM=MacOSX_x86
411 JAVA_PROC_TYPE=x86
412 else
413 PACKAGE_LIB_DIR=macosx_ppc.plt
414 UNOPKG_PLATFORM=MacOSX_PowerPC
415 JAVA_PROC_TYPE=ppc
416 endif
417 endif
418 JAVABIN=Commands
420 GCC_VERSION =$(shell gcc -dumpversion| cut -d"." -f1,2)
421 ifeq "$(GCC_VERSION)" "4.2"
422 GCC_ARCH_OPTION=-arch i386
423 endif
425 OS=MACOSX
426 PS=/
427 ICL=\$$
428 CC=gcc-$(GCC_VERSION)
429 LINK=g++-$(GCC_VERSION)
430 LIB=g++-$(GCC_VERSION)
431 ECHO=@echo
432 MKDIR=mkdir -p
433 CAT=cat
434 OBJ_EXT=o
435 SHAREDLIB_EXT=dylib
436 SHAREDLIB_PRE=lib
437 SHAREDLIB_OUT=$(OUT_LIB)
439 COMID=gcc3
440 CPPU_ENV=gcc3
442 OSEP=\<
443 CSEP=\>
444 QUOTE=$(subst S,\,S)
445 QM=\"
446 SQM='
447 ECHOLINE=@echo
448 P2BG=&
450 DEL=rm -f
451 DELRECURSIVE=rm -rf
452 COPY=cp
453 URLPREFIX=file://
455 # Include UDK version numbers
456 include $(PRJ)/include/udkversion.mk
458 SALLIB=-luno_sal
459 CPPULIB=-luno_cppu
460 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
461 SALHELPERLIB=-luno_salhelper$(COMID)
462 REGLIB=-lreg
463 STORELIB=-lstore
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
476 EMPTYSTRING=
477 PATH_SEPARATOR=:
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"
483 CC_FLAGS_JNI+=-g
484 CC_FLAGS+=-g
485 else
486 CC_FLAGS_JNI+=-O
487 CC_FLAGS+=-O
488 endif
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
496 CC_OUTPUT_SWITCH=-o
498 LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION)
499 #-fPIC -fno-common
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
512 endif
514 endif
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)))
527 PLATFORM=kfreebsd
528 ifeq "$(PROCTYPE)" "x86_64"
529 PACKAGE_LIB_DIR=kfreebsd_x86_64.plt
530 UNOPKG_PLATFORM=kFreeBSD_x86_64
531 else
532 PACKAGE_LIB_DIR=kfreebsd_x86.plt
533 UNOPKG_PLATFORM=kFreeBSD_x86
534 endif
535 else
536 PLATFORM=freebsd
537 ifeq "$(PROCTYPE)" "x86_64"
538 PACKAGE_LIB_DIR=freebsd_x86_64.plt
539 UNOPKG_PLATFORM=FreeBSD_x86_64
540 else
541 PACKAGE_LIB_DIR=freebsd_x86.plt
542 UNOPKG_PLATFORM=FreeBSD_x86
543 endif
544 endif
546 ifeq "$(PROCTYPE)" "x86_64"
547 JAVA_PROC_TYPE=amd64
548 else
549 JAVA_PROC_TYPE=i386
550 endif
552 ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
553 OS=LINUX
554 else
555 OS=FREEBSD
556 endif
557 PS=/
558 ICL=\$$
559 CC=gcc
560 LINK=g++
561 LIB=g++
562 ECHO=@echo
563 MKDIR=mkdir -p
564 CAT=cat
565 OBJ_EXT=o
566 SHAREDLIB_EXT=so
567 SHAREDLIB_PRE=lib
568 SHAREDLIB_OUT=$(OUT_LIB)
570 GCC_VERSION=$(shell $(CC) -dumpversion)
572 COMID=gcc3
573 CPPU_ENV=gcc3
575 OSEP=\<
576 CSEP=\>
577 QUOTE=$(subst S,\,S)
578 QM=\"
579 SQM='
580 ECHOLINE=@echo
581 P2BG=&
583 DEL=rm -f
584 DELRECURSIVE=rm -rf
585 COPY=cp
586 URLPREFIX=file://
588 # Include UDK version numbers
589 include $(PRJ)/include/udkversion.mk
591 SALLIB=-luno_sal
592 CPPULIB=-luno_cppu
593 CPPUHELPERLIB=-luno_cppuhelper$(COMID)
594 SALHELPERLIB=-luno_salhelper$(COMID)
595 REGLIB=-lreg
596 STORELIB=-lstore
597 ifeq "$(STLPORT_VER)" "500"
598 STLPORTLIB=-lstlport
599 else
600 STLPORTLIB=-lstlport_gcc$(STLDEBUG)
601 endif
603 EMPTYSTRING=
604 PATH_SEPARATOR=:
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"
610 CC_FLAGS_JNI+=-g
611 CC_FLAGS+=-g
612 else
613 CC_FLAGS_JNI+=-O
614 CC_FLAGS+=-O
615 endif
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
623 CC_OUTPUT_SWITCH=-o
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
636 endif
638 endif