make, improve build for devices using (open)dingux

This commit is contained in:
kub 2021-03-30 20:14:27 +02:00
parent 5d3b7ae27b
commit 40a7d177b2
3 changed files with 23 additions and 16 deletions

View file

@ -87,9 +87,11 @@ ifeq "$(PLATFORM)" "opendingux"
# TODO this should somehow go to the platform/opendingux directory? # TODO this should somehow go to the platform/opendingux directory?
.od_data: $(TARGET) .od_data: $(TARGET)
$(RM) -rf .od_data $(RM) -rf .od_data
cp -r platform/opendingux/data .od_data cp -r platform/opendingux/data/. .od_data
cp platform/game_def.cfg .od_data
cp $< .od_data/PicoDrive cp $< .od_data/PicoDrive
$(STRIP) .od_data/PicoDrive $(STRIP) .od_data/PicoDrive
.PHONY: .od_data
ifneq (,$(filter %__DINGUX__, $(CFLAGS))) ifneq (,$(filter %__DINGUX__, $(CFLAGS)))
# "legacy" dingux without opk support # "legacy" dingux without opk support

31
configure vendored
View file

@ -94,23 +94,25 @@ set_platform()
generic) generic)
;; ;;
dingux) dingux)
# dingoo a320, ritmix rzx-50, the like. all have ingenic MIPS cpus <= JZ4755 # dingoo a320, ritmix rzx-50, the like. all have Ingenic MIPS cpu <= JZ4755
sound_drivers="sdl" sound_drivers="sdl"
# use static linking since the lib situation is ... let's say vague
LDFLAGS="$LDFLAGS -static"
# uses a predecessor of opendingux # uses a predecessor of opendingux
CFLAGS="$CFLAGS -D__DINGUX__ -march=mips32 -msoft-float" CFLAGS="$CFLAGS -D__DINGUX__ -march=mips32 -msoft-float"
platform="opendingux" platform="opendingux"
;; ;;
retrofw) retrofw)
# devices using retrofw. AFAIK all have ingenic MIPS cpus JZ4760 with fpu # devices using retrofw. AFAIK all have Ingenic MIPS JZ4760 with fpu
sound_drivers="sdl" sound_drivers="sdl"
# uses it's own modified version of opendingux # uses it's own modified version of opendingux
CFLAGS="$CFLAGS -D__RETROFW__ -march=mips32" CFLAGS="$CFLAGS -D__RETROFW__ -march=mips32"
platform="opendingux" platform="opendingux"
;; ;;
opendingux | gcw0 | rg350) opendingux | gcw0 | rg350)
# more modern devices using opendingux, generally using cpus >= JZ4770 # more modern devices using opendingux, with Ingenic MIPS JZ4770 or newer
sound_drivers="sdl" sound_drivers="sdl"
# all are more or less based on opendingux. save device type as C define. # mostly based on opendingux for gcw0, save device type as C define.
CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__ -march=mips32r2" CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__ -march=mips32r2"
platform="opendingux" platform="opendingux"
;; ;;
@ -274,10 +276,7 @@ arm*)
fi fi
# add -ldl for helix support # add -ldl for helix support
case "$MAIN_LDLIBS" in need_dl=yes
*"-ldl"*) ;;
*) MAIN_LDLIBS="-ldl $MAIN_LDLIBS" ;;
esac
# warn about common mistakes # warn about common mistakes
if [ "$platform" != "gp2x" -a "$have_armv5" != "yes" ]; then if [ "$platform" != "gp2x" -a "$have_armv5" != "yes" ]; then
@ -386,11 +385,7 @@ case "$have_libavcodec" in
y|Y|yes) y|Y|yes)
if check_libavcodec; then if check_libavcodec; then
have_libavcodec="yes" have_libavcodec="yes"
# add -ldl if needed need_dl=yes
case "$MAIN_LDLIBS" in
*"-ldl"*) ;;
*) MAIN_LDLIBS="-ldl $MAIN_LDLIBS" ;;
esac
else else
have_libavcodec="no" have_libavcodec="no"
fi ;; fi ;;
@ -428,12 +423,22 @@ if [ "$need_sdl" = "yes" ]; then
fail "sdl-config is missing; please install libsdl (libsdl1.2-dev)" fail "sdl-config is missing; please install libsdl (libsdl1.2-dev)"
CFLAGS="$CFLAGS `$SDL_CONFIG --cflags`" CFLAGS="$CFLAGS `$SDL_CONFIG --cflags`"
MAIN_LDLIBS="`$SDL_CONFIG --libs` $MAIN_LDLIBS" MAIN_LDLIBS="`$SDL_CONFIG --libs` $MAIN_LDLIBS"
SYSLIBS="$SYSLIBS -ldl"
need_dl=yes
check_sdl `$SDL_CONFIG --libs` || fail "please install libsdl (libsdl1.2-dev)" check_sdl `$SDL_CONFIG --libs` || fail "please install libsdl (libsdl1.2-dev)"
if [ "$SDLVERSION" = "sdl2" ]; then if [ "$SDLVERSION" = "sdl2" ]; then
CFLAGS="$CFLAGS -D__USE_SDL2__" CFLAGS="$CFLAGS -D__USE_SDL2__"
fi fi
fi fi
# add -ldl if needed
if [ "$need_dl" = "yes" ]; then
case "$MAIN_LDLIBS" in
*"-ldl"*) ;;
*) MAIN_LDLIBS="$MAIN_LDLIBS -ldl" ;;
esac
fi
if check_option -Wno-unused_result; then if check_option -Wno-unused_result; then
CFLAGS="$CFLAGS -Wno-unused-result" CFLAGS="$CFLAGS -Wno-unused-result"
fi fi

View file

@ -58,7 +58,7 @@ const char * const _in_sdl_key_names[SDLK_LAST] = {
[SDLK_RIGHT] = "RIGHT", [SDLK_RIGHT] = "RIGHT",
[SDLK_LCTRL] = "A", [SDLK_LCTRL] = "A",
[SDLK_LALT] = "B", [SDLK_LALT] = "B",
#ifdef __GCW0__ #if defined(__GCW0__)
[SDLK_LSHIFT] = "X", [SDLK_LSHIFT] = "X",
[SDLK_SPACE] = "Y", [SDLK_SPACE] = "Y",
#else #else
@ -68,7 +68,7 @@ const char * const _in_sdl_key_names[SDLK_LAST] = {
[SDLK_RETURN] = "START", [SDLK_RETURN] = "START",
[SDLK_ESCAPE] = "SELECT", [SDLK_ESCAPE] = "SELECT",
#ifdef __RG350__ #if defined(__RG350__) || defined(__OPENDINGUX__)
[SDLK_HOME] = "POWER", [SDLK_HOME] = "POWER",
[SDLK_TAB] = "L1", [SDLK_TAB] = "L1",