summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-05-11 12:25:50 +0300
committerTor Lillqvist <tlillqvist@novell.com>2011-05-11 12:33:32 +0300
commit289a4c810a8e97dd73f1910ae1b0562b02909809 (patch)
tree39cca2b93b255c7051642274612135bc64ef2c26
parentec002f7558d774ea33c96b1f38bd3617c45dd24f (diff)
Fix building of the 64-bit Windows Explorer extension, fdo#36950
Don't confuse the 64-bit Explorer extension with a 64-bit LibreOffice, which is unfinished and highly experimental work. OOo has been building and distributing a 64-bit Explorer extension since long, and we should too. They used some secret Hamburg sauce when building it, though, but hopefully now it works here, too.
-rwxr-xr-xconfigure.in55
-rwxr-xr-xset_soenv.in11
-rw-r--r--solenv/inc/set_wntx64.mk4
3 files changed, 63 insertions, 7 deletions
diff --git a/configure.in b/configure.in
index ed7cec383..02f2bdabe 100755
--- a/configure.in
+++ b/configure.in
@@ -449,7 +449,7 @@ AC_ARG_ENABLE(zenity,
AC_ARG_ENABLE(cl-x64,
AS_HELP_STRING([--enable-cl-x64],
- [Use the Microsoft C/C++ x64 compiler instead of the default x86 one.]),
+ [Build a 64-bit LibreOffice using the Microsoft C/C++ x64 compiler.]),
,)
AC_ARG_ENABLE(extra-gallery,
@@ -1556,8 +1556,8 @@ if test "$_os" = "WINNT"; then
dnl Include twain scanners
BUILD_TYPE="$BUILD_TYPE TWAIN"
- dnl Set the CL_X64 variable.
- AC_MSG_CHECKING([whether to use the Microsoft C/C++ x64 compiler])
+ 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 "z$enable_cl_x64" = "z" -o "$enable_cl_x64" = "no"; then
CL_X64=""
AC_MSG_RESULT([no])
@@ -2189,7 +2189,7 @@ if test "$_os" = "WINNT"; then
AC_PATH_PROG(CC, cl.exe)
fi
- if test -e "$CC"; then
+ if test -e "$CC"; then
# This gives us a posix path with 8.3 filename restrictions
CC=`cygpath -d "$CC"`
CC=`cygpath -u "$CC"`
@@ -2205,7 +2205,7 @@ if test "$_os" = "WINNT"; then
export INCLUDE=`cygpath -d "$COMPATH/Include"`
dnl Check which Microsoft C/C++ compiler is found
AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
-dnl The following find microsoft, matches nn.nn.nnnn then pulls numbers out.
+ # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
x = match( \\\$0, /..\\...\\...../ )
CCversion = substr( \\\$0, RSTART, RLENGTH)
@@ -2227,6 +2227,51 @@ dnl The following find microsoft, matches nn.nn.nnnn then pulls numbers out
else
AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
fi
+
+ # Check for 64-bit (cross-)compiler to use to build the 64-bit
+ # version of the Explorer extension (and maybe other small
+ # bits, too) needed when installing a 32-bit LibreOffice on a
+ # 64-bit OS. The 64-bit Explorer extension is a feature that
+ # has been present since long in OOo. Don't confuse it with
+ # building LibreOffice itself as 64-bit code, which is
+ # unfished work and highly experimental.
+
+ AC_MSG_CHECKING([for a x64 compiler])
+ BUILD_X64=
+ CC_X64_BINARY=
+ LINK_X64_BINARY=
+ LIBMGR_X64_BINARY=
+
+ # 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
+ BUILD_X64=TRUE
+ CC_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
+ CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
+ LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
+ LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
+ elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
+ BUILD_X64=TRUE
+ CC_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
+ CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
+ LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
+ LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
+ fi
+ if test "$BUILD_X64" = TRUE; then
+ AC_MSG_RESULT([found])
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_WARN([Installation set will not contain the 64-bit Explorer extension])
+ fi
+ AC_SUBST(BUILD_X64)
+
+ # These are passed to the environment through set_soenv.in as usual, and then
+ # used in set_wntx64.mk
+ AC_SUBST(CC_X64_BINARY)
+ AC_SUBST(CXX_X64_BINARY)
+ AC_SUBST(LINK_X64_BINARY)
+ AC_SUBST(LIBMGR_X64_BINARY)
+
else
AC_MSG_CHECKING([the MinGW C++ Compiler])
if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then
diff --git a/set_soenv.in b/set_soenv.in
index c7b6b799e..a517aeb83 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1661,6 +1661,17 @@ if ( $platform =~ m/cygwin/ )
ToFile( "DISABLE_ACTIVEX", "@DISABLE_ACTIVEX@","e" );
ToFile( "DISABLE_ATL", "@DISABLE_ATL@","e" );
ToFile( "USE_NEW_SDK", $USE_NEW_SDK, "e" );
+ # Variables used when building the parts that needs to be available
+ # also as 64-bit versions in a 32-bit LibreOffice build, like
+ # the Explorer extension. If the configure script hasn't
+ # found the 64-bit (cross-)compiler, then @BUILD_X64@ will be empty.
+ ToFile( "BUILD_X64", "@BUILD_X64@", "e" );
+ if ( "@BUILD_X64@" eq "TRUE" ) {
+ ToFile( "CC_X64_BINARY", "@CC_X64_BINARY@", "e" );
+ ToFile( "CXX_X64_BINARY","@CXX_X64_BINARY@", "e" );
+ ToFile( "LINK_X64_BINARY","@LINK_X64_BINARY@","e" );
+ ToFile( "LIBMGR_X64_BINARY","@LIBMGR_X64_BINARY@","e" );
+ }
# Hack around dmake's mktmp not generating DOS paths.
my $tmpdir = qx{cygpath -m "/tmp"};
diff --git a/solenv/inc/set_wntx64.mk b/solenv/inc/set_wntx64.mk
index 0cad0a3a7..bf30d63c2 100644
--- a/solenv/inc/set_wntx64.mk
+++ b/solenv/inc/set_wntx64.mk
@@ -46,7 +46,7 @@ USE_CFLAGS_X64=-c -nologo -Gs $(NOLOGO) -Zm500 -Zc:forScope,wchar_t- -GR
# Stack buffer overrun detection.
CFLAGS+=-GS
-USE_CDEFS_X64+= -DWIN32 -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS
+USE_CDEFS_X64+= -D$(OS) -D$(GUI) -D$(GVER) -D$(COM) -DX86_64 -DWIN32 -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS
.IF "$(debug)"!=""
USE_CFLAGS_X64+=-Zi -Fd$(MISC_X64)/$(@:b).pdb
USE_CDEFS_X64+=-DDEBUG
@@ -114,7 +114,7 @@ STDSLOCUI_X64=
IMPLIBFLAGS_X64=-machine:X64
-LIBPATH_X64=$(PSDK)/lib/x64
+LIBPATH_X64=$(PSDK_HOME)/lib/x64
LIBPATH_VC_X64=$(COMPATH)/lib/amd64
ADVAPI32LIB_X64=$(LIBPATH_X64)/advapi32.lib