From 8fc51dfc6524d0a4e8ddd80a567b266792170ff0 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Mon, 27 Jun 2011 11:53:04 -0700 Subject: [PATCH] Some work on reviving the mingw-cross build. Not working yet. --- Makefile.in | 4 ++-- configure | 5 +++-- mk/platform.mk | 10 ++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index c9d961ead38..9f65d42adb4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -171,9 +171,9 @@ export CFG_LLVM_ROOT # Subprograms ###################################################################### -LLVM_AS := $(CFG_LLVM_BINDIR)/llvm-as +LLVM_AS := $(CFG_LLVM_BINDIR)/llvm-as$(X) -LLC := $(CFG_LLVM_BINDIR)/llc +LLC := $(CFG_LLVM_BINDIR)/llc$(X) ###################################################################### # Single-target rules diff --git a/configure b/configure index 3757d2b62c9..f14c92de399 100755 --- a/configure +++ b/configure @@ -95,7 +95,7 @@ opt() { do if [ "$arg" = "--${FLAG}-${OP}" ] then - OP=$(echo $OP | tr 'a-z' 'A-Z') + OP=$(echo $OP | tr 'a-z-' 'A-Z_') FLAG=$(echo $FLAG | tr 'a-z' 'A-Z') local V="CFG_${FLAG}_${OP}" eval $V=1 @@ -165,6 +165,7 @@ fi opt valgrind 1 "run tests with valgrind" opt docs 1 "build documentation" opt optimize 1 "build optimized rust code" +opt mingw-cross 0 "cross-compile for win32 using mingw" if [ $HELP -eq 1 ] @@ -181,7 +182,7 @@ for i in \ dl stage0 stage1 stage2 stage3 \ stage0/lib stage1/lib stage2/lib stage3/lib \ test/run-pass test/run-fail test/compile-fail \ - test/bench/99-bottles test/bench/shootout + test/bench/99-bottles test/bench/shootout do make_dir $i done diff --git a/mk/platform.mk b/mk/platform.mk index e56b45ee6fc..6b744edc2e9 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -103,9 +103,10 @@ ifdef CFG_UNIXY $(CFG_LDENV)=$(call CFG_TESTLIB,$(1)):$(CFG_LDPATH) \ $(CFG_VALGRIND) $(1) - ifdef MINGW_CROSS + ifdef CFG_ENABLE_MINGW_CROSS CFG_EXE_SUFFIX := .exe CFG_LIB_NAME=$(1).dll + CFG_DEF_SUFFIX := .def CFG_LDPATH :=$(CFG_LDPATH):$(CFG_LLVM_BINDIR) CFG_LDPATH :=$(CFG_LDPATH):$$PATH CFG_RUN_TARG=PATH=$(CFG_BUILD_DIR)/$(1)/lib:$(CFG_LDPATH) $(2) @@ -116,8 +117,13 @@ ifdef CFG_UNIXY ifdef CFG_VALGRIND CFG_VALGRIND += wine endif - CFG_GCCISH_CFLAGS := -march=i686 + + CFG_GCCISH_CFLAGS := -march=i686 -O2 + CFG_GCCISH_PRE_LIB_FLAGS := + CFG_GCCISH_POST_LIB_FLAGS := + CFG_GCCISH_DEF_FLAG := CFG_GCCISH_LINK_FLAGS := -shared + ifeq ($(CFG_CPUTYPE), x86_64) CFG_GCCISH_CFLAGS += -m32 CFG_GCCISH_LINK_FLAGS += -m32