From dc81065d44ec24a87fe590b38f1e846233f5fa9a Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Wed, 11 Mar 2009 16:38:57 +0100
Subject: [PATCH] ole32: Make ole2thk.dll into a stand-alone 16-bit module.

---
 .gitignore                                          |  1 -
 configure                                           | 10 ++++++++++
 configure.ac                                        |  2 ++
 dlls/Makefile.in                                    |  3 +--
 dlls/ole2thk.dll16/Makefile.in                      | 13 +++++++++++++
 .../ole2thk.dll16.spec}                             |  0
 dlls/ole32/Makefile.in                              |  1 -
 7 files changed, 26 insertions(+), 4 deletions(-)
 create mode 100644 dlls/ole2thk.dll16/Makefile.in
 rename dlls/{ole32/ole2thk.spec => ole2thk.dll16/ole2thk.dll16.spec} (100%)

diff --git a/.gitignore b/.gitignore
index 3cdca215293..cffe7f52770 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,7 +62,6 @@ dlls/msxml3/msxml3_v1.tlb
 dlls/ole2.dll16
 dlls/ole2disp.dll16
 dlls/ole2nls.dll16
-dlls/ole2thk.dll16
 dlls/ole32/dcom.h
 dlls/ole32/dcom_p.c
 dlls/ole32/irot.h
diff --git a/configure b/configure
index eb429c4b005..3db54ea4525 100755
--- a/configure
+++ b/configure
@@ -3913,6 +3913,7 @@ then
     enable_msacm_dll16=${enable_msacm_dll16:-no}
     enable_ole2conv_dll16=${enable_ole2conv_dll16:-no}
     enable_ole2prox_dll16=${enable_ole2prox_dll16:-no}
+    enable_ole2thk_dll16=${enable_ole2thk_dll16:-no}
     enable_olecli_dll16=${enable_olecli_dll16:-no}
     enable_olesvr_dll16=${enable_olesvr_dll16:-no}
     enable_stress_dll16=${enable_stress_dll16:-no}
@@ -26492,6 +26493,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 dlls/ole2prox.dll16/Makefile: dlls/ole2prox.dll16/Makefile.in dlls/Makedll.rules"
 ac_config_files="$ac_config_files dlls/ole2prox.dll16/Makefile"
 
+ALL_MAKEFILES="$ALL_MAKEFILES \\
+	dlls/ole2thk.dll16/Makefile"
+test "x$enable_ole2thk_dll16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
+	ole2thk.dll16"
+ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
+dlls/ole2thk.dll16/Makefile: dlls/ole2thk.dll16/Makefile.in dlls/Makedll.rules"
+ac_config_files="$ac_config_files dlls/ole2thk.dll16/Makefile"
+
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	dlls/ole32/Makefile"
 test "x$enable_ole32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@@ -29201,6 +29210,7 @@ do
     "dlls/odbccp32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/tests/Makefile" ;;
     "dlls/ole2conv.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2conv.dll16/Makefile" ;;
     "dlls/ole2prox.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2prox.dll16/Makefile" ;;
+    "dlls/ole2thk.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2thk.dll16/Makefile" ;;
     "dlls/ole32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole32/Makefile" ;;
     "dlls/ole32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole32/tests/Makefile" ;;
     "dlls/oleacc/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/oleacc/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index e1167f1976c..a123504a497 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,6 +150,7 @@ then
     enable_msacm_dll16=${enable_msacm_dll16:-no}
     enable_ole2conv_dll16=${enable_ole2conv_dll16:-no}
     enable_ole2prox_dll16=${enable_ole2prox_dll16:-no}
+    enable_ole2thk_dll16=${enable_ole2thk_dll16:-no}
     enable_olecli_dll16=${enable_olecli_dll16:-no}
     enable_olesvr_dll16=${enable_olesvr_dll16:-no}
     enable_stress_dll16=${enable_stress_dll16:-no}
@@ -2146,6 +2147,7 @@ WINE_CONFIG_MAKEFILE([dlls/odbccp32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D
 WINE_CONFIG_MAKEFILE([dlls/odbccp32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
 WINE_CONFIG_MAKEFILE([dlls/ole2conv.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
 WINE_CONFIG_MAKEFILE([dlls/ole2prox.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
+WINE_CONFIG_MAKEFILE([dlls/ole2thk.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
 WINE_CONFIG_MAKEFILE([dlls/ole32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
 WINE_CONFIG_MAKEFILE([dlls/ole32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
 WINE_CONFIG_MAKEFILE([dlls/oleacc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
diff --git a/dlls/Makefile.in b/dlls/Makefile.in
index 1b3e854451e..d4f465ae4ad 100644
--- a/dlls/Makefile.in
+++ b/dlls/Makefile.in
@@ -32,7 +32,6 @@ WIN16_FILES = \
 	ole2.dll16 \
 	ole2disp.dll16 \
 	ole2nls.dll16 \
-	ole2thk.dll16 \
 	rasapi16.dll16 \
 	setupx.dll16 \
 	shell.dll16 \
@@ -83,7 +82,7 @@ krnl386.exe16 system.drv16 toolhelp.dll16:
 msvideo.dll16:
 	echo "msvfw32.dll" >$@
 
-compobj.dll16 ole2.dll16 ole2nls.dll16 ole2thk.dll16 storage.dll16:
+compobj.dll16 ole2.dll16 ole2nls.dll16 storage.dll16:
 	echo "ole32.dll" >$@
 
 ole2disp.dll16 typelib.dll16:
diff --git a/dlls/ole2thk.dll16/Makefile.in b/dlls/ole2thk.dll16/Makefile.in
new file mode 100644
index 00000000000..e558733b4ed
--- /dev/null
+++ b/dlls/ole2thk.dll16/Makefile.in
@@ -0,0 +1,13 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = ole2thk.dll16
+IMPORTS   = kernel32
+EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,ole32.dll
+
+SPEC_SRCS = ole2thk.dll16.spec
+
+@MAKE_DLL_RULES@
+
+@DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/ole32/ole2thk.spec b/dlls/ole2thk.dll16/ole2thk.dll16.spec
similarity index 100%
rename from dlls/ole32/ole2thk.spec
rename to dlls/ole2thk.dll16/ole2thk.dll16.spec
diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in
index 2bdbad40455..d3e8198c839 100644
--- a/dlls/ole32/Makefile.in
+++ b/dlls/ole32/Makefile.in
@@ -57,7 +57,6 @@ SPEC_SRCS16 = \
 	compobj.spec \
 	ole2.spec \
 	ole2nls.spec \
-	ole2thk.spec \
 	storage.spec
 
 RC_SRCS = ole32res.rc
-- 
GitLab