Skip to content

Commit

Permalink
Merge pull request #331 from sifive/segger-libc
Browse files Browse the repository at this point in the history
Add support for Segger libc
  • Loading branch information
nategraff-sifive authored Aug 31, 2020
2 parents 90b4d80 + ad3082f commit 0ba18c5
Show file tree
Hide file tree
Showing 9 changed files with 402 additions and 7 deletions.
17 changes: 17 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@ libmetal_pico_a_SOURCES = \

endif # WITH_BUILTIN_LIBMETAL_PICO


########################################################
# libsegger
########################################################

# Provide segger hook with Freedom Metal that is built when
# --with-builtin-libmetal-segger is passed to configure
if WITH_BUILTIN_LIBMETAL_SEGGER

lib_LIBRARIES += libmetal-segger.a

libmetal_segger_a_SOURCES = \
gloss/crt0.S \
segger/SEGGER_target_metal.c

endif # WITH_BUILTIN_LIBMETAL_SEGGER

########################################################
# libgloss
########################################################
Expand Down
51 changes: 45 additions & 6 deletions Makefile.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ AC_ARG_WITH([builtin-libmetal-pico],
[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])],
[],
Expand All @@ -68,6 +74,8 @@ 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")],
Expand Down
3 changes: 2 additions & 1 deletion metal/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#define METAL__TIME_H

#include <time.h>

#ifndef __SEGGER_LIBC__
#include <sys/time.h>
#endif

/*!
* @file time.h
Expand Down
Loading

0 comments on commit 0ba18c5

Please sign in to comment.