summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-12-28 20:23:02 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-12-29 09:58:09 +0100
commit648f24f5d1dae3f0fd5b132d68a5e39066f2572d (patch)
tree68a56efb90d57d8e33af2a190d09fbd1f570e413 /solenv
parentc3c2ac6afad6b154d83dbe555f5b276e5909718b (diff)
tdf#114635: reimplement TWAIN-based scan using 32-bit shim on Windows
Since TWAIN is only actually available as 32-bit component on Windows, to use it in a 64-bit program, we need a 32-bit shim program that does all actual communication with TWAIN subsystem. This change reimplements TWAIN implementation to be a separate 32-bit process. Image is transfered from the shim to main program using file mapping API. This reverts most of commit 585d9806961342e95f7318fb947bd31e9f86dee0. 64-bit LibreOffice doesn't bundle TWAIN DSM library now. TWAIN DSM source code is still used for TWAIN headers. Change-Id: I46f178ad36acd97a9eff156624b99036fcbb83f8 Reviewed-on: https://gerrit.libreoffice.org/65688 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/Executable.mk1
-rw-r--r--solenv/gbuild/LinkTarget.mk8
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk14
3 files changed, 20 insertions, 3 deletions
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 8e955cc0ac79..c2285f05ac04 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -120,6 +120,7 @@ gb_Executable_add_defs = $(call gb_Executable__forward_to_Linktarget,$(subst gb_
gb_Executable_set_include = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
gb_Executable_add_ldflags = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
gb_Executable_set_ldflags = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
+gb_Executable_set_x86 = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
gb_Executable_add_libs = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
gb_Executable_disable_standard_system_libs = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
gb_Executable_use_system_darwin_frameworks = $(call gb_Executable__forward_to_Linktarget,$(subst gb_Executable_,,$(0)),$(1),$(2),$(3))
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index bc6d3610daf6..96be7ad5f01c 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -711,6 +711,7 @@ $(WORKDIR)/Headers/% :
# - TARGETTYPE is the type of linktarget as some platforms need very different
# command to link different targettypes.
# - LIBRARY_X64 is only relevant for building a x64 library on windows.
+# - PE_X86 is only relevant for building a x86 binaries on Windows.
#
# Since most variables are set on the linktarget and not on the object, the
# object learns about these setting via GNU makes scoping of target variables.
@@ -780,6 +781,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PCH_NAME :=
$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS :=
$(call gb_LinkTarget_get_target,$(1)) : PCHOBJEX :=
$(call gb_LinkTarget_get_target,$(1)) : PCHOBJNOEX :=
+$(call gb_LinkTarget_get_target,$(1)) : PE_X86 :=
$(call gb_LinkTarget_get_target,$(1)) : PDBFILE :=
$(call gb_LinkTarget_get_target,$(1)) : TARGETGUI :=
$(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS :=
@@ -1435,6 +1437,12 @@ $(call gb_LinkTarget_get_target,$(1)) : LIBRARY_X64 := $(2)
endef
+# call gb_LinkTarget_set_x86,linktarget,boolean
+define gb_LinkTarget_set_x86
+$(call gb_LinkTarget_get_target,$(1)) : PE_X86 := $(2)
+
+endef
+
# call gb_LinkTarget_set_ilibtarget,linktarget,ilibfilename
define gb_LinkTarget_set_ilibtarget
$(call gb_LinkTarget_get_clean_target,$(1)) \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 18db567bfc50..333c8b4d80bc 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -40,9 +40,10 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
unset INCLUDE && \
$(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \
- $(if $(filter %.c,$(3)), $(gb_CC), \
- $(if $(filter -clr,$(2)), \
- $(MSVC_CXX) -I$(SRCDIR)/solenv/clang-cl,$(gb_CXX)))) \
+ $(if $(filter YES,$(PE_X86)), $(CXX_X86_BINARY), \
+ $(if $(filter %.c,$(3)), $(gb_CC), \
+ $(if $(filter -clr,$(2)), \
+ $(MSVC_CXX) -I$(SRCDIR)/solenv/clang-cl,$(gb_CXX))))) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(2) \
@@ -57,6 +58,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(COMPILER_TEST),,$(gb_COMPILERDEPFLAGS)) \
$(INCLUDE) \
$(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \
+ $(if $(filter YES,$(PE_X86)), -D_X86_ -U_AMD64_,) \
-c $(3) \
-Fo$(1)) $(if $(filter $(true),$(gb_SYMBOL)),/link /DEBUG:FASTLINK) \
$(if $(COMPILER_TEST),,$(call gb_create_deps,$(4),$(1),$(3)))
@@ -172,11 +174,17 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
$(if $(filter YES,$(LIBRARY_X64)),,$(if $(filter YES,$(TARGETGUI)), -SUBSYSTEM:WINDOWS$(MSC_SUBSYSTEM_VERSION), -SUBSYSTEM:CONSOLE$(MSC_SUBSYSTEM_VERSION))) \
$(if $(filter YES,$(LIBRARY_X64)), -MACHINE:X64) \
+ $(if $(filter YES,$(PE_X86)), -MACHINE:X86) \
$(if $(filter YES,$(LIBRARY_X64)), \
-LIBPATH:$(COMPATH)/lib/$(if $(filter 140,$(VCVER)),amd64,x64) \
-LIBPATH:$(WINDOWS_SDK_HOME)/lib/x64 \
-LIBPATH:$(UCRTSDKDIR)lib/$(UCRTVERSION)/ucrt/x64 \
$(if $(filter 80 81 10,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/um/x64)) \
+ $(if $(filter YES,$(PE_X86)), \
+ -LIBPATH:$(COMPATH)/lib/x86 \
+ -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x86 \
+ -LIBPATH:$(UCRTSDKDIR)lib/$(UCRTVERSION)/ucrt/x86 \
+ $(if $(filter 80 81 10,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/um/x86)) \
$(T_LDFLAGS) \
$(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),/NATVIS:$(SRCDIR)/solenv/vs/LibreOffice.natvis) \
@$${RESPONSEFILE} \