Skip to content

Commit 9349286

Browse files
committed
---
yaml --- r: 5427 b: refs/heads/master c: 1321580 h: refs/heads/master i: 5425: 2458673 5423: c26dfb7 v: v3
1 parent b8c193c commit 9349286

File tree

4 files changed

+57
-7
lines changed

4 files changed

+57
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: f19ab1ff3c85973a54cc98e3f98ae240e2d0d816
2+
refs/heads/master: 13215809a897b3b14eb8a078b8931bb01dba14ce

trunk/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ ifneq ($(MAKE_RESTARTS),)
1111
CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
1212
endif
1313

14-
CFG_INFO := $(info cfg: building on $(CFG_OSTYPE) $(CFG_CPUTYPE))
14+
CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE))
15+
CFG_INFO := $(info cfg: llvm host triple $(CFG_LLVM_TRIPLE))
1516

1617
ifdef CFG_DISABLE_OPTIMIZE
1718
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))

trunk/configure

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ need_cmd sed
127127
msg "inspecting environment"
128128

129129
CFG_OSTYPE=$(uname -s)
130-
131130
CFG_CPUTYPE=$(uname -m)
131+
132132
if [ $CFG_OSTYPE = Darwin -a $CFG_CPUTYPE = i386 ]
133133
then
134134
# Darwin's `uname -s` lies and always returns i386. We have to use sysctl
@@ -139,6 +139,54 @@ then
139139
fi
140140
fi
141141

142+
143+
# The goal here is to come up with the same triple as LLVM would,
144+
# at least for the subset of platforms we're willing to target.
145+
146+
case $CFG_OSTYPE in
147+
148+
Linux)
149+
CFG_OSTYPE=unknown-linux-gnu
150+
;;
151+
152+
FreeBSD)
153+
CFG_OSTYPE=unknown-freebsd
154+
;;
155+
156+
Darwin)
157+
CFG_OSTYPE=apple-darwin
158+
;;
159+
160+
MINGW32*)
161+
CFG_OSTYPE=pc-mingw32
162+
;;
163+
164+
*)
165+
err "unknown OS type: $CFG_OSTYPE"
166+
;;
167+
esac
168+
169+
170+
case $CFG_CPUTYPE in
171+
172+
i386 | i486 | i686 | i786 | x86)
173+
CFG_CPUTYPE=i686
174+
;;
175+
176+
xscale | arm)
177+
CFG_CPUTYPE=arm
178+
;;
179+
180+
x86_64 | x86-64 | x64)
181+
CFG_CPUTYPE=x86_64
182+
;;
183+
184+
*)
185+
err "unknown CPU type: $CFG_CPUTYPE"
186+
esac
187+
188+
CFG_HOST_TRIPLE="${CFG_CPUTYPE}-${CFG_OSTYPE}"
189+
142190
CFG_SELF=$(echo $0 | tr '\\' '/')
143191
CFG_SRC_DIR=${CFG_SELF%${CFG_SELF##*/}}
144192
CFG_BUILD_DIR=$(echo $PWD | tr '\\' '/')
@@ -180,6 +228,7 @@ putvar CFG_SRC_DIR
180228
putvar CFG_BUILD_DIR
181229
putvar CFG_OSTYPE
182230
putvar CFG_CPUTYPE
231+
putvar CFG_HOST_TRIPLE
183232
putvar CFG_CONFIGURE_ARGS
184233

185234
step_msg "looking for build programs"

trunk/mk/platform.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_GCCISH_LINK_FLAGS :=
77
# embedded into the executable, so use a no-op command.
88
CFG_DSYMUTIL := true
99

10-
ifeq ($(CFG_OSTYPE), FreeBSD)
10+
ifeq ($(findstring freebsd,$(CFG_OSTYPE)),)
1111
CFG_LIB_NAME=lib$(1).so
1212
CFG_GCCISH_CFLAGS += -fPIC -march=i686 -I/usr/local/include
1313
CFG_GCCISH_LINK_FLAGS += -shared -fPIC -lpthread -lrt
@@ -20,7 +20,7 @@ ifeq ($(CFG_OSTYPE), FreeBSD)
2020
CFG_DEF_SUFFIX := .bsd.def
2121
endif
2222

23-
ifeq ($(CFG_OSTYPE), Linux)
23+
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
2424
CFG_LIB_NAME=lib$(1).so
2525
CFG_GCCISH_CFLAGS += -fPIC -march=i686
2626
CFG_GCCISH_LINK_FLAGS += -shared -fPIC -ldl -lpthread -lrt
@@ -46,7 +46,7 @@ ifeq ($(CFG_OSTYPE), Linux)
4646
endif
4747
endif
4848

49-
ifeq ($(CFG_OSTYPE), Darwin)
49+
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
5050
CFG_LIB_NAME=lib$(1).dylib
5151
CFG_UNIXY := 1
5252
CFG_LDENV := DYLD_LIBRARY_PATH
@@ -69,7 +69,7 @@ ifeq ($(CFG_OSTYPE), Darwin)
6969
CFG_DEF_SUFFIX := .darwin.def
7070
endif
7171

72-
ifneq ($(findstring MINGW,$(CFG_OSTYPE)),)
72+
ifneq ($(findstring mingw,$(CFG_OSTYPE)),)
7373
CFG_WINDOWSY := 1
7474
endif
7575

0 commit comments

Comments
 (0)