From: Józef Kucia jkucia@codeweavers.com
This requires widl from Wine >= 3.20:
commit b7402ddbbecdfaa81daa657fbb5d37661f401434 Author: Józef Kucia jkucia@codeweavers.com Date: Mon Nov 19 15:07:02 2018 +0100
widl: Guard RPC includes with #ifdef _WIN32.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- Makefile.am | 6 ++---- configure.ac | 2 +- m4/widl.m4 | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 m4/widl.m4
diff --git a/Makefile.am b/Makefile.am index 9ad7b2e3b9a5..2b5bca0871c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -170,9 +170,7 @@ vkd3d_v_widl_1 = EXTRA_DIST += $(widl_headers) $(widl_headers:.h=.idl) $(widl_headers): %.h: %.idl if HAVE_WIDL - $(VKD3D_V_WIDL)$(WIDL) -h -o $@.tmp $< - $(AM_V_at)$(SED) -e '/#include <rpc.h>/d' -e '/#include <rpcndr.h>/d' <$@.tmp >$@ - $(AM_V_at)$(RM) $@.tmp + $(VKD3D_V_WIDL)$(WIDL) -h -o $@ $< else @echo "widl is required to generate $@" endif @@ -235,7 +233,7 @@ $(CROSS32_IMPLIBS): %.cross32.a: %.cross32.def $(AM_V_GEN)$(CROSS32_DLLTOOL) -k -m i386 --as-flags=-32 -d $< -l $@
$(CROSS32_EXEFILES): %.cross32.exe: %.c $(CROSS32_IMPLIBS) $(widl_headers) - $(AM_V_CCLD)depbase=`echo $@ | sed 's![^/]*$$!$(DEPDIR)/&!;s!.exe$$!!'`; \ + $(AM_V_CCLD)depbase=`echo $@ | $(SED) 's![^/]*$$!$(DEPDIR)/&!;s!.exe$$!!'`; \ $(CROSS32_CC) $(CROSS_CFLAGS) -MT $@ -MD -MP -MF $$depbase.Tpo -o $@ $< $(CROSS32_IMPLIBS) -ldxgi -lgdi32 && \ $(am__mv) $$depbase.Tpo $$depbase.Po else diff --git a/configure.ac b/configure.ac index 029278126b49..28f2ac908733 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PROG_CC AM_PROG_CC_C_O AC_PROG_SED AC_PROG_MKDIR_P -AC_CHECK_PROG([WIDL], [widl], [widl], [no]) +VKD3D_PROG_WIDL(3, 20) AS_IF([test "x$WIDL" = "xno"], [AC_MSG_WARN([widl is required to build header files.])])
AM_INIT_AUTOMAKE([1.11 foreign silent-rules subdir-objects no-dist-gzip dist-xz -Wall -Werror]) diff --git a/m4/widl.m4 b/m4/widl.m4 new file mode 100644 index 000000000000..2849356f7c04 --- /dev/null +++ b/m4/widl.m4 @@ -0,0 +1,14 @@ +dnl VKD3D_PROG_WIDL(major, minor) +AC_DEFUN([VKD3D_PROG_WIDL], + +[AC_CHECK_PROG([WIDL], [widl], [widl], [no]) + +AS_IF([test "x$WIDL" != "xno"], +[AC_MSG_CHECKING([checking whether widl version >= $1.$2]) +vkd3d_widl_version=`$WIDL -V | $SED -E '/version/{s/.* version (.*)/\1/;q;}'` + +AX_COMPARE_VERSION([$vkd3d_widl_version], [ge], [$1.$2], + [AC_MSG_RESULT([yes ($vkd3d_widl_version)])], + [AC_MSG_RESULT([no ($vkd3d_widl_version)]) + WIDL=no]) +])])