Added preliminary support for cross-compiling tests using mingw on

Linux if available.
This commit is contained in:
Alexandre Julliard 2002-09-06 19:46:00 +00:00
parent 025c0b716b
commit c3c587eb1d
9 changed files with 138 additions and 6 deletions

View File

@ -39,6 +39,7 @@ EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
LIBEXT = @LIBEXT@
DLLEXT = @DLLEXT@
CROSSCC = @CROSSCC@
LDSHARED = @LDSHARED@
DLLWRAP = @DLLWRAP@
DLLWRAPFLAGS = --add-stdcall-alias
@ -110,11 +111,14 @@ LINTS = $(C_SRCS:.c=.ln)
# 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:
$(CC) -c $(ALLCFLAGS) -o $@ $<
.c.cross.o:
$(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
.s.o:
$(AS) -o $@ $<
@ -265,7 +269,10 @@ $(SUBDIRS:%=%/__checklink__): dummy
$(SUBDIRS:%=%/__test__): dummy
@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

View File

@ -138,6 +138,8 @@ $(TESTSUBDIRS:%=%/__test__): test_environment
check test:: $(TESTSUBDIRS:%=%/__test__)
crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
.PHONY: test_environment
# Misc rules

94
configure vendored
View File

@ -10757,6 +10757,95 @@ echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6
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
@ -14924,6 +15013,9 @@ s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t
s,@LDSHARED@,$LDSHARED,;t t
s,@DLLWRAP@,$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,@CRTLIBS@,$CRTLIBS,;t t
s,@LDD@,$LDD,;t t
@ -15552,7 +15644,7 @@ if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
then
echo
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 "*** start configure with '--enable-opengl' to force OpenGL support."
fi

View File

@ -799,6 +799,15 @@ case $host_os in
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
@ -1547,7 +1556,7 @@ if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
then
echo
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 "*** start configure with '--enable-opengl' to force OpenGL support."
fi

View File

@ -51,6 +51,8 @@ checklink:: $(MODULE)$(DLLEXT) $(SUBDIRS:%=%/__checklink__)
check test:: $(SUBDIRS:%=%/__test__)
crosstest:: $(SUBDIRS:%=%/__crosstest__)
$(TESTRESULTS): $(MODULE)$(DLLEXT)
# Sanity check

View File

@ -892,6 +892,8 @@ uninstall::
check test:: $(BUILDSUBDIRS:%=%/__test__)
crosstest:: $(BUILDSUBDIRS:%=%/__crosstest__)
checklink:: $(BUILDSUBDIRS:%=%/__checklink__)
### Dependencies:

View File

@ -24,6 +24,10 @@ GEN_C_SRCS = $(TESTLIST)
EXTRA_OBJS = $(TESTMAIN)
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@
# Rule for main module spec file
@ -62,10 +66,20 @@ $(TESTRESULTS): $(MODULE)$(DLLEXT) $(TOPOBJDIR)/dlls/$(TESTDLL)$(DLLEXT)
$(TESTMAIN):
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
testclean::
$(RM) $(TESTRESULTS)
clean::
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS)
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)

View File

@ -290,6 +290,8 @@ uninstall::
check test:: \$(BUILDSUBDIRS:%=%/__test__)
crosstest:: \$(BUILDSUBDIRS:%=%/__crosstest__)
checklink:: \$(BUILDSUBDIRS:%=%/__checklink__)
### Dependencies:

View File

@ -24,8 +24,10 @@ PLTESTPROGRAM = $(MODULE)$(DLLEXT)
PLTESTS = \
tests/wine.pl
CROSSTEST = wtmain.cross.o
# 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@