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

Steve Lhomme git at videolan.org
Tue Mar 31 10:52:48 CEST 2020


npapi-vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Mar 30 15:48:00 2020 +0200| [4c7155f3f155dbb6bb90788b80d3b85572cde3b4] | committer: Steve Lhomme

don't build stdole2.tlb if it already exists

> https://code.videolan.org/videolan/npapi-vlc/commit/4c7155f3f155dbb6bb90788b80d3b85572cde3b4
---

 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 d358b23..4dc4b89 100644
--- a/activex/Makefile.am
+++ b/activex/Makefile.am
@@ -102,7 +102,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 0143f10..c552072 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,15 +133,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