aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorGarret Kelly <gdk@google.com>2016-05-26 09:45:37 -0400
committerPalmer Dabbelt <palmer@dabbelt.com>2016-05-30 11:32:52 -0700
commit13f52d26149c900378d315478779b02753ae2826 (patch)
tree852c431a277446135b50f0792d3132f2e1fc169b /configure
parentb55ab2aa7a28e8acd6ecf3c5b2d85aa9d23b3458 (diff)
downloadriscv-gnu-toolchain-13f52d26149c900378d315478779b02753ae2826.zip
riscv-gnu-toolchain-13f52d26149c900378d315478779b02753ae2826.tar.gz
riscv-gnu-toolchain-13f52d26149c900378d315478779b02753ae2826.tar.bz2
Improve handling of --with-arch in configure.ac
Augment the handling of --with-arch such that it can properly set XLEN, atomics flags, and floating point flags. The original --enable-atomics/float flags are still respected, but if --with-arch is provided then it supersedes other options.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure125
1 files changed, 109 insertions, 16 deletions
diff --git a/configure b/configure
index 3eb5490..c957d0d 100755
--- a/configure
+++ b/configure
@@ -654,9 +654,9 @@ ac_user_opts='
enable_option_checking
enable_linux
with_xlen
-with_arch
enable_atomic
enable_float
+with_arch
enable_multilib
'
ac_precious_vars='build_alias
@@ -1289,7 +1289,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-xlen=XLEN Set XLEN, the X-register bit width (default is 64)
- --with-arch=IMAFD Sets the base RISC-V ISA, defaults to IMAFD
+ --with-arch=RV64IMAFD Sets the base RISC-V ISA, defaults to RV64IMAFD
Some influential environment variables:
CC C compiler command
@@ -2735,6 +2735,69 @@ $as_echo "$ac_cv_path_FGREP" >&6; }
FGREP="$ac_cv_path_FGREP"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
@@ -3152,14 +3215,6 @@ else
fi
-
-# Check whether --with-arch was given.
-if test "${with_arch+set}" = set; then :
- withval=$with_arch; WITH_ARCH=--with-arch=$withval
-
-fi
-
-
# Check whether --enable-atomic was given.
if test "${enable_atomic+set}" = set; then :
enableval=$enable_atomic;
@@ -3169,22 +3224,60 @@ else
fi
-if test "x$enable_atomic" != xno; then :
-
+# Check whether --enable-float was given.
+if test "${enable_float+set}" = set; then :
+ enableval=$enable_float;
else
- atomic_cflags=-mno-atomic
+ enable_float=yes
fi
-# Check whether --enable-float was given.
-if test "${enable_float+set}" = set; then :
- enableval=$enable_float;
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-arch was given.
+if test "${with_arch+set}" = set; then :
+ withval=$with_arch; if echo "$withval" | $GREP -qE "^RV32"; then :
+ XLEN=32
+
+fi
+ if echo "$withval" | $GREP -qE "^RV64"; then :
+ XLEN=64
+
+fi
+
+ if echo "$withval" | $GREP -qE "^RV(32|64).*A"; then :
+ enable_atomic=yes
else
+ enable_atomic=no
+fi
+
+ if echo "$withval" | $GREP -qE "^RV(32|64).*F"; then :
enable_float=yes
+else
+ enable_float=no
+fi
+
+
+ WITH_ARCH=--with-arch=$withval
fi
+if test "x$enable_atomic" != xno; then :
+
+else
+ atomic_cflags=-mno-atomic
+
+fi
+
if test "x$enable_float" != xno; then :
float_cflags=-mhard-float
float_asflags=-mhard-float