Skip to content

Commit

Permalink
Auto merge of #38650 - infinity0:master, r=alexcrichton
Browse files Browse the repository at this point in the history
Detect mips CPUs in ./configure

This mirrors existing logic already in src/bootstrap/bootstrap.py
  • Loading branch information
bors committed Jan 12, 2017
2 parents e357178 + 246e749 commit dd8e68d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,18 @@ case $CFG_CPUTYPE in
CFG_CPUTYPE=x86_64
;;

mips | mips64)
if [ "$CFG_CPUTYPE" = "mips64" ]; then
CFG_OSTYPE="${CFG_OSTYPE}abi64"
fi
ENDIAN=$(printf '\1' | od -dAn)
if [ "$ENDIAN" -eq 1 ]; then
CFG_CPUTYPE="${CFG_CPUTYPE}el"
elif [ "$ENDIAN" -ne 256 ]; then
err "unknown endianness: $ENDIAN (expecting 1 for little or 256 for big)"
fi
;;

BePC)
CFG_CPUTYPE=i686
;;
Expand Down
6 changes: 6 additions & 0 deletions src/test/run-pass/conditional-compile-arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ pub fn main() { }
#[cfg(target_arch = "aarch64")]
pub fn main() { }

#[cfg(target_arch = "mips")]
pub fn main() { }

#[cfg(target_arch = "mips64")]
pub fn main() { }

#[cfg(target_arch = "powerpc64")]
pub fn main() { }

Expand Down

0 comments on commit dd8e68d

Please sign in to comment.