[vlc-commits] don't build stdole2.tlb if it already exists

Steve Lhomme git at videolan.org
Sun May 16 21:18:51 UTC 2021


npapi-vlc | branch: 3.0.x | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Mar 30 15:48:00 2020 +0200| [76abef0ae8e307416f1e68e7200449d9f1804d29] | committer: Jean-Baptiste Kempf

don't build stdole2.tlb if it already exists

(cherry picked from commit 4c7155f3f155dbb6bb90788b80d3b85572cde3b4)

> https://code.videolan.org/videolan/npapi-vlc/commit/76abef0ae8e307416f1e68e7200449d9f1804d29
---

 activex/Makefile.am |  6 +++++-
 configure.ac        | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/activex/Makefile.am b/activex/Makefile.am
index df66cc8..bdd4f4c 100644
--- a/activex/Makefile.am
+++ b/activex/Makefile.am
@@ -107,7 +107,11 @@ WINE_SDK_PATH ?= /usr/include/wine/windows
 stdole2.tlb stdole2_idl.c stdole2_idl.h: $(WINE_SDK_PATH)/stdole2.idl
 	$(WIDL) $(WIDLFLAGS) -I$(WINE_SDK_PATH) -t -u -h -T stdole2.tlb -U stdole2_idl.c -H stdole2_idl.h $<
 
-axvlc.tlb axvlc_idl.c axvlc_idl.h: axvlc.idl stdole2.tlb
+if !HAS_STDOLE2_TLB
+axvlc.tlb: stdole2.tlb
+endif
+
+axvlc.tlb axvlc_idl.c axvlc_idl.h: axvlc.idl
 	$(WIDL) $(WIDLFLAGS) -I$(WINE_SDK_PATH) -I. -t -u -h -T axvlc.tlb -U axvlc_idl.c -H axvlc_idl.h $<
 
 clean-tlb:
diff --git a/configure.ac b/configure.ac
index 5999781..6987b82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,15 +134,33 @@ AS_IF([test "${SYS}" = "mingw32"],[
     AC_CHECK_HEADER(ole2.h,,[AC_MSG_ERROR([required OLE header ole2.h is missing from your system])])
     AC_CHECK_HEADER(olectl.h,,[AC_MSG_ERROR([required OLE header olectl.h is missing from your system])])
     AC_CHECK_HEADERS(objsafe.h,,,[#include <ole2.h>])
+    AS_IF([test "${WIDL}" != "no"],[
+      ac_ext=idl
+      ac_objext=tlb
+      ac_compile='$WIDL -t conftest.$ac_ext -o conftest.$ac_objext'
+      cat <<_ACEOF >conftest.idl
+import "ocidl.idl";
+[[
+  uuid(DF2BBE39-40A8-433b-A279-073F48DA94B6),
+]]
+library AXVLC
+{
+  importlib("stdole2.tlb");
+}
+_ACEOF
+AS_IF([ac_fn_cxx_try_compile "$LINENO"],[has_stdole2_tlb=yes],[has_stdole2_tlb=no])
+    ],[has_stdole2_tlb=no])
     AC_LANG_POP(C++)
 ],[
     MIDL="no"
     WIDL="no"
+    has_stdole2_tlb="no"
 ])
 
 AC_SUBST(WIDLFLAGS)
 AM_CONDITIONAL(HAS_MIDL_COMPILER, test "${MIDL}" != "no")
 AM_CONDITIONAL(HAS_WIDL_COMPILER, test "${WIDL}" != "no")
+AM_CONDITIONAL(HAS_STDOLE2_TLB, test "${has_stdole2_tlb}" = "yes")
 
 dnl
 dnl Buggy glibc prevention. Purposedly not cached.



More information about the vlc-commits mailing list