From: kub Date: Tue, 30 Mar 2021 18:14:27 +0000 (+0200) Subject: make, improve build for devices using (open)dingux X-Git-Tag: v2.00~569 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40a7d177b212e945565868a8378ea78dc50220eb;p=picodrive.git make, improve build for devices using (open)dingux --- diff --git a/Makefile b/Makefile index 2a874637..cf1824d5 100644 --- a/Makefile +++ b/Makefile @@ -87,9 +87,11 @@ ifeq "$(PLATFORM)" "opendingux" # TODO this should somehow go to the platform/opendingux directory? .od_data: $(TARGET) $(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 $(STRIP) .od_data/PicoDrive +.PHONY: .od_data ifneq (,$(filter %__DINGUX__, $(CFLAGS))) # "legacy" dingux without opk support diff --git a/configure b/configure index 580ec0ca..74202070 100755 --- a/configure +++ b/configure @@ -94,23 +94,25 @@ set_platform() generic) ;; 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" + # use static linking since the lib situation is ... let's say vague + LDFLAGS="$LDFLAGS -static" # uses a predecessor of opendingux CFLAGS="$CFLAGS -D__DINGUX__ -march=mips32 -msoft-float" platform="opendingux" ;; 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" # uses it's own modified version of opendingux CFLAGS="$CFLAGS -D__RETROFW__ -march=mips32" platform="opendingux" ;; 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" - # 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" platform="opendingux" ;; @@ -274,10 +276,7 @@ arm*) fi # add -ldl for helix support - case "$MAIN_LDLIBS" in - *"-ldl"*) ;; - *) MAIN_LDLIBS="-ldl $MAIN_LDLIBS" ;; - esac + need_dl=yes # warn about common mistakes if [ "$platform" != "gp2x" -a "$have_armv5" != "yes" ]; then @@ -386,11 +385,7 @@ case "$have_libavcodec" in y|Y|yes) if check_libavcodec; then have_libavcodec="yes" - # add -ldl if needed - case "$MAIN_LDLIBS" in - *"-ldl"*) ;; - *) MAIN_LDLIBS="-ldl $MAIN_LDLIBS" ;; - esac + need_dl=yes else have_libavcodec="no" fi ;; @@ -428,12 +423,22 @@ if [ "$need_sdl" = "yes" ]; then fail "sdl-config is missing; please install libsdl (libsdl1.2-dev)" CFLAGS="$CFLAGS `$SDL_CONFIG --cflags`" 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)" if [ "$SDLVERSION" = "sdl2" ]; then CFLAGS="$CFLAGS -D__USE_SDL2__" 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 CFLAGS="$CFLAGS -Wno-unused-result" fi diff --git a/platform/opendingux/inputmap.c b/platform/opendingux/inputmap.c index 7db293ca..7c8c348f 100644 --- a/platform/opendingux/inputmap.c +++ b/platform/opendingux/inputmap.c @@ -58,7 +58,7 @@ const char * const _in_sdl_key_names[SDLK_LAST] = { [SDLK_RIGHT] = "RIGHT", [SDLK_LCTRL] = "A", [SDLK_LALT] = "B", -#ifdef __GCW0__ +#if defined(__GCW0__) [SDLK_LSHIFT] = "X", [SDLK_SPACE] = "Y", #else @@ -68,7 +68,7 @@ const char * const _in_sdl_key_names[SDLK_LAST] = { [SDLK_RETURN] = "START", [SDLK_ESCAPE] = "SELECT", -#ifdef __RG350__ +#if defined(__RG350__) || defined(__OPENDINGUX__) [SDLK_HOME] = "POWER", [SDLK_TAB] = "L1",