From 5f539b2dafd7c28a7674aa59cbc165527da69f1b Mon Sep 17 00:00:00 2001 From: Daniel Li Date: Tue, 26 Nov 2024 07:27:17 +0800 Subject: [PATCH] Use native build instead of x86/jetson target Discussion: [ Ignore msposd_jetson for gs on jetson orin #29 ](https://github.com/OpenIPC/msposd/pull/29) --- .gitignore | 3 +-- Makefile | 11 ++--------- build.sh | 17 ++++++++--------- osd/util/Render_x86.c | 2 +- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 1caa861..39e32b2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,4 @@ msposd_goke msposd_hisi msposd_star6b0 msposd_star6e -msposd_x86 -serial_monitor.c \ No newline at end of file +serial_monitor.c diff --git a/Makefile b/Makefile index f5a1768..92fda80 100644 --- a/Makefile +++ b/Makefile @@ -45,17 +45,10 @@ star6e: version.h $(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys -lmi_venc) $(BUILD) -jetson: version.h - $(eval SDK = ./sdk/gk7205v300) - $(eval CFLAGS += -D_x86 -D_jetson) - $(eval LIB = -lcsfml-graphics -lcsfml-window -lcsfml-system `pkg-config --libs cairo x11` -lm) - $(eval BUILD = $(CC) $(SRCS) -I $(SDK)/include -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT)) - $(BUILD) - -x86: version.h +native: version.h $(eval SDK = ./sdk/gk7205v300) $(eval CFLAGS += -D_x86) $(eval LIB = -lcsfml-graphics -lcsfml-window -lcsfml-system `pkg-config --libs cairo x11` -lm) - $(eval BUILD = $(CC) $(SRCS) -I $(SDK)/include -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT)) $(BUILD) + diff --git a/build.sh b/build.sh index 40ebba2..21722fb 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,10 @@ #!/bin/bash DL="https://github.com/OpenIPC/firmware/releases/download/toolchain/toolchain" +if [ "$#" -ne 1 ]; then + echo "Usage: $0 [goke|hisi|star6b0|star6e|native]" + exit 1 +fi if [[ "$1" == *"star6b0" ]]; then CC=sigmastar-infinity6b0 @@ -13,15 +17,16 @@ elif [[ "$1" == *"hisi" ]]; then fi GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc -OUT=msposd_$1 +OUT=msposd -if [[ "$1" != *"jetson"* && "$1" != *"x86"* ]]; then +if [[ "$1" != *"native"* ]]; then if [ ! -e toolchain/$CC ]; then wget -c -q --show-progress $DL.$CC.tgz -P $PWD mkdir -p toolchain/$CC tar -xf toolchain.$CC.tgz -C toolchain/$CC --strip-components=1 || exit 1 rm -f $CC.tgz fi + OUT=msposd_$1 fi @@ -41,13 +46,7 @@ elif [ "$1" = "star6b0" ]; then elif [ "$1" = "star6e" ]; then DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6e/files/lib make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1 -elif [ "$1" = "jetson" ]; then - DRV=$PWD - make DRV=$DRV OUTPUT=$OUT $1 -elif [ "$1" = "x86" ]; then +else DRV=$PWD make DRV=$DRV OUTPUT=$OUT $1 -else - echo "Usage: $0 [goke|hisi|star6b0|star6e|jetson|x86]" - exit 1 fi diff --git a/osd/util/Render_x86.c b/osd/util/Render_x86.c index 4bc010c..a49942b 100644 --- a/osd/util/Render_x86.c +++ b/osd/util/Render_x86.c @@ -75,7 +75,7 @@ int Init_x86(uint16_t *width, uint16_t *height) { #endif -#ifdef _jetson +#ifdef _x86 if (getenv("DISPLAY") == NULL) { /* * Use default display screen, especially launch from console