Commit c3c587eb authored by Alexandre Julliard's avatar Alexandre Julliard

Added preliminary support for cross-compiling tests using mingw on

Linux if available.
parent 025c0b71
...@@ -39,6 +39,7 @@ EXEEXT = @EXEEXT@ ...@@ -39,6 +39,7 @@ EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
LIBEXT = @LIBEXT@ LIBEXT = @LIBEXT@
DLLEXT = @DLLEXT@ DLLEXT = @DLLEXT@
CROSSCC = @CROSSCC@
LDSHARED = @LDSHARED@ LDSHARED = @LDSHARED@
DLLWRAP = @DLLWRAP@ DLLWRAP = @DLLWRAP@
DLLWRAPFLAGS = --add-stdcall-alias DLLWRAPFLAGS = --add-stdcall-alias
...@@ -110,11 +111,14 @@ LINTS = $(C_SRCS:.c=.ln) ...@@ -110,11 +111,14 @@ LINTS = $(C_SRCS:.c=.ln)
# Implicit rules # Implicit rules
.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .pl .ok .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .pl .ok .cross.o
.c.o: .c.o:
$(CC) -c $(ALLCFLAGS) -o $@ $< $(CC) -c $(ALLCFLAGS) -o $@ $<
.c.cross.o:
$(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
.s.o: .s.o:
$(AS) -o $@ $< $(AS) -o $@ $<
...@@ -265,7 +269,10 @@ $(SUBDIRS:%=%/__checklink__): dummy ...@@ -265,7 +269,10 @@ $(SUBDIRS:%=%/__checklink__): dummy
$(SUBDIRS:%=%/__test__): dummy $(SUBDIRS:%=%/__test__): dummy
@cd `dirname $@` && $(MAKE) test @cd `dirname $@` && $(MAKE) test
.PHONY: check test $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__): dummy
@cd `dirname $@` && $(MAKE) crosstest
.PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
# Misc. rules # Misc. rules
......
...@@ -138,6 +138,8 @@ $(TESTSUBDIRS:%=%/__test__): test_environment ...@@ -138,6 +138,8 @@ $(TESTSUBDIRS:%=%/__test__): test_environment
check test:: $(TESTSUBDIRS:%=%/__test__) check test:: $(TESTSUBDIRS:%=%/__test__)
crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
.PHONY: test_environment .PHONY: test_environment
# Misc rules # Misc rules
......
...@@ -10757,6 +10757,95 @@ echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6 ...@@ -10757,6 +10757,95 @@ echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6
fi fi
fi fi
fi fi
CROSSTEST=""
if test "$cross_compiling" = "no"
then
for ac_prog in i586-mingw32msvc-gcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CROSSCC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CROSSCC"; then
ac_cv_prog_CROSSCC="$CROSSCC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CROSSCC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
fi
fi
CROSSCC=$ac_cv_prog_CROSSCC
if test -n "$CROSSCC"; then
echo "$as_me:$LINENO: result: $CROSSCC" >&5
echo "${ECHO_T}$CROSSCC" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$CROSSCC" && break
done
test -n "$CROSSCC" || CROSSCC="false"
for ac_prog in i586-mingw32msvc-dlltool
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_DLLTOOL+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
fi
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
echo "$as_me:$LINENO: result: $DLLTOOL" >&5
echo "${ECHO_T}$DLLTOOL" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$DLLTOOL" && break
done
test -n "$DLLTOOL" || DLLTOOL="false"
if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
fi
;; ;;
esac esac
...@@ -14924,6 +15013,9 @@ s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t ...@@ -14924,6 +15013,9 @@ s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t
s,@LDSHARED@,$LDSHARED,;t t s,@LDSHARED@,$LDSHARED,;t t
s,@DLLWRAP@,$DLLWRAP,;t t s,@DLLWRAP@,$DLLWRAP,;t t
s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t
s,@CROSSTEST@,$CROSSTEST,;t t
s,@CROSSCC@,$CROSSCC,;t t
s,@DLLTOOL@,$DLLTOOL,;t t
s,@LDPATH@,$LDPATH,;t t s,@LDPATH@,$LDPATH,;t t
s,@CRTLIBS@,$CRTLIBS,;t t s,@CRTLIBS@,$CRTLIBS,;t t
s,@LDD@,$LDD,;t t s,@LDD@,$LDD,;t t
...@@ -15552,7 +15644,7 @@ if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x" ...@@ -15552,7 +15644,7 @@ if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
then then
echo echo
echo "*** Warning: the OpenGL version you have installed relies on libpthread for" echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
echo "*** thread-safety. To prevent crashes, OpenGL support has been removed." echo "*** thread-safety. To prevent crashes, OpenGL support has been disabled."
echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine," echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
echo "*** start configure with '--enable-opengl' to force OpenGL support." echo "*** start configure with '--enable-opengl' to force OpenGL support."
fi fi
......
...@@ -799,6 +799,15 @@ case $host_os in ...@@ -799,6 +799,15 @@ case $host_os in
fi fi
fi fi
fi fi
dnl Check for cross compiler to build test programs
AC_SUBST(CROSSTEST,"")
if test "$cross_compiling" = "no"
then
AC_CHECK_PROGS(CROSSCC,i586-mingw32msvc-gcc,false)
AC_CHECK_PROGS(DLLTOOL,i586-mingw32msvc-dlltool,false)
if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
fi
;; ;;
esac esac
...@@ -1547,7 +1556,7 @@ if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x" ...@@ -1547,7 +1556,7 @@ if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
then then
echo echo
echo "*** Warning: the OpenGL version you have installed relies on libpthread for" echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
echo "*** thread-safety. To prevent crashes, OpenGL support has been removed." echo "*** thread-safety. To prevent crashes, OpenGL support has been disabled."
echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine," echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
echo "*** start configure with '--enable-opengl' to force OpenGL support." echo "*** start configure with '--enable-opengl' to force OpenGL support."
fi fi
......
...@@ -51,6 +51,8 @@ checklink:: $(MODULE)$(DLLEXT) $(SUBDIRS:%=%/__checklink__) ...@@ -51,6 +51,8 @@ checklink:: $(MODULE)$(DLLEXT) $(SUBDIRS:%=%/__checklink__)
check test:: $(SUBDIRS:%=%/__test__) check test:: $(SUBDIRS:%=%/__test__)
crosstest:: $(SUBDIRS:%=%/__crosstest__)
$(TESTRESULTS): $(MODULE)$(DLLEXT) $(TESTRESULTS): $(MODULE)$(DLLEXT)
# Sanity check # Sanity check
......
...@@ -892,6 +892,8 @@ uninstall:: ...@@ -892,6 +892,8 @@ uninstall::
check test:: $(BUILDSUBDIRS:%=%/__test__) check test:: $(BUILDSUBDIRS:%=%/__test__)
crosstest:: $(BUILDSUBDIRS:%=%/__crosstest__)
checklink:: $(BUILDSUBDIRS:%=%/__checklink__) checklink:: $(BUILDSUBDIRS:%=%/__checklink__)
### Dependencies: ### Dependencies:
...@@ -24,6 +24,10 @@ GEN_C_SRCS = $(TESTLIST) ...@@ -24,6 +24,10 @@ GEN_C_SRCS = $(TESTLIST)
EXTRA_OBJS = $(TESTMAIN) EXTRA_OBJS = $(TESTMAIN)
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS) ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
CROSSTESTMAIN= $(TOPOBJDIR)/programs/winetest/wtmain.cross.o
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(GEN_C_SRCS:.c=.cross.o) $(CROSSTESTMAIN)
@MAKE_RULES@ @MAKE_RULES@
# Rule for main module spec file # Rule for main module spec file
...@@ -62,10 +66,20 @@ $(TESTRESULTS): $(MODULE)$(DLLEXT) $(TOPOBJDIR)/dlls/$(TESTDLL)$(DLLEXT) ...@@ -62,10 +66,20 @@ $(TESTRESULTS): $(MODULE)$(DLLEXT) $(TOPOBJDIR)/dlls/$(TESTDLL)$(DLLEXT)
$(TESTMAIN): $(TESTMAIN):
cd $(TOPOBJDIR)/programs/winetest && $(MAKE) wtmain.o cd $(TOPOBJDIR)/programs/winetest && $(MAKE) wtmain.o
# Rules for cross-compiling tests
crosstest:: @CROSSTEST@
$(CROSSTEST): $(CROSSOBJS) Makefile.in
$(CROSSCC) $(CROSSOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(LIBS)
$(CROSSTESTMAIN):
cd $(TOPOBJDIR)/programs/winetest && $(MAKE) wtmain.cross.o
# Rules for cleaning # Rules for cleaning
testclean:: testclean::
$(RM) $(TESTRESULTS) $(RM) $(TESTRESULTS)
clean:: clean::
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)
...@@ -290,6 +290,8 @@ uninstall:: ...@@ -290,6 +290,8 @@ uninstall::
check test:: \$(BUILDSUBDIRS:%=%/__test__) check test:: \$(BUILDSUBDIRS:%=%/__test__)
crosstest:: \$(BUILDSUBDIRS:%=%/__crosstest__)
checklink:: \$(BUILDSUBDIRS:%=%/__checklink__) checklink:: \$(BUILDSUBDIRS:%=%/__checklink__)
### Dependencies: ### Dependencies:
......
...@@ -24,8 +24,10 @@ PLTESTPROGRAM = $(MODULE)$(DLLEXT) ...@@ -24,8 +24,10 @@ PLTESTPROGRAM = $(MODULE)$(DLLEXT)
PLTESTS = \ PLTESTS = \
tests/wine.pl tests/wine.pl
CROSSTEST = wtmain.cross.o
# override all: target so that we don't build the Perl stuff by default # override all: target so that we don't build the Perl stuff by default
test_environment: wtmain.o test_environment: wtmain.o @CROSSTEST@
@MAKE_PROG_RULES@ @MAKE_PROG_RULES@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment