Files
loongoffice/odk/settings/std.mk
Stephan Bergmann 0124111394 Replace unowinreg.dll with execution of reg QUERY
The SDK's <https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/
Transparent_Use_of_Office_UNO_Components> on all platforms included the Windows-
specific unowinreg.dll in generated jars (so that those jars, when distributed
to a Windows environment, would find a LO installation by inspecting the Windows
registry).  That unowinreg.dll was originally built as a 32-bit DLL (though when
building a 64-bit Windows LO, it happened to be built as a 64-bit DLL).  For
non-Windows LO builds, it could either be built locally with a MinGW toolchain
(--enable-build-unowinreg) or downloaded from dev-www.libreoffice.org.

However, that had various issues:

For one, unowinreg.dll was not necessarily available in a distributed jar as a
64-bit DLL for use with a 64-bit JRE on Windows.  (Theoretically, running such a
jar with a 32-bit JRE to access a 64-bit LO installation's URE jars could have
worked.  But practically, those URE jars in turn require native DLLs, which
would then not have been available as 32-bit DLLs for use in the 32-bit JRE.)

For another, at least the unowinreg.dll resulting from --enable-build-unowinreg
on Fedora 33 would have had a dependency on libgcc_s_dw2-1.dll that would
generally not have been available in a target Windows environment.

There appears to be no pure Java way to read the Windows registry, but instead
of using a native code DLL for that, it appears to work just as well to call out
to reg.exe and parse its output.

This removes the --enable-build-unowinreg and --with-mingw-cross-compiler
configuration options.  (The sole use of the MinGW toolchain in LO was for
building unowinreg.dll.)

Change-Id: I3283ea38c884d3221a205e5ab6ec99a2691ef474
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107140
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2020-12-03 15:01:00 +01:00

98 lines
2.9 KiB
Makefile

#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
#
ifneq "$(OO_SDK_OUT)" ""
OUT=$(subst \,/,$(OO_SDK_OUT))/$(OS)example.out
else
OUT=$(PRJ)/$(OS)example.out
endif
UNOPKG_EXT=uno.pkg
UNOOXT_EXT=oxt
OUT_BIN=$(OUT)/bin
OUT_INC=$(OUT)/inc
OUT_SLO=$(OUT)/slo
OUT_LIB=$(OUT)/lib
OUT_SLB=$(OUT)/slb
OUT_MISC=$(OUT)/misc
OUT_OBJ=$(OUT)/obj
OUT_CLASS=$(OUT)/class
IDL_DIR=$(PRJ)/idl
BIN_DIR=$(PRJ)/bin
CLASSES_DIR=$(PRJ)/classes
URE_CLASSES_DIR=$(subst \,/,$(OO_SDK_URE_JAVA_DIR))
ifeq "$(PLATFORM)" "macosx"
OFFICE_CLASSES_DIR=$(subst \,/,$(OFFICE_PROGRAM_PATH))/../Resources/java
else
OFFICE_CLASSES_DIR=$(subst \,/,$(OFFICE_PROGRAM_PATH))/classes
endif
COMP_PACKAGE_DIR=$(subst /,$(PS),$(OUT_BIN))
SDKTYPEFLAG=$(OUT_MISC)/oosdk_cpp_types.flag
URE_TYPES="$(subst \,/,$(URE_MISC)$(PS)types.rdb)"
URE_SERVICES="$(subst \\,\,$(URE_MISC)$(PS)services.rdb)"
ifeq "$(PLATFORM)" "macosx"
OFFICE_TYPES="$(subst \,/,$(OFFICE_PROGRAM_PATH)$(PS)..$(PS)Resources$(PS)types$(PS)offapi.rdb)"
OFFICE_SERVICES="$(subst \\,\,$(OFFICE_PROGRAM_PATH)$(PS)..$(PS)Resources$(PS)services$(PS)services.rdb)"
else
OFFICE_TYPES="$(subst \,/,$(OFFICE_PROGRAM_PATH)$(PS)types$(PS)offapi.rdb)"
OFFICE_SERVICES="$(subst \\,\,$(OFFICE_PROGRAM_PATH)$(PS)services$(PS)services.rdb)"
endif
OFFICE_TYPE_LIBRARY="$(OFFICE_TYPES)"
JAVA_OPTIONS=
ifneq "$(OO_SDK_JAVA_HOME)" ""
JAVA_BITS := $(shell $(OO_SDK_JAVA_HOME)/bin/java -version 2>&1 | tail -1 | cut -d " " -f3)
ifeq "$(JAVA_BITS)" "64-Bit"
ifneq "$(PROCTYPE)" "x86_64"
JAVA_OPTIONS=-d32
endif
endif
endif
DEPLOYTOOL="$(OFFICE_PROGRAM_PATH)$(PS)unopkg" add -f
SDK_JAVA="$(OO_SDK_JAVA_HOME)/bin/java" $(JAVA_OPTIONS)
SDK_JAVAC="$(OO_SDK_JAVA_HOME)/bin/javac"
SDK_JAR="$(OO_SDK_JAVA_HOME)/bin/jar"
ifneq "$(OO_SDK_ZIP_HOME)" ""
SDK_ZIP="$(OO_SDK_ZIP_HOME)/zip"
else
SDK_ZIP=zip
endif
ifneq "$(OO_SDK_CAT_HOME)" ""
SDK_CAT="$(OO_SDK_CAT_HOME)/cat"
else
SDK_CAT=cat
endif
ifneq "$(OO_SDK_SED_HOME)" ""
SDK_SED="$(OO_SDK_SED_HOME)/sed"
else
SDK_SED=sed
endif
IDLC="$(OO_SDK_HOME)/bin/idlc"
CPPUMAKER="$(OO_SDK_HOME)/bin/cppumaker"
JAVAMAKER="$(OO_SDK_HOME)/bin/javamaker"
REGMERGE="$(OO_SDK_URE_BIN_DIR)/regmerge"
SDK_JAVA_UNO_BOOTSTRAP_FILES=\
-C $(CLASSES_DIR) $(SQM)com/sun/star/lib/loader/$(SQM)