FreeRTOS-Kernel/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_FreedomStudio/freedom-metal/configure.ac
Gaurav-Aggarwal-AWS 2fedeff332
Update BSP and SDK for HiFive board (#645)
* Update BSP and SDK for HiFive board

This commit also adds demo start and success/failure output messages.
2021-07-15 18:40:22 -07:00

97 lines
3.5 KiB
Text

# The name, version, and maintainer of this package
AC_INIT([freedom-metal], [m4_esyscmd_s([./scripts/git-version])], [https://github.com/sifive/freedom-metal/issues], [freedom-metal], [https://github.com/sifive/freedom-metal])
# Initializes automake, enabling maintainer mode by default (which should be
# disabled by the archive generated by "make dist").
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE([disable])
AC_CONFIG_MACRO_DIRS([m4])
AC_CANONICAL_HOST
# Probe for tools that we need in order to build.
AC_PROG_CC
AC_PROG_RANLIB
AM_PROG_AR
AM_PROG_AS
# autoconf tries very hard to avoid failing, so it'll even go ahead and try to
# build the project using "gcc" if it can't find a suitable C compiler prefixed
# by the host system. This doesn't work when cross compiling, but it's a
# common error for users so we explicitly check for this right here to quickly
# provide an error message.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[
#ifndef __riscv
# error "A RISC-V compiler is required to build Freedom Metal"
#endif
])], [], [AC_MSG_FAILURE([The C compiler doesn't define __riscv, which means it's probably not a RISC-V compiler. You should specify something like --host=riscv64-sifive-elf when building this, as it will only work on RISC-V systems.])])
########################################################
# Options
########################################################
AC_ARG_WITH([builtin-libgloss],
[AS_HELP_STRING([--with-bultin-libgloss], [Build libgloss along with Metal])],
[with_builtin_libgloss="yes"],
[with_builtin_libgloss="no"]
)
AC_ARG_WITH([builtin-libmetal-pico],
[AS_HELP_STRING([--with-bultin-libmetal-pico], [Build libmetal-pico along with Metal])],
[with_builtin_libmetal_pico="yes"],
[with_builtin_libmetal_pico="no"]
)
AC_ARG_WITH([builtin-libmetal-segger],
[AS_HELP_STRING([--with-bultin-libmetal-segger], [Build libmetal-segger along with Metal])],
[with_builtin_libmetal_segger="yes"],
[with_builtin_libmetal_segger="no"]
)
AC_ARG_WITH([machine-header],
[AS_HELP_STRING([--with-machine-header=PATH], [Path to the machine header file])],
[],
[with_machine_header="no"]
)
AC_ARG_WITH([machine-inline],
[AS_HELP_STRING([--with-machine-inline=PATH], [Path to the machine inline file])],
[],
[with_machine_inline="no"]
)
AC_ARG_WITH([platform-header],
[AS_HELP_STRING([--with-platform-header=PATH], [Path to the platform header file])],
[],
[with_platform_header="no"]
)
########################################################
# Process Options
########################################################
AM_CONDITIONAL([WITH_BUILTIN_LIBGLOSS], [test "x$with_builtin_libgloss" = "xyes"])
AM_CONDITIONAL([WITH_BUILTIN_LIBMETAL_PICO], [test "x$with_builtin_libmetal_pico" = "xyes"])
AM_CONDITIONAL([WITH_BUILTIN_LIBMETAL_SEGGER], [test "x$with_builtin_libmetal_segger" = "xyes"])
# Configure the build system to pass in the preconfigured machine support files
AS_IF([test "x$with_machine_header" != "xno"],
[AC_SUBST([MACHINE_HEADER], "$with_machine_header")],
[AC_MSG_FAILURE([--with-machine-header is required])]
)
AS_IF([test "x$with_machine_inline" != "xno"],
[AC_SUBST([MACHINE_INLINE], "$with_machine_inline")],
[AC_MSG_FAILURE([--with-machine-inline is required])]
)
AS_IF([test "x$with_platform_header" != "xno"],
[AC_SUBST([PLATFORM_HEADER], "$with_platform_header")],
[AC_MSG_FAILURE([--with-platform-header is required])]
)
# Generates the remainder of the build system.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT