summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-20 17:21:14 +0100
committerMichael Stahl <mstahl@redhat.com>2014-01-31 10:59:03 +0000
commit54eb449459db74634695c1a986e973f97adc6ab6 (patch)
tree19b052eda6b813ad93b9b789d04e204a6d0b4294 /odk
parent60c3bcff81dcebc1f4b9f00407ed021f28db0fd6 (diff)
SDK settings.mk: Don't guess PLATFORM/PROCTYPE, and fix Mac OS X 64 bit
...rather, pass them from the build to the SDK installation via dk.mk. (The SDK installation is already platform-specific anyway, see the binary executables in its bin/ directory, so there is no point in not fixing this at build time. In the future, the shipped settings.mk could of course be stripped to just the parts relevant for a given platform, of course.) Along the way, fixes some apparent "ppc" vs. "powerpc" typos in settings.mk. Cherry picked from commit dea0398ee24eb278cdb14999efbf34d634454eaa "SDK settings.mk: Don't guess PLATFORM/PROCTYPE" plus e5ad31e2f784856506c28092166dc8704c84e868 "Fix Mac OS X 64 bit SDK settings.mk" and b3db695a338f1acddbe46102138a0167fc346f58 "SDK: Split PLATFORMID at build time rather than runtime" fix. Conflicts: odk/settings/settings.mk Change-Id: Ib8e0c03ad6dfd610aae58a61e32bdc61c785584f Reviewed-on: https://gerrit.libreoffice.org/7748 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'odk')
-rw-r--r--odk/CustomTarget_settings.mk5
-rw-r--r--odk/settings/dk.mk3
-rw-r--r--odk/settings/settings.mk48
3 files changed, 22 insertions, 34 deletions
diff --git a/odk/CustomTarget_settings.mk b/odk/CustomTarget_settings.mk
index 2a0d6e402a7c..c48a734623c9 100644
--- a/odk/CustomTarget_settings.mk
+++ b/odk/CustomTarget_settings.mk
@@ -13,7 +13,10 @@ $(eval $(call gb_CustomTarget_register_target,odk/settings,dk.mk))
$(call gb_CustomTarget_get_workdir,odk/settings)/dk.mk : $(SRCDIR)/odk/settings/dk.mk
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,SED,1)
- tr -d "\015" < $< | sed -e 's/@@RELEASE@@/$(PRODUCTVERSION)/' \
+ tr -d "\015" < $< | sed \
+ -e 's/@@PLATFORM@@/$(firstword $(subst _, ,$(PLATFORMID)))/' \
+ -e 's/@@PROCTYPE@@/$(subst $(WHITESPACE),_,$(wordlist 2,$(words $(subst _, ,$(PLATFORMID))),$(subst _, ,$(PLATFORMID))))/' \
+ -e 's/@@RELEASE@@/$(PRODUCTVERSION)/' \
-e 's/@@BUILDID@@/$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)/' \
-e 's/@@ENABLE_DBGUTIL@@/$(ENABLE_DBGUTIL)/' > $@
diff --git a/odk/settings/dk.mk b/odk/settings/dk.mk
index 387ef1394f85..8f41b7e1b35a 100644
--- a/odk/settings/dk.mk
+++ b/odk/settings/dk.mk
@@ -1,4 +1,5 @@
-# OpenOffice.org @@RELEASE@@ SDK dependent settings
+PLATFORM=@@PLATFORM@@
+PROCTYPE=@@PROCTYPE@@
SDKVERSION=@@RELEASE@@
BUILDID=@@BUILDID@@
LIBO_SDK_ENABLE_DBGUTIL=@@ENABLE_DBGUTIL@@
diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk
index b884e75c4e0e..0d14ad41ac5e 100644
--- a/odk/settings/settings.mk
+++ b/odk/settings/settings.mk
@@ -21,14 +21,6 @@
include $(OO_SDK_HOME)/settings/dk.mk
-# test for the platform
-PLATFORM := $(shell $(PRJ)/config.guess | cut -d"-" -f3,4)
-
-# config.guess is missing for windows. We rely on getting "" in this case.
-ifeq "$(PLATFORM)" ""
-PLATFORM = windows
-endif
-
# debug option, default is no debug
DEBUG=no
ifeq "$(MAKECMDGOALS)" "debug"
@@ -153,11 +145,9 @@ endif
# Solaris specific settings
#
###########################################################################
-ifneq (,$(findstring solaris,$(PLATFORM)))
+ifeq "$(PLATFORM)" "solaris"
# Settings for Solaris using Sun Workshop compiler
-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)
-
ifeq "$(PROCTYPE)" "sparc"
PLATFORM=solsparc
UNOPKG_PLATFORM=Solaris_SPARC
@@ -269,17 +259,13 @@ endif
# Linux specific settings
#
###########################################################################
-ifneq (,$(findstring linux,$(PLATFORM)))
+ifeq "$(PLATFORM)" "linux"
# Settings for Linux using gcc compiler
-PROCTYPE := $(shell $(PRJ)/config.guess | cut -d "-" -f1 | sed -e 's/^i.86$$/i386/')
-PLATFORM=linux
-
UNOPKG_PLATFORM=Linux_$(PROCTYPE)
JAVA_PROC_TYPE=$(PROCTYPE)
-ifeq "$(PROCTYPE)" "i386"
-UNOPKG_PLATFORM=Linux_x86
+ifeq "$(PROCTYPE)" "x86"
JAVA_PROC_TYPE=i386
endif
@@ -290,7 +276,6 @@ endif
ifeq "$(PROCTYPE)" "sparc"
UNOPKG_PLATFORM=Linux_SPARC
-JAVA_PROC_TYPE=sparc
endif
ifeq "$(PROCTYPE)" "x86_64"
@@ -351,7 +336,7 @@ endif
CC_FLAGS_JNI=-c -fpic $(OPT_FLAGS)
CC_FLAGS=-c -fpic -fvisibility=hidden $(OPT_FLAGS)
-ifeq "$(PROCTYPE)" "ppc"
+ifeq "$(PROCTYPE)" "powerpc"
CC_FLAGS+=-fPIC
endif
@@ -366,7 +351,7 @@ LIBO_SDK_LDFLAGS_STDLIBS =
LIBRARY_LINK_FLAGS=-shared -Wl,-z,origin '-Wl,-rpath,$$ORIGIN'
-ifeq "$(PROCTYPE)" "ppc"
+ifeq "$(PROCTYPE)" "powerpc"
LIBRARY_LINK_FLAGS+=-fPIC
endif
COMP_LINK_FLAGS=$(LIBRARY_LINK_FLAGS)
@@ -386,36 +371,37 @@ endif
# MacOSX/Darwin specific settings
#
###########################################################################
-ifneq (,$(findstring darwin,$(PLATFORM)))
+ifeq "$(PLATFORM)" "macosx"
# Settings for MacOSX using gcc 4.0.1 compiler
-PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
-
-# Default is MacOSX on a Intel machine
-PLATFORM=macosx
-
-ifeq "$(PROCTYPE)" "i386"
+ifeq "$(PROCTYPE)" "x86"
UNOPKG_PLATFORM=MacOSX_x86
-JAVA_PROC_TYPE=x86
else
ifeq "$(PROCTYPE)" "x86_64"
-UNOPKG_PLATFORM=MacOSX_x86
-JAVA_PROC_TYPE=x86
+UNOPKG_PLATFORM=MacOSX_x86_64
endif
endif
JAVABIN=Commands
+ifeq "$(PROCTYPE)" "x86"
GCC_VERSION =$(shell gcc -dumpversion| cut -d"." -f1,2)
ifeq "$(GCC_VERSION)" "4.2"
GCC_ARCH_OPTION=-arch i386
endif
+endif
OS=MACOSX
PS=/
ICL=\$$
+ifeq "$(PROCTYPE)" "x86"
CC=gcc-$(GCC_VERSION)
LINK=g++-$(GCC_VERSION)
LIB=g++-$(GCC_VERSION)
+else
+CC=clang++
+LINK=clang++
+LIB=clang++
+endif
ECHO=@echo
MKDIR=mkdir -p
CAT=cat
@@ -494,8 +480,6 @@ endif
ifneq (,$(findstring freebsd,$(PLATFORM)))
# Settings for FreeBSD using gcc compiler
-PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1)
-
ifeq (kfreebsd,$(findstring kfreebsd,$(PLATFORM)))
PLATFORM=kfreebsd
ifeq "$(PROCTYPE)" "x86_64"