1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20#************************************************************** 21 22# Global settings file for the minimal build environment of the SDK 23# This file have to updated/extended for other platforms. 24 25# test for the platform 26PLATFORM := $(shell $(PRJ)/config.guess | cut -d"-" -f3,4) 27 28# config.guess is missing for windows. We rely on getting "" in this case. 29ifeq "$(PLATFORM)" "" 30PLATFORM = windows 31endif 32 33# debug option, default is no debug 34DEBUG=no 35ifeq "$(MAKECMDGOALS)" "debug" 36DEBUG=yes 37endif 38 39########################################################################### 40# 41# Java settings 42# 43########################################################################### 44JAVAC_FLAGS= 45 46ifeq "$(DEBUG)" "yes" 47JAVAC_FLAGS+=-g 48endif 49 50JAVABIN=bin 51 52########################################################################### 53# 54# Windows specific settings 55# 56########################################################################### 57ifeq "$(PLATFORM)" "windows" 58# Settings for Windows using Microsoft compiler/linker 59 60OS=WIN 61PS=\\ 62ICL=$$ 63CC=cl 64LINK=link 65BUILDLIB=lib 66ECHO=@echo 67MKDIR=mkdir 68MV=move 69CAT=type 70OBJ_EXT=obj 71EXE_EXT=.exe 72COPY=copy 73SHAREDLIB_EXT=dll 74SHAREDLIB_OUT=$(OUT_BIN) 75PACKAGE_LIB_DIR=windows.plt 76UNOPKG_PLATFORM=Windows 77 78OSEP=^< 79CSEP=^> 80QUOTE= 81QM= 82SQM= 83ECHOLINE=@echo. 84P2BG= 85 86DEL=del 87DELRECURSIVE=rd /S /Q 88URLPREFIX=file:/// 89 90SALLIB=isal.lib 91CPPULIB=icppu.lib 92CPPUHELPERLIB=icppuhelper.lib 93SALHELPERLIB=isalhelper.lib 94REGLIB=ireg.lib 95STORELIB=istore.lib 96 97BLANK= 98EMPTYSTRING= 99PATH_SEPARATOR=; 100 101# use this for release version 102CC_FLAGS_JNI=-c -MT -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa 103CC_FLAGS=-c -MT -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa 104ifeq "$(CPP_MANIFEST)" "true" 105#CC_FLAGS+=-EHa -Zc:wchar_t- 106LINK_MANIFEST=mt -manifest $@.manifest "-outputresource:$@;2" 107else 108#CC_FLAGS+= 109LINK_MANIFEST= 110endif 111ifeq "$(DEBUG)" "yes" 112CC_FLAGS_JNI+=-Zi 113CC_FLAGS+=-Zi 114endif 115 116CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include 117STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" 118SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/win32" 119 120# define for used compiler necessary for UNO 121# -DCPPU_ENV=msci -- windows msvc 4.x - 7.x 122 123CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci 124CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci 125CC_OUTPUT_SWITCH=-Fo 126 127LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL /DEBUGTYPE:cv 128COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) /DEF:$(PRJ)/settings/component.uno.def 129EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1b000000 /DEBUGTYPE:cv /NODEFAULTLIB msvcrt.lib msvcprt.lib kernel32.lib 130ifeq "$(DEBUG)" "yes" 131LIBRARY_LINK_FLAGS+=/DEBUG 132EXE_LINK_FLAGS+=/DEBUG 133endif 134 135LINK_JAVA_LIBS=/LIBPATH:"$(OO_SDK_JAVA_HOME)/lib" 136 137# use this for release version 138#EXE_LINK_FLAGS=/MAP /OPT:NOREF /SUBSYSTEM:CONSOLE /BASE:0x1100000 139#LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL 140endif 141 142 143 144########################################################################### 145# 146# Solaris specific settings 147# 148########################################################################### 149ifneq (,$(findstring solaris,$(PLATFORM))) 150# Settings for Solaris using Sun Workshop compiler 151 152PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)$(shell /usr/ccs/bin/elfdump -e "$(OFFICE_PROGRAM_PATH)/libuno_sal.so.3" | /usr/xpg4/bin/grep -q -w ELFCLASS64 && echo 64) 153 154ifeq "$(PROCTYPE)" "sparc" 155PLATFORM=solsparc 156PACKAGE_LIB_DIR=solaris_sparc.plt 157UNOPKG_PLATFORM=Solaris_SPARC 158JAVA_PROC_TYPE=sparc 159else 160ifeq "$(PROCTYPE)" "sparc64" 161PLATFORM=solsparc 162PACKAGE_LIB_DIR=solaris_sparc64.plt 163UNOPKG_PLATFORM=Solaris_SPARC64 164JAVA_PROC_TYPE=sparcv9 165else 166PLATFORM=solintel 167PACKAGE_LIB_DIR=solaris_x86.plt 168UNOPKG_PLATFORM=Solaris_x86 169JAVA_PROC_TYPE=i386 170endif 171endif 172 173OS=SOLARIS 174PS=/ 175ICL=\$$ 176CC=CC 177LINK=CC 178LIB=CC 179ECHO=@echo 180MKDIR=mkdir -p 181CAT=cat 182OBJ_EXT=o 183SHAREDLIB_EXT=so 184SHAREDLIB_PRE=lib 185SHAREDLIB_OUT=$(OUT_LIB) 186 187OSEP=\< 188CSEP=\> 189QUOTE=$(subst S,\,S) 190QM=\" 191SQM=' 192ECHOLINE=@echo 193P2BG=& 194 195DEL=rm -f 196DELRECURSIVE=rm -rf 197COPY=cp 198URLPREFIX=file:// 199 200# Include UDK version numbers 201include $(PRJ)/include/udkversion.mk 202 203SALLIB=-luno_sal 204CPPULIB=-luno_cppu 205CPPUHELPERLIB=-luno_cppuhelperC52 206SALHELPERLIB=-luno_salhelperC52 207REGLIB=-lreg 208STORELIB=-lstore 209 210EMPTYSTRING= 211PATH_SEPARATOR=: 212 213CC_FLAGS_JNI=-c -KPIC 214CC_FLAGS=-c -KPIC -xldscope=hidden 215ifeq "$(DEBUG)" "yes" 216CC_FLAGS_JNI+=-g 217CC_FLAGS+=-g 218endif 219CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include 220STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" 221SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/solaris" 222 223# define for used compiler necessary for UNO 224# -DCPPU_ENV=sunpro5 -- sunpro cc 5.x solaris sparc/intel 225 226CC_DEFINES_JNI=-DUNX -DSOLARIS -DCPPU_ENV=sunpro5 227CC_DEFINES=-DUNX -DSOLARIS -DSPARC -DCPPU_ENV=sunpro5 -DHAVE_GCC_VISIBILITY_FEATURE 228CC_OUTPUT_SWITCH=-o 229 230LIBRARY_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp '-R$$ORIGIN' -z text -norunpath -G -Bdirect -Bdynamic -lpthread -lCrun -lc -lm 231# means if used CC is lower then version 5.5 use option -instance=static 232ifeq ($(OO_SDK_CC_55_OR_HIGHER),) 233LIBRARY_LINK_FLAGS+=-instances=static 234endif 235#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -M $(PRJ)/settings/component.uno.map 236COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) 237 238EXE_LINK_FLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -Bdirect -z defs 239LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)" 240LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)" 241 242ifeq "$(PROCTYPE)" "sparc64" 243CC_FLAGS+=-m64 244LIBRARY_LINK_FLAGS+=-m64 245EXE_LINK_FLAGS+=-m64 246endif 247 248endif 249 250 251 252########################################################################### 253# 254# Linux specific settings 255# 256########################################################################### 257ifneq (,$(findstring linux,$(PLATFORM))) 258# Settings for Linux using gcc compiler 259 260PROCTYPE := $(shell $(PRJ)/config.guess | cut -d "-" -f1 | sed -e 's/^i.86$$/i386/') 261PLATFORM=linux 262 263PACKAGE_LIB_DIR=linux_$(PROCTYPE).plt 264UNOPKG_PLATFORM=Linux_$(PROCTYPE) 265JAVA_PROC_TYPE=$(PROCTYPE) 266 267ifeq "$(PROCTYPE)" "i386" 268PACKAGE_LIB_DIR=linux_x86.plt 269UNOPKG_PLATFORM=Linux_x86 270JAVA_PROC_TYPE=i386 271endif 272 273ifeq "$(PROCTYPE)" "powerpc" 274PACKAGE_LIB_DIR=linux_powerpc.plt 275UNOPKG_PLATFORM=Linux_PowerPC 276JAVA_PROC_TYPE=ppc 277endif 278 279ifeq "$(PROCTYPE)" "sparc" 280PACKAGE_LIB_DIR=linux_sparc.plt 281UNOPKG_PLATFORM=Linux_SPARC 282JAVA_PROC_TYPE=sparc 283endif 284 285ifeq "$(PROCTYPE)" "x86_64" 286JAVA_PROC_TYPE=amd64 287endif 288 289ifeq "$(PROCTYPE)" "powerpc64" 290JAVA_PROC_TYPE=ppc64 291endif 292 293OS=LINUX 294PS=/ 295ICL=\$$ 296CC=gcc 297LINK=g++ 298LIB=g++ 299ECHO=@echo 300MKDIR=mkdir -p 301CAT=cat 302OBJ_EXT=o 303SHAREDLIB_EXT=so 304SHAREDLIB_PRE=lib 305SHAREDLIB_OUT=$(OUT_LIB) 306 307GCC_VERSION=$(shell $(CC) -dumpversion) 308 309COMID=gcc3 310CPPU_ENV=gcc3 311 312OSEP=\< 313CSEP=\> 314QUOTE=$(subst S,\,S) 315QM=\" 316SQM=' 317ECHOLINE=@echo 318P2BG=& 319 320DEL=rm -f 321DELRECURSIVE=rm -rf 322COPY=cp 323URLPREFIX=file:// 324 325# Include UDK version numbers 326include $(PRJ)/include/udkversion.mk 327 328SALLIB=-luno_sal 329CPPULIB=-luno_cppu 330CPPUHELPERLIB=-luno_cppuhelper$(COMID) 331SALHELPERLIB=-luno_salhelper$(COMID) 332REGLIB=-lreg 333STORELIB=-lstore 334 335EMPTYSTRING= 336PATH_SEPARATOR=: 337 338CC_FLAGS_JNI=-c -fpic 339CC_FLAGS=-c -fpic -fvisibility=hidden 340# -O is necessary for inlining (see gcc documentation) 341ifeq "$(DEBUG)" "yes" 342CC_FLAGS_JNI+=-g 343CC_FLAGS+=-g 344else 345CC_FLAGS_JNI+=-O 346CC_FLAGS+=-O 347endif 348 349ifeq "$(PROCTYPE)" "ppc" 350CC_FLAGS+=-fPIC 351endif 352 353SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/linux" 354CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include 355STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" 356CC_DEFINES_JNI=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) 357CC_DEFINES=-DUNX -DGCC -DLINUX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE 358 359# define for used compiler necessary for UNO 360#-DCPPU_ENV=gcc2 -- gcc 2.91/2.95 361#-DCPPU_ENV=gcc3 -- gcc3 3.0 362 363CC_OUTPUT_SWITCH=-o 364 365LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN' 366 367ifeq "$(PROCTYPE)" "ppc" 368LIBRARY_LINK_FLAGS+=-fPIC 369endif 370#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map 371COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) 372 373#EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive 374EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined -Wl,-export-dynamic -Wl,-z,defs -Wl,--no-whole-archive 375LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)" 376LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)" 377 378endif 379 380########################################################################### 381# 382# MacOSX/Darwin specific settings 383# 384########################################################################### 385ifneq (,$(findstring darwin,$(PLATFORM))) 386# Settings for MacOSX using gcc 4.0.1 compiler 387 388PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1) 389 390# Default is MacOSX on a Intel machine 391PLATFORM=macosx 392 393ifeq "$(PROCTYPE)" "i386" 394PACKAGE_LIB_DIR=macosx_x86.plt 395UNOPKG_PLATFORM=MacOSX_x86 396JAVA_PROC_TYPE=x86 397else 398ifeq "$(PROCTYPE)" "x86_64" 399PACKAGE_LIB_DIR=macosx_x86.plt 400UNOPKG_PLATFORM=MacOSX_x86 401JAVA_PROC_TYPE=x86 402else 403PACKAGE_LIB_DIR=macosx_ppc.plt 404UNOPKG_PLATFORM=MacOSX_PowerPC 405JAVA_PROC_TYPE=ppc 406endif 407endif 408JAVABIN=Commands 409 410GCC_VERSION =$(shell gcc -dumpversion| cut -d"." -f1,2) 411ifeq "$(GCC_VERSION)" "4.2" 412GCC_ARCH_OPTION=-arch i386 413endif 414 415OS=MACOSX 416PS=/ 417ICL=\$$ 418CC=gcc-$(GCC_VERSION) 419LINK=g++-$(GCC_VERSION) 420LIB=g++-$(GCC_VERSION) 421ECHO=@echo 422MKDIR=mkdir -p 423CAT=cat 424OBJ_EXT=o 425SHAREDLIB_EXT=dylib 426SHAREDLIB_PRE=lib 427SHAREDLIB_OUT=$(OUT_LIB) 428 429COMID=gcc3 430CPPU_ENV=gcc3 431 432OSEP=\< 433CSEP=\> 434QUOTE=$(subst S,\,S) 435QM=\" 436SQM=' 437ECHOLINE=@echo 438P2BG=& 439 440DEL=rm -f 441DELRECURSIVE=rm -rf 442COPY=cp 443URLPREFIX=file:// 444 445# Include UDK version numbers 446include $(PRJ)/include/udkversion.mk 447 448SALLIB=-luno_sal 449CPPULIB=-luno_cppu 450CPPUHELPERLIB=-luno_cppuhelper$(COMID) 451SALHELPERLIB=-luno_salhelper$(COMID) 452REGLIB=-lreg 453STORELIB=-lstore 454 455SALDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_sal.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_sal.dylib' 456CPPUDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppu.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppu.dylib' 457CPPUHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_cppuhelper'$(COMID).dylib.3:$(OO_SDK_OFFICE_LIB_DIR)/libuno_cppuhelper$(COMID).dylib' 458SALHELPERDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libuno_salhelper$(COMID).dylib' 459REGDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libreg.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libreg.dylib' 460STOREDYLIB=-Wl,-dylib_file,@__________________________________________________URELIB/libstore.dylib.3:'$(OO_SDK_OFFICE_LIB_DIR)/libstore.dylib' 461 462INSTALL_NAME_URELIBS=install_name_tool -change @__________________________________________________URELIB/libuno_sal.dylib.3 @executable_path/libuno_sal.dylib.3 -change @__________________________________________________URELIB/libuno_cppu.dylib.3 @executable_path/libuno_cppu.dylib.3 -change @__________________________________________________URELIB/libuno_cppuhelper$(COMID).dylib.3 @executable_path/libuno_cppuhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libuno_salhelper$(COMID).dylib.3 @executable_path/libuno_salhelper$(COMID).dylib.3 -change @__________________________________________________URELIB/libreg.dylib.3 @executable_path/libreg.dylib.3 -change @__________________________________________________URELIB/libstore.dylib.3 @executable_path/libstore.dylib.3 463 464INSTALL_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 465 466EMPTYSTRING= 467PATH_SEPARATOR=: 468 469CC_FLAGS_JNI=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) 470CC_FLAGS=-malign-natural -c -fPIC -fno-common $(GCC_ARCH_OPTION) -fvisibility=hidden 471# -O is necessary for inlining (see gcc documentation) 472ifeq "$(DEBUG)" "yes" 473CC_FLAGS_JNI+=-g 474CC_FLAGS+=-g 475else 476CC_FLAGS_JNI+=-O 477CC_FLAGS+=-O 478endif 479 480SDK_JAVA_INCLUDES = -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers 481CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include 482STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" 483CC_DEFINES_JNI=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) 484CC_DEFINES=-DUNX -DGCC -DMACOSX -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE 485 486CC_OUTPUT_SWITCH=-o 487 488LIBRARY_LINK_FLAGS=-dynamiclib -single_module -Wl,-multiply_defined,suppress $(GCC_ARCH_OPTION) 489#-fPIC -fno-common 490 491# install_name '@executable_path$/(@:f)' 492#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,-exported_symbols_list $(COMP_MAPFILE) 493COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) 494 495EXE_LINK_FLAGS=$(GCC_ARCH_OPTION) -Wl,-multiply_defined,suppress 496LINK_LIBS=-L$(OUT)/lib -L$(OO_SDK_OUT)/$(PLATFORM)/lib -L"$(OO_SDK_OFFICE_LIB_DIR)" 497LINK_JAVA_LIBS=-framework JavaVM 498#LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/Libraries" 499 500endif 501 502########################################################################### 503# 504# FreeBSD specific settings 505# 506########################################################################### 507ifneq (,$(findstring freebsd,$(PLATFORM))) 508# Settings for FreeBSD using gcc compiler 509 510PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1) 511 512ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM))) 513PLATFORM=kfreebsd 514ifeq "$(PROCTYPE)" "x86_64" 515PACKAGE_LIB_DIR=kfreebsd_x86_64.plt 516UNOPKG_PLATFORM=kFreeBSD_x86_64 517else 518PACKAGE_LIB_DIR=kfreebsd_x86.plt 519UNOPKG_PLATFORM=kFreeBSD_x86 520endif 521else 522PLATFORM=freebsd 523ifeq "$(PROCTYPE)" "x86_64" 524PACKAGE_LIB_DIR=freebsd_x86_64.plt 525UNOPKG_PLATFORM=FreeBSD_x86_64 526else 527PACKAGE_LIB_DIR=freebsd_x86.plt 528UNOPKG_PLATFORM=FreeBSD_x86 529endif 530endif 531 532ifeq "$(PROCTYPE)" "x86_64" 533JAVA_PROC_TYPE=amd64 534else 535JAVA_PROC_TYPE=i386 536endif 537 538ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM))) 539OS=LINUX 540else 541OS=FREEBSD 542endif 543PS=/ 544ICL=\$$ 545CC=gcc 546LINK=g++ 547LIB=g++ 548ECHO=@echo 549MKDIR=mkdir -p 550CAT=cat 551OBJ_EXT=o 552SHAREDLIB_EXT=so 553SHAREDLIB_PRE=lib 554SHAREDLIB_OUT=$(OUT_LIB) 555 556GCC_VERSION=$(shell $(CC) -dumpversion) 557 558COMID=gcc3 559CPPU_ENV=gcc3 560 561OSEP=\< 562CSEP=\> 563QUOTE=$(subst S,\,S) 564QM=\" 565SQM=' 566ECHOLINE=@echo 567P2BG=& 568 569DEL=rm -f 570DELRECURSIVE=rm -rf 571COPY=cp 572URLPREFIX=file:// 573 574# Include UDK version numbers 575include $(PRJ)/include/udkversion.mk 576 577SALLIB=-luno_sal 578CPPULIB=-luno_cppu 579CPPUHELPERLIB=-luno_cppuhelper$(COMID) 580SALHELPERLIB=-luno_salhelper$(COMID) 581REGLIB=-lreg 582STORELIB=-lstore 583 584EMPTYSTRING= 585PATH_SEPARATOR=: 586 587CC_FLAGS_JNI=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) 588CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) -fvisibility=hidden 589# -O is necessary for inlining (see gcc documentation) 590ifeq "$(DEBUG)" "yes" 591CC_FLAGS_JNI+=-g 592CC_FLAGS+=-g 593else 594CC_FLAGS_JNI+=-O 595CC_FLAGS+=-O 596endif 597 598SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/include/freebsd" 599CC_INCLUDES=-I. -I$(OUT)/inc -I$(OUT)/inc/examples -I$(PRJ)/include 600STL_INCLUDES=-I"$(OO_SDK_HOME)/include/stl" 601CC_DEFINES_JNI=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) 602CC_DEFINES=-DUNX -DGCC -DFREEBSD -DCPPU_ENV=$(CPPU_ENV) -DGXX_INCLUDE_PATH=$(SDK_GXX_INCLUDE_PATH) -DHAVE_GCC_VISIBILITY_FEATURE 603 604CC_OUTPUT_SWITCH=-o 605 606LIBRARY_LINK_FLAGS=-shared '-Wl,-rpath,$$ORIGIN' 607#COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) -Wl,--version-script,$(PRJ)/settings/component.uno.map 608COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS) 609 610EXE_LINK_FLAGS=-Wl,--allow-shlib-undefined 611#EXE_LINK_FLAGS+=-Wl,-export-dynamic -Wl,-z,defs 612LINK_LIBS=-L"$(OUT)/lib" -L"$(OO_SDK_HOME)/lib" -L"$(OO_SDK_OFFICE_LIB_DIR)" $(PTHREAD_LIBS) 613LINK_JAVA_LIBS=-L"$(OO_SDK_JAVA_HOME)/jre/lib/$(JAVA_PROC_TYPE)" 614 615endif 616 617# add additional boost specific settings 618ifneq "$(OO_SDK_BOOST_HOME)" "" 619STL_INCLUDES+= -I"$(OO_SDK_BOOST_HOME)" 620endif 621 622# Add OSL_DEBUG_LEVEL to compiler the flags (for OSL_TRACE et. al.) 623ifeq "$(DEBUG)" "yes" 624CC_FLAGS += -DOSL_DEBUG_LEVEL=2 625endif 626