]> Chaos Git - corbenik/corbenik.git/commitdiff
Re-add the build info menu
authorJon Feldman <chaos.kagami@gmail.com>
Sun, 5 Feb 2017 08:36:33 +0000 (03:36 -0500)
committerJon Feldman <chaos.kagami@gmail.com>
Sun, 5 Feb 2017 08:36:33 +0000 (03:36 -0500)
Makefile.am
boot/menu.c
common.mk
configure.ac

index 2af932acc3660070d663fce689acd4e3258ac19c..d9f537f19d4537efafd01a54854f079989cd8de8 100644 (file)
@@ -12,7 +12,7 @@ install:
        @echo "Please don't call the install target directly, it doesn't work."
        @exit 1
 
-all-local: external loader boot bits
+all-local: external loader boot bits patch
        mkdir -p out
        mkdir -p out@prefix@
        mkdir -p out@libdir@/module
index bec382c6d9d7779f66b627f54f3b6549dbe8499d..174366525a5c155558d8ce4e51a37cced9dc0cd2 100644 (file)
@@ -169,6 +169,21 @@ static struct options_s help_d[] = {
     { NULL, NULL, unselectable, 0, NULL, NULL, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
 };
 
+
+#define quote(x) #x
+#define string(x) quote(x)
+
+static struct options_s build_d[] = {
+    lnh("Build Info"),
+    ln ("  Commit hash"),
+    ln ("    " string(REVISION) " (" string(BRANCH) ")"),
+    ln ("  Compiler"),
+    ln ("    " string(COMPILER_ID) ),
+    ln ("  Build configuration" ),
+    ln ("    " string(CONFIGURE_OPTIONS) ),
+    { NULL, NULL, unselectable, 0, NULL, NULL, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
+};
+
 static struct options_s main_s[] = {
     { "Configuration",
       "Configuration options for the CFW.",
@@ -176,6 +191,9 @@ static struct options_s main_s[] = {
     { "Readme",
       "Mini-readme.\nWhy are you opening help on this, though?\nThat's kind of silly.",
       option, help_d, (void(*)(void*))show_menu, NULL, 0, 0 },
+    { "Build Info",
+      "Information such as GCC version for build, commit hash, flags, etc",
+      option, build_d, (void(*)(void*))show_menu, NULL, 0, 0 },
     { "Reboot",
       "Reboots the console.",
       option, 0, reset, NULL, 0, 0 },
index 538fabc61c0cfa322b90ef1c4de006d28ae9af81..735fe0419a62bfeb9dfe7a7fd93d51c96d9e4d02 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -4,7 +4,9 @@ C9FLAGS=-mcpu=arm946e-s -march=armv5te -mlittle-endian -mword-relocations
 
 SIZE_OPTIMIZATION = -Wl,--gc-sections -ffunction-sections
 
-REVISION := $(shell git rev-parse HEAD | head -c10)+$(shell git rev-list --count HEAD)
+REVISION := $(shell git rev-parse HEAD)
+COMMIT_COUNT := $(shell git rev-list --count HEAD)
+BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
 
 AM_CFLAGS= -std=gnu11 -Os -g -ffast-math \
        -Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual \
@@ -13,7 +15,7 @@ AM_CFLAGS= -std=gnu11 -Os -g -ffast-math \
        -Wshadow -Wsign-conversion -Wstrict-overflow=5 -Wswitch-default \
        -Wundef -Wno-unused -Werror -Wno-error=cast-align -Wno-error=strict-overflow -Wno-error=pedantic \
        $(THUMBFLAGS) $(SIZE_OPTIMIZATION) $(INCPATHS) $(C9FLAGS) \
-       -fno-builtin -std=gnu11 -DREVISION=\"$(REVISION)\" \
+       -fno-builtin -std=gnu11 -DREVISION=$(REVISION) -DBRANCH=$(BRANCH) -DCOMMIT_COUNT=$(COMMIT_COUNT) \
        -DFW_NAME=\"corbenik\" $(PATHARGS) -DMALLOC_DEBUG=1
 
 # -fsanitize=undefined
index cd9170872d41957c54860bf000d334c910794c23..449a2d23ce526f7ec1dd7cd537dbcf585468a508 100644 (file)
@@ -1,4 +1,7 @@
 AC_INIT([Corbenik], [0.3.0], [https://github.com/chaoskagami/corbenik], [corbenik])
+
+export CONFIGURE_OPTIONS="$@"
+
 AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects])
 
 # Find AR and RANLIB for lto support before initializing libtool
@@ -23,6 +26,11 @@ CHAINLOADER=1
 test "$enable_chainloader" = "no" && CHAINLOADER=0
 AC_DEFINE_UNQUOTED([CHAINLOADER], [$CHAINLOADER])
 
+COMPILER_ID="$($CC --version | head -n1)"
+AC_DEFINE_UNQUOTED([COMPILER_ID], [$COMPILER_ID])
+
+AC_DEFINE_UNQUOTED([CONFIGURE_OPTIONS], [$CONFIGURE_OPTIONS])
+
 AC_CONFIG_FILES([Makefile boot/Makefile external/Makefile include/Makefile])
 
 AC_CONFIG_SUBDIRS([external/libctr9])
@@ -47,5 +55,8 @@ ldflags:         ${LDFLAGS}
 ocflags:         ${OCFLAGS}
 
 Chainloader:     ${CHAINLOADER}
+
+Configure:       ${CONFIGURE_OPTIONS}
+Compiler ID:     ${COMPILER_ID}
 "