diff options
-rw-r--r-- | config_host.mk.in | 2 | ||||
-rw-r--r-- | configure.in | 89 | ||||
-rw-r--r-- | nss/makefile.mk | 16 | ||||
-rwxr-xr-x | solenv/bin/macosx-create-bundle | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/MACOSX_X86_64_GCC.mk | 35 | ||||
-rw-r--r-- | solenv/inc/unx.mk | 4 | ||||
-rw-r--r-- | solenv/inc/unxmacxx.mk | 48 | ||||
-rw-r--r-- | solenv/inc/wntmsc.mk | 12 |
8 files changed, 166 insertions, 42 deletions
diff --git a/config_host.mk.in b/config_host.mk.in index 913a24b379cb..b6d1ce97ddc3 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -51,7 +51,7 @@ export CDR_LIBS=@CDR_LIBS@ export CDR_TARBALL=@CDR_TARBALL@ export CHECK_PARALLELISM=@CHECK_PARALLELISM@ export CLASSPATH=@CLASSPATH@ -export CL_X64=@CL_X64@ +export BITNESS_OVERRIDE=@BITNESS_OVERRIDE@ export CLUCENE_CFLAGS=@CLUCENE_CFLAGS@ export CLUCENE_LIBS=@CLUCENE_LIBS@ export CLUCENE_TARBALL=@CLUCENE_TARBALL@ diff --git a/configure.in b/configure.in index f6f5c2440772..c719859f4589 100644 --- a/configure.in +++ b/configure.in @@ -1042,11 +1042,11 @@ AC_ARG_ENABLE(ccache, ]), ,) -AC_ARG_ENABLE(cl-x64, - AS_HELP_STRING([--enable-cl-x64], - [Build a 64-bit LibreOffice using the Microsoft C/C++ x64 - compiler. Incomplete and doesn't work, use only if you are - hacking on it.]), ,) +AC_ARG_ENABLE(64-bit, + AS_HELP_STRING([--enable-64-bit], + [Build a 64-bit LibreOffice on platforms where the normal and only supported build + is 32-bit. In other words, this option is experimental and possibly quite broken, + use only if you are hacking on 64-bit support.]), ,) AC_ARG_ENABLE(extra-gallery, AS_HELP_STRING([--enable-extra-gallery], @@ -2558,6 +2558,13 @@ dnl Check / find MacOSX SDK and compiler, version checks dnl =================================================================== if test "$_os" = "Darwin"; then + if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then + bitness=-m32 + else + bitness=-m64 + BITNESS_OVERRIDE=64 + fi + # If no --with-macosx-sdk option is given, first look for the 10.4u # SDK (which is distributed with the obsolete Xcode 3), then the # 10.6, 10.7 and 10.8 SDKs, in that order. (Don't bother looking @@ -2689,6 +2696,14 @@ if test "$_os" = "Darwin"; then ;; esac + if "$BITNESS_OVERRIDE" = 64; then + case $with_macosx_version_min_required in + 10.4|10.5) + AC_MSG_ERROR([Can't build 64-bit code for with-macosx-version-min-required=$with_macosx_version_min_required]) + ;; + esac + fi + case "$with_macosx_version_min_required" in 10.4) case "$with_macosx_sdk" in @@ -2732,12 +2747,12 @@ if test "$_os" = "Darwin"; then # Is similar logic as above needed? Is it likely somebody # has both an older Xcode with the 10.6 SDK and a current # Xcode? - CC="gcc-4.2 -m32 -mmacosx-version-min=$with_macosx_version_min_required" - CXX="g++-4.2 -m32 -mmacosx-version-min=$with_macosx_version_min_required" + CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required" + CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required" ;; 10.7|10.8) - CC="`xcrun -find clang` -m32 -mmacosx-version-min=$with_macosx_version_min_required" - CXX="`xcrun -find clang++` -m32 -mmacosx-version-min=$with_macosx_version_min_required" + CC="`xcrun -find clang` $bitness -mmacosx-version-min=$with_macosx_version_min_required" + CXX="`xcrun -find clang++` $bitness -mmacosx-version-min=$with_macosx_version_min_required" ;; esac AC_MSG_RESULT([$CC and $CXX]) @@ -2791,14 +2806,12 @@ dnl =================================================================== dnl Windows specific tests and stuff dnl =================================================================== if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then - dnl Set the CL_X64 variable if we are building a 64-bit LibreOffice. AC_MSG_CHECKING([whether to build a 64-bit LibreOffice]) - if test "$enable_cl_x64" = "" -o "$enable_cl_x64" = "no"; then - CL_X64="" + if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then AC_MSG_RESULT([no]) else - CL_X64="TRUE" AC_MSG_RESULT([yes]) + BITNESS_OVERRIDE=64 fi AC_MSG_CHECKING([whether to use DirectX]) @@ -2829,17 +2842,17 @@ if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then AC_MSG_RESULT([no]) fi else - CL_X64="" ENABLE_DIRECTX="" DISABLE_ACTIVEX="TRUE" DISABLE_ATL="TRUE" fi -AC_SUBST(CL_X64) AC_SUBST(ENABLE_DIRECTX) AC_SUBST(DISABLE_ACTIVEX) AC_SUBST(DISABLE_ATL) +AC_SUBST(BITNESS_OVERRIDE) + if test "$cross_compiling" = "yes"; then CROSS_COMPILING=YES SCPDEFS="$SCPDEFS -DCROSS_COMPILING" @@ -3027,7 +3040,7 @@ if test "$_os" = "WINNT"; then AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path]) if test -z "$with_cl_home"; then vctest=`./oowintool --msvc-productdir` - if test "$CL_X64" = ""; then + if test "$BITNESS_OVERRIDE" = ""; then if test -x "$vctest/bin/cl.exe"; then with_cl_home=$vctest fi @@ -3088,7 +3101,7 @@ if test "$_os" = "WINNT"; then AC_MSG_CHECKING([the Microsoft C/C++ Compiler]) if test -z "$CC"; then - if test "$CL_X64" = ""; then + if test "$BITNESS_OVERRIDE" = ""; then if test -x "$with_cl_home/bin/cl.exe"; then CC="$with_cl_home/bin/cl.exe" fi @@ -3108,7 +3121,7 @@ if test "$_os" = "WINNT"; then if test -n "$CC"; then # Remove /cl.exe from CC case insensitive AC_MSG_RESULT([found ($CC)]) - if test "$CL_X64" = ""; then + if test "$BITNESS_OVERRIDE" = ""; then COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'` else if test -n "$with_cl_home"; then @@ -3174,7 +3187,7 @@ if test "$_os" = "WINNT"; then LIBMGR_X64_BINARY= AC_MSG_CHECKING([for a x64 compiler and libraries for 64bit ActiveX component]) - if test "$CL_X64" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then + if test "$BITNESS_OVERRIDE" = "" -a -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then # Prefer native x64 compiler to cross-compiler, in case we are running # the build on a 64-bit OS. if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then @@ -3278,7 +3291,7 @@ cygwin*) case "$host_cpu" in i*86|x86_64) - if test "$CL_X64" != ""; then + if test "$BITNESS_OVERRIDE" = 64; then CPU=X CPUNAME=X86_64 RTL_ARCH=X86_64 @@ -3324,12 +3337,28 @@ darwin*) RTL_ARCH=PowerPC OUTPATH=unxmacxp ;; - i*86|x86_64) + i*86) + if test "$BITNESS_OVERRIDE" = 64; then + AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS]) + fi CPU=I CPUNAME=INTEL RTL_ARCH=x86 OUTPATH=unxmacxi ;; + x86_64) + if test "$BITNESS_OVERRIDE" = 64; then + CPU=X + CPUNAME=X86_64 + RTL_ARCH=X86_64 + OUTPATH=unxmacxx + else + CPU=I + CPUNAME=INTEL + RTL_ARCH=x86 + OUTPATH=unxmacxi + fi + ;; *) AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os]) ;; @@ -3603,7 +3632,7 @@ mingw*) case "$host_cpu" in i*86|x86_64) - if test "$CL_X64" != ""; then + if test "$BITNESS_OVERRIDE" = 64; then CPU=X CPUNAME=X86_64 RTL_ARCH=X86_84 @@ -4797,7 +4826,7 @@ else SIZEOF_INT=4 SIZEOF_LONG=4 SIZEOF_LONGLONG=8 - if test "$CL_X64" = ""; then + if test "$BITNESS_OVERRIDE" = ""; then SIZEOF_POINTER=4 else SIZEOF_POINTER=8 @@ -5547,7 +5576,7 @@ if test "$SOLAR_JAVA" != ""; then # Windows-specific tests if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then - if test "$CL_X64" != ""; then + if test "$BITNESS_OVERRIDE" = 64; then bitness="64-bit" otherbitness="32-bit" else @@ -5591,10 +5620,10 @@ if test "$SOLAR_JAVA" != ""; then # Why is this necessary, we don't link with any library from the JDK I think, shortjdkhome=`cygpath -d "$with_jdk_home"` - if test "$CL_X64" != "" -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then + if test "$BITNESS_OVERRIDE" = 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit]) AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK]) - elif test "$CL_X64" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then + elif test "$BITNESS_OVERRIDE" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit]) AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK]) fi @@ -9121,7 +9150,7 @@ dnl testing assembler path dnl *************************************** ML_EXE="" if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then - if test "$CL_X64" = ""; then + if test "$BITNESS_OVERRIDE" = ""; then assembler=ml.exe assembler_bin=bin else @@ -12245,7 +12274,7 @@ if test "$build_os" = "cygwin"; then if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then ILIB="$ILIB;$JAVA_HOME/lib" fi - if test "$CL_X64" = "TRUE"; then + if test "$BITNESS_OVERRIDE" = 64; then ILIB="$ILIB;$COMPATH/lib/amd64" ILIB="$ILIB;$WINDOWS_SDK_HOME/lib64" else @@ -12359,7 +12388,7 @@ if test "$build_os" = "cygwin"; then MFC_LIB="$COMPATH/atlmfc/lib" MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc" fi - if test "$CL_X64" = "YES"; then + if test "$BITNESS_OVERRIDE" = 64; then ATL_LIB="$ATL_LIB/amd64" MFC_LIB="$MFC_LIB/amd64" fi @@ -12439,7 +12468,7 @@ else pathmunge "$CSC_PATH" "before" pathmunge "$MIDL_PATH" "before" pathmunge "$MSPDB_PATH" "before" - if test "$CL_X64" = "TRUE"; then + if test "$BITNESS_OVERRIDE" = 64; then pathmunge "$COMPATH/bin/amd64" "before" else pathmunge "$COMPATH/bin" "before" diff --git a/nss/makefile.mk b/nss/makefile.mk index ecd7e2261b92..bff00b280947 100644 --- a/nss/makefile.mk +++ b/nss/makefile.mk @@ -84,16 +84,24 @@ CONFIGURE_ACTION=mozilla/nsprpub/configure --prefix=$(my_prefix) --includedir=$( # force 64-bit buildmode USE_64:=1 .EXPORT : USE_64 -.ENDIF # "$(CPUNAME)"=="X86_64" -.ENDIF # "$(OS)$(COM)"=="LINUXGCC" +.ENDIF +.ENDIF + +.IF "$(OS)$(COM)"=="MACOSXGCC" +.IF "$(BUILD64)"=="1" +# force 64-bit buildmode +USE_64:=1 +.EXPORT : USE_64 +.ENDIF +.ENDIF .IF "$(OS)$(COM)"=="FREEBSDGCC" .IF "$(CPUNAME)"=="X86_64" # force 64-bit buildmode USE_64:=1 .EXPORT : USE_64 -.ENDIF # "$(CPUNAME)"=="X86_64" -.ENDIF # "$(OS)$(COM)"=="LINUXGCC" +.ENDIF +.ENDIF .IF "$(OS)"=="MACOSX" MACOS_SDK_DIR:=$(MACOSX_SDK_PATH) diff --git a/solenv/bin/macosx-create-bundle b/solenv/bin/macosx-create-bundle index 2064e4d97565..a458e1413a6a 100755 --- a/solenv/bin/macosx-create-bundle +++ b/solenv/bin/macosx-create-bundle @@ -75,7 +75,7 @@ while [ $# != 0 ]; do # Do nothing as this step is obsolete : - elif printf "$filetype" | grep -q 'Mach-O dynamically linked shared library'; then + elif printf "$filetype" | grep -q 'dynamically linked shared library'; then # Screen out lib\w+static libraries as they are not used directly if ! printf "$inputfilename" | grep -q -x -E 'lib\w+static.*\.dylib'; then # Create jnilib link diff --git a/solenv/gbuild/platform/MACOSX_X86_64_GCC.mk b/solenv/gbuild/platform/MACOSX_X86_64_GCC.mk new file mode 100644 index 000000000000..fcf1f3a4e9a4 --- /dev/null +++ b/solenv/gbuild/platform/MACOSX_X86_64_GCC.mk @@ -0,0 +1,35 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Norbert Thiébaud <nthiebaud@gmail.com> +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Contributor(s): Norbert Thiébaud <nthiebaud@gmail.com> +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +# +#************************************************************************* + +gb_COMPILERDEFAULTOPTFLAGS := -O2 + +include $(GBUILDDIR)/platform/macosx.mk + +# vim: set noet sw=4 ts=4: diff --git a/solenv/inc/unx.mk b/solenv/inc/unx.mk index dc62a50b13f3..77bfae6e3321 100644 --- a/solenv/inc/unx.mk +++ b/solenv/inc/unx.mk @@ -123,6 +123,10 @@ .INCLUDE : unxmacxi.mk .ENDIF +.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXX" +.INCLUDE : unxmacxx.mk +.ENDIF + .IF "$(COM)$(OS)$(CPU)" == "GCCIOSR" .INCLUDE : unxiosr.mk .ENDIF diff --git a/solenv/inc/unxmacxx.mk b/solenv/inc/unxmacxx.mk new file mode 100644 index 000000000000..309f3f119be3 --- /dev/null +++ b/solenv/inc/unxmacxx.mk @@ -0,0 +1,48 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# +# Mac OS X/x86_64 specific defines +# + +PROCESSOR_DEFINES=-DX86_64 + +# special for SO build environment +.IF "$(SYSBASE)"!="" +.IF "$(EXTRA_CFLAGS)"!="" +CPP:=gcc -E $(EXTRA_CFLAGS) +CXXCPP*:=g++ -E $(EXTRA_CFLAGS) +.EXPORT : CPP CXXCPP +.ENDIF # "$(EXTRA_CFLAGS)"!="" +.ENDIF # "$(SYSBASE)"!="" + +# flags to enable build with symbols +CFLAGSENABLESYMBOLS=-g + +# Include generic Mac OS X makefile +.INCLUDE : unxmacx.mk +BUILD64=1 diff --git a/solenv/inc/wntmsc.mk b/solenv/inc/wntmsc.mk index ec84e985dfa6..4e8b7bea18c3 100644 --- a/solenv/inc/wntmsc.mk +++ b/solenv/inc/wntmsc.mk @@ -29,7 +29,7 @@ JAVAFLAGSDEBUG=-g -.IF "$(CL_X64)" == "" +.IF "$(BITNESS_OVERRIDE)" == "" ASM=ml AFLAGS=/c /Cp /coff /safeseh .ELSE @@ -89,7 +89,7 @@ CFLAGS+=-GS CFLAGS+=-c -nologo -Gs $(NOLOGO) -.IF "$(CL_X64)" == "" +.IF "$(BITNESS_OVERRIDE)" == "" CDEFS+= -D_X86_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS -D_SCL_SECURE_NO_WARNINGS .ELSE CDEFS+= -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS -D_SCL_SECURE_NO_WARNINGS @@ -119,7 +119,7 @@ CFLAGS+= -Z7 CFLAGSEXCEPTIONS=-EHa CFLAGS_NO_EXCEPTIONS= -.IF "$(CL_X64)" == "" +.IF "$(BITNESS_OVERRIDE)" == "" # enable boost support for __cdecl (SAL_CALL) C++-UNO interface methods CDEFS+=-DBOOST_MEM_FN_ENABLE_CDECL .ENDIF @@ -204,7 +204,7 @@ _VC_MANIFEST_BASENAME=__VC80 _VC_MANIFEST_BASENAME=__VC90 .ENDIF -.IF "$(CL_X64)" == "" +.IF "$(BITNESS_OVERRIDE)" == "" LINK=link /MACHINE:IX86 /IGNORE:4102 /IGNORE:4197 .ELSE LINK=link /MACHINE:X64 @@ -217,7 +217,7 @@ LINKFLAGS=/MAP /OPT:NOREF .ENDIF # excetion handling protection -.IF "$(CL_X64)" == "" +.IF "$(BITNESS_OVERRIDE)" == "" LINKFLAGS+=-safeseh .ENDIF @@ -301,7 +301,7 @@ LIBMGR=lib $(NOLOGO) IMPLIB=lib LIBFLAGS= -.IF "$(CL_X64)" == "" +.IF "$(BITNESS_OVERRIDE)" == "" IMPLIBFLAGS=-machine:IX86 .ELSE IMPLIBFLAGS=-machine:X64 |