Github provides you with all sources:
https://github.com/libretro
You can get and compile the mednafen stuff with:
cd RetroPie/emulatorcores
git clone –depth=0 git://github.com/libretro/mednafen-libretro.git
cd mednafen-libretro
export FLAGS=”-march=armv6zk -mfpu=vfp -mfloat-abi=hard”
make platform=armv
There should be some libretto*.so file now. Otherwise compilation failed.
Start retroarch with your new core:
RetroPie/emulators/RetroArch/installdir/bin/retroarch -L
find RetroPie/emulatorcores/mednafen-libretro/ -name “*libretro*.so” | head -1--config $rootdir/configs/all/retroarch.cfg
Don’t no if it is working.