aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac175
1 files changed, 78 insertions, 97 deletions
diff --git a/configure.ac b/configure.ac
index 3a529f2..80ca038 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,14 +22,14 @@ AC_SUBST([GSED], [$ac_cv_path_GSED])
need_gcc_external_libraries="no"
AC_CHECK_LIB(gmp, __gmpz_init, ,
- [need_gcc_external_libraries="yes"])
+ [need_gcc_external_libraries="yes"])
AC_CHECK_LIB(mpfr, mpfr_init, ,
- [need_gcc_external_libraries="yes"])
+ [need_gcc_external_libraries="yes"])
AC_CHECK_LIB(mpc, mpc_init2, ,
- [need_gcc_external_libraries="yes"])
+ [need_gcc_external_libraries="yes"])
AS_IF([test x"$need_gcc_external_libraries" != xno],
- [AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,true)],
- [AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,false)])
+ [AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,true)],
+ [AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,false)])
AC_PATH_PROG([CURL], [curl], [no])
AC_PATH_PROG([WGET], [wget], [no])
@@ -41,43 +41,28 @@ AS_IF([test x"$CURL" != xno], [FETCHER="$CURL -L -o - --ftp-pasv --retry 10"],
AC_SUBST(FETCHER)
AC_ARG_ENABLE(linux,
- [AS_HELP_STRING([--enable-linux],
- [set linux as the default make target @<:@--disable-linux@:>@])],
- [],
- [enable_linux=no]
- )
+ [AS_HELP_STRING([--enable-linux],
+ [set linux as the default make target @<:@--disable-linux@:>@])])
-AS_IF([test "x$enable_linux" != xno],
+AS_IF([test "x$enable_linux" = xyes],
[AC_SUBST(default_target, linux)],
[AC_SUBST(default_target, newlib)])
AC_ARG_ENABLE(debug_info,
- [AS_HELP_STRING([--enable-debug-info],
- [build glibc/musl/newlibc/libgcc with debug information])],
- [enable_debug_info=yes],
- [enable_debug_info=no]
- )
+ [AS_HELP_STRING([--enable-debug-info],
+ [build glibc/musl/newlibc/libgcc with debug information])])
-AS_IF([test "x$enable_debug_info" != xyes],
- [disable_debug_info=yes],
- [disable_debug_info=no]
- )
-
-AS_IF([test "x$enable_debug_info" != xyes],
- [AC_SUBST(debug_info, "")],
- [AC_SUBST(debug_info, "-g")])
+AS_IF([test "x$enable_debug_info" = xyes],
+ [AC_SUBST(debug_info, "-g")],
+ [AC_SUBST(debug_info, "")])
AC_ARG_ENABLE(default-pie,
- [AS_HELP_STRING([--enable-default-pie],
- [build linux toolchain with default PIE @<:@--enable-default-pie@:>@])],
- [],
- [enable_default_pie=no]
- )
-
-AS_IF([test "x$enable_default_pie" != xyes],
- [AC_SUBST(enable_default_pie, "--disable-default-pie")],
- [AC_SUBST(enable_default_pie, "--enable-default-pie")])
+ [AS_HELP_STRING([--enable-default-pie],
+ [build linux toolchain with default PIE @<:@--enable-default-pie@:>@])])
+AS_IF([test "x$enable_default_pie" = xyes],
+ [AC_SUBST(enable_default_pie, "--enable-default-pie")],
+ [AC_SUBST(enable_default_pie, "--disable-default-pie")])
AC_ARG_WITH(arch,
[AS_HELP_STRING([--with-arch=rv64gc],
@@ -94,12 +79,16 @@ AC_ARG_WITH(abi,
)
AC_ARG_WITH(tune,
- [AS_HELP_STRING([--with-tune=rocket],
- [Set the base RISC-V CPU, defaults to rocket])],
+ [AS_HELP_STRING([--with-tune=generic],
+ [Set the base RISC-V CPU, defaults to GCC's default])],
[],
- [with_tune=rocket]
+ [with_tune=no]
)
+AS_IF([test "x$with_tune" != xno],
+ [AC_SUBST(WITH_TUNE,--with-tune=$with_tune)],
+ [AC_SUBST(WITH_TUNE,"")])
+
AC_ARG_WITH(isa-spec,
[AS_HELP_STRING([--with-isa-spec=20191213],
[Set the default ISA spec version, default to 20191213, available options: 2.2, 20190608, 20191213])],
@@ -115,10 +104,10 @@ AC_ARG_WITH(sim,
)
AC_ARG_WITH(languages,
- [AS_HELP_STRING([--with-languages=],
- [Sets the enabled languages for GNU toolchain, defaults to c,c++,fortran for Linux/native and Linux/glibc or c,c++ for Bare-metal, Linux/musl and Linux/uClibc])],
- []
- )
+ [AS_HELP_STRING([--with-languages=],
+ [Sets the enabled languages for GNU toolchain, defaults to c,c++,fortran for Linux/native and Linux/glibc or c,c++ for Bare-metal, Linux/musl and Linux/uClibc])],
+ []
+ )
AS_IF([test "x$with_abi" = xdefault],
[AS_CASE([$with_arch],
@@ -134,17 +123,13 @@ AS_IF([test "x$with_abi" = xdefault],
AC_SUBST(WITH_ARCH, --with-arch=$with_arch)
AC_SUBST(WITH_ABI, --with-abi=$with_abi)
-AC_SUBST(WITH_TUNE, --with-tune=$with_tune)
AC_SUBST(WITH_ISA_SPEC, --with-isa-spec=$with_isa_spec)
AC_SUBST(WITH_SIM, $with_sim)
AC_SUBST(WITH_LANGUAGES, $with_languages)
AC_ARG_ENABLE(multilib,
[AS_HELP_STRING([--enable-multilib],
- [build both RV32 and RV64 runtime libraries @<:@--disable-multilib@:>@])],
- [],
- [enable_multilib=no]
- )
+ [build both RV32 and RV64 runtime libraries @<:@--disable-multilib@:>@])])
AC_ARG_WITH(multilib-generator,
[AS_HELP_STRING([--with-multilib-generator],
@@ -161,46 +146,45 @@ AC_ARG_WITH(extra-multilib-test,
)
AS_IF([test "x$with_multilib_generator" != xno],
- [AC_SUBST(multilib_gen,"$with_multilib_generator")],
- [AC_SUBST(multilib_gen,"")])
+ [AC_SUBST(multilib_gen,"$with_multilib_generator")],
+ [AC_SUBST(multilib_gen,"")])
AS_IF([test "x$with_extra_multilib_test" != xno],
- [AC_SUBST(extra_multilib_test,"$with_extra_multilib_test")],
- [AC_SUBST(extra_multilib_test,"")])
+ [AC_SUBST(extra_multilib_test,"$with_extra_multilib_test")],
+ [AC_SUBST(extra_multilib_test,"")])
-AS_IF([test "x$enable_multilib" != xno || test "x$with_multilib_generator" != xno],
- [AC_SUBST(multilib_flags,--enable-multilib)],
+AS_IF([test "x$enable_multilib" = xyes || test "x$with_multilib_generator" != xno],
+ [AC_SUBST(multilib_flags,--enable-multilib)],
[AC_SUBST(multilib_flags,--disable-multilib)])
-AS_IF([test "x$enable_multilib" != xno],
- [AC_SUBST(glibc_multilib_names,"rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 rv64gc-lp64d rv64gcv-lp64d")],
- [AC_SUBST(glibc_multilib_names,"$with_arch-$with_abi")])
+AS_IF([test "x$enable_multilib" = xyes],
+ [AC_SUBST(glibc_multilib_names,"rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 rv64gc-lp64d rv64gcv-lp64d")],
+ [AC_SUBST(glibc_multilib_names,"$with_arch-$with_abi")])
-AS_IF([test "x$enable_multilib" != xno],
- [AC_SUBST(newlib_multilib_names,"rv32i-ilp32 rv32iac-ilp32 rv32im-ilp32 rv32imac-ilp32 rv32imafc-ilp32f rv64imac-lp64 rv64gc-lp64d")],
- [AC_SUBST(newlib_multilib_names,"$with_arch-$with_abi")])
+AS_IF([test "x$enable_multilib" = xyes],
+ [AC_SUBST(newlib_multilib_names,"rv32i-ilp32 rv32iac-ilp32 rv32im-ilp32 rv32imac-ilp32 rv32imafc-ilp32f rv64imac-lp64 rv64gc-lp64d")],
+ [AC_SUBST(newlib_multilib_names,"$with_arch-$with_abi")])
-AS_IF([test "x$enable_multilib" != xno],
- [AC_SUBST(musl_multilib_names,"rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 rv64gc-lp64d")],
- [AC_SUBST(musl_multilib_names,"$with_arch-$with_abi")])
+AS_IF([test "x$enable_multilib" = xyes],
+ [AC_SUBST(musl_multilib_names,"rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 rv64gc-lp64d")],
+ [AC_SUBST(musl_multilib_names,"$with_arch-$with_abi")])
AC_ARG_ENABLE(gcc-checking,
- [AS_HELP_STRING([--enable-gcc-checking],
- [Enable gcc internal checking, it will make gcc very slow, only enable it when developing gcc @<:@--disable-gcc-checking@:>@])],
- [],
- []
- )
-AS_IF([test "x$enable_gcc_checking" != x],
- [AC_SUBST(gcc_checking, --enable-checking=$enable_gcc_checking)],
+ [AS_HELP_STRING([--enable-gcc-checking],
+ [Enable gcc internal checking, it will make gcc very slow, only enable it when developing gcc @<:@--disable-gcc-checking@:>@])])
+
+AS_IF([test "x$enable_gcc_checking" = xyes],
+ [AC_SUBST(gcc_checking, --enable-checking)],
[AC_SUBST(gcc_checking, "")])
AC_ARG_WITH(cmodel,
[AS_HELP_STRING([--with-cmodel],
[Select the code model to use when building libc and libgcc @<:@--with-cmodel=medlow@:>@])],
[],
- []
+ [with_cmodel=no]
)
-AS_IF([test "x$with_cmodel" != x],
+
+AS_IF([test "x$with_cmodel" != xno],
[AC_SUBST(cmodel, -mcmodel=$with_cmodel)],
[AC_SUBST(cmodel, -mcmodel=medlow)])
@@ -225,7 +209,7 @@ AC_CONFIG_FILES([scripts/wrapper/sed/sed], [chmod +x scripts/wrapper/sed/sed])
AC_ARG_WITH(host,
[AS_HELP_STRING([--with-host=x86_64-w64-mingw32],
- [Sets the host for the tools, you probably want nothing])],
+ [Sets the host for the tools, you probably want nothing])],
[],
[with_host=default]
)
@@ -257,10 +241,7 @@ AS_IF([test "x$with_guile" != xdefault],
AC_ARG_ENABLE(gdb,
[AS_HELP_STRING([--disable-gdb],
- [Don't build GDB, as it's not upstream])],
- [],
- [enable_gdb=yes]
- )
+ [Don't build GDB, as it's not upstream])])
AS_IF([test "x$enable_gdb" != xno],
[AC_SUBST(enable_gdb, --enable-gdb)],
@@ -268,24 +249,30 @@ AS_IF([test "x$enable_gdb" != xno],
AC_ARG_ENABLE(llvm,
[AS_HELP_STRING([--enable-llvm],
- [Build LLVM (clang)])],
- [enable_llvm=yes],
- []
- )
+ [Build LLVM (clang)])])
-AS_IF([test "x$enable_llvm" != xyes],
- [AC_SUBST(enable_llvm, --disable-llvm)],
- [AC_SUBST(enable_llvm, --enable-llvm)])
+AS_IF([test "x$enable_llvm" = xyes],
+ [AC_SUBST(enable_llvm, --enable-llvm)],
+ [AC_SUBST(enable_llvm, --disable-llvm)])
AC_ARG_ENABLE(host-gcc,
[AS_HELP_STRING([--enable-host-gcc],
- [Build host GCC to build cross toolchain])],
- [enable_host_gcc=yes],
- [])
+ [Build host GCC to build cross toolchain])])
+
+AS_IF([test "x$enable_host_gcc" = xyes],
+ [AC_SUBST(enable_host_gcc, --enable-host-gcc)],
+ [AC_SUBST(enable_host_gcc, --disable-host-gcc)])
+
+AC_ARG_ENABLE(strip,
+ [AS_HELP_STRING([--enable-strip],
+ [Strip debug symbols at install time])])
-AS_IF([test "x$enable_host_gcc" != xyes],
- [AC_SUBST(enable_host_gcc, --disable-host-gcc)],
- [AC_SUBST(enable_host_gcc, --enable-host-gcc)])
+AS_IF([test "x$enable_strip" = xyes],
+ [AC_SUBST(install_target, install-strip)],
+ [AC_SUBST(install_target, install)])
+
+AS_IF([test "x$enable_strip" = xyes],
+ [AC_SUBST(enable_strip_qemu, -Dstrip=true)])
AC_DEFUN([AX_ARG_WITH_SRC],
[{m4_pushdef([opt_name], with_$1_src)
@@ -325,23 +312,17 @@ AS_IF([test "x$with_linux_headers_src" != xdefault],
AC_ARG_ENABLE(libsanitizer,
[AS_HELP_STRING([--enable-libsanitizer],
- [Build libsanitizer, which only supports rv64])],
- [],
- [enable_libsanitizer=no]
- )
+ [Build libsanitizer, which only supports rv64])])
-AS_IF([test "x$enable_libsanitizer" != xno],
+AS_IF([test "x$enable_libsanitizer" = xyes],
[AC_SUBST(enable_libsanitizer, --enable-libsanitizer)],
[AC_SUBST(enable_libsanitizer, --disable-libsanitizer)])
AC_ARG_ENABLE(qemu_system,
[AS_HELP_STRING([--enable-qemu-system],
- [Build qemu with system-mode emulation])],
- [],
- [enable_qemu_system=no]
- )
+ [Build qemu with system-mode emulation])])
-AS_IF([test "x$enable_qemu_system" != xno],
+AS_IF([test "x$enable_qemu_system" = xyes],
[AC_SUBST(qemu_targets, [riscv64-linux-user,riscv32-linux-user,riscv64-softmmu,riscv32-softmmu])],
[AC_SUBST(qemu_targets, [riscv64-linux-user,riscv32-linux-user])])