Haiku port?

Haiku is an open-source OS inspired by BeOS. It is probably the biggest and most promising “hobbyist” OS under development right now. You can visit its website here: http://www.haiku-os.org/

The system doesn’t have any console emulators under development at all right now. The console emulators that exist are extremely outdated and a lot of them barely work and/or are very lacking in features. libretro with its cores would absolutely smash every other emulator on Haiku. It could help the Haiku community a lot, and it could also give libretro/RetroArch a considerable amount of attention. While there is a lack of video drivers, Haiku’s VESA mode is very fast for what it is, and could probably be enough at least for some of the SNES cores.

What do you think?

Update: Code changes have been merged upstream. Now you can just git clone and compile.

Here is a screenshot of it running: http://img191.imageshack.us/img191/231/screenshot2ut.png

You can install SDL with installoptionalpackage. To get pkgconfig you need to install haikuporter (http://ports.haiku-files.org/wiki/Installation#Installation) and use it to install pkgconfig. I recommend doing this on a GCC4 build of Haiku.

If it has SDL and GCC, you can probably already compile RetroArch itself, and the libretro cores just need zlib and GCC. Do you have a working installation you could try it with?

If so, you might also try bsnes/higan, which can use SDL for everything, IIRC.

Sure, I’ll try compiling it myself. I’ll try following the instructions for Linux. I don’t have Haiku installed, but it doesn’t usually take a long time to install so I’ll do it right now. GCC and other GNU tools (zlib too I think) are included and I think it’s easy to install SDL.

I’m pretty sure I’ll run into errors though, but I guess I can just post them here then?

Sure. I’ll try to help any way I can. If it turns into a hassle waiting for responses here, you can also try hopping onto IRC and asking for help there. #ssnes and #retroarch on Freenode.

I managed to compile the desmume, gambatte, mednafen-wswan, stella and vba cores. Now I need to compile RetroArch too. I ran into a platform issue, and a pkg-config error:

~/libretro/libretro-super/RetroArch> ./configure Checking operating system … Win32 Checking for suitable working C compiler … /boot/develop/tools/gnupro/bin/gcc Checking for suitable working C++ compiler … /boot/develop/tools/gnupro/bin/g++ Checking for availability of switch -std=gnu99 in /boot/develop/tools/gnupro/bin/gcc … yes Checking for availability of switch -Wno-unused-result in /boot/develop/tools/gnupro/bin/gcc … yes Checking function bcm_host_init in -lbcm_host … no pkg-config not found. Exiting …

You need pkgconfig tool to detect libraries and stuff. Does Haiku not have this? That Win32 check could probably be … improved a bit. Software SDL is probably the only thing you’re going to get, but RetroArch has a custom scaler that is very fast at what it’s doing at least.

Yeah, I would’ve thought that it would mistake Haiku for *BSD or something, but Win32 was quite surprising. I’m pretty sure Haiku has pkgconfig, I just don’t know how to make RetroArch find it…

Now I’m just compiling so I’d just be happy if I get it to run. I will have to leave actual code improvements related to speed or usability up to developers.

I tried adding two things to ./configure, which got me further, but still not enough:

~/libretro/libretro-super/RetroArch> ./configure --prefix=/boot/common/ --target=i586-pc-haiku

Quickbuild script

Package: retroarch Version: 0.9.8-beta3

General environment variables: CC: C compiler CFLAGS: C compiler flags CXX: C++ compiler CXXFLAGS: C++ compiler flags LDFLAGS: Linker flags

General options: –prefix=$path: Install path prefix –host=HOST: cross-compile to build programs to run on HOST –help: Show this help

Custom options: –disable-dynamic: Disable dynamic loading of libretro library –enable-sdl: SDL support –disable-sdl –with-libretro: libretro library used –with-man_dir: Manpage install directory –enable-threads: Threading support –disable-threads –enable-ffmpeg: Enable FFmpeg recording support –disable-ffmpeg –enable-dylib: Enable dynamic loading support –disable-dylib –enable-netplay: Enable netplay support –disable-netplay –disable-configfile: Disable support for config file –disable-opengl: Disable OpenGL support –enable-gles: Use GLESv2 instead of desktop GL –enable-x11: Disable everything X11. –disable-x11 –enable-xinerama: Disable Xinerama support. –disable-xinerama –enable-kms: Enable KMS context support –disable-kms –enable-egl: Enable EGL context support –disable-egl –enable-vg: Enable OpenVG support –disable-vg –enable-cg: Enable Cg shader support –disable-cg –enable-xml: Enable bSNES-style XML shader support –disable-xml –enable-fbo: Enable render-to-texture (FBO) support –disable-fbo –enable-alsa: Enable ALSA support –disable-alsa –enable-oss: Enable OSS support –disable-oss –enable-rsound: Enable RSound support –disable-rsound –enable-roar: Enable RoarAudio support –disable-roar –enable-al: Enable OpenAL support –disable-al –enable-jack: Enable JACK support –disable-jack –enable-coreaudio: Enable CoreAudio support –disable-coreaudio –enable-pulse: Enable PulseAudio support –disable-pulse –enable-freetype: Enable FreeType support –disable-freetype –enable-xvideo: Enable XVideo support –disable-xvideo –enable-sdl_image: Enable SDL_image support –disable-sdl_image –enable-libpng: Enable libpng support –disable-libpng –enable-python: Enable Python 3 support for shaders –disable-python –disable-sinc: Disable SINC resampler –disable-bsv_movie: Disable BSV movie support ~/libretro/libretro-super/RetroArch> make Makefile:1: config.mk: No such file or directory config.mk is outdated or non-existing. Run ./configure again. make: *** [config.mk] Error 1

I downloaded a Haiku VM onto my machine at work, so I’ll try to work on this some tomorrow.

–target is not valid. Remember, this is NOT autotools.

@Maister: Hmm, well then I don’t know what to do. Let’s hope that hunterk finds something…

No luck here. I tried passing it different path variables, etc, but it still won’t find pkgconfig. I considered taking a config.mk and config.h from a linux box and modifying it by hand, but that would be a big pain in my butt…

For fun, I tried compiling an older version of bsnes (v081) to see if it fared any better and it immediately choked on nall. No big surprise there. I might try some even older versions later on to see how they fare, but I doubt I’ll see much success, if for no other reason than the lack of reliable Qt/Gtk.

Did you use a GCC4 build of Haiku? The official alphas use GCC2, and you probably won’t get anything to compile with that. You can get a nightly image here: http://www.haiku-files.org/

If that wasn’t the issue then I don’t know. I’m not a programmer and I’m not skilled with compiling. But yeah, I don’t think there’s much point in trying to get any of the existing GUIs working before anything else. It’s probably better to just get an SDL port working first, and then perhaps do GUI and platform-specific stuff.

lol yeah, I started with the official image and it errored out with “can’t do --std-gnu99” or whatever :open_mouth:

Once I moved to the GCC4 build, I was able to get a little farther but still couldn’t get it to find pkgconfig.

I did the same mistake, lol.

I started a thread about this error on the Haiku website: https://www.haiku-os.org/node/4996

Perhaps someone over there can figure something out for us.

I used haikuporter to install pkgconfig and now I get further. How do I make it find libretro?

~/libretro/libretro-super/RetroArch> ./configure --prefix=/boot/common/ Checking operating system … Win32 Checking for suitable working C compiler … /boot/develop/tools/gnupro/bin/gcc Checking for suitable working C++ compiler … /boot/develop/tools/gnupro/bin/g++ Checking for availability of switch -std=gnu99 in /boot/develop/tools/gnupro/bin/gcc … yes Checking for availability of switch -Wno-unused-result in /boot/develop/tools/gnupro/bin/gcc … yes Checking function bcm_host_init in -lbcm_host … no Checking for pkg-config … /boot/common/bin/pkg-config Checking presence of package egl … no Checking existence of -lEGL … no Checking function pthread_create in -lpthread … no Checking function dlopen in -ldl … no Checking function socket in -lc … no Checking function fcntl in -lc … no Checking function getopt_long in -lc … no Dynamic loading of libretro is enabled, but your platform does not appear to have dlopen(), use --disable-dynamic or --with-libretro="-lretro". ~/libretro/libretro-super/RetroArch> ./configure --prefix=/boot/common/ --disable-dynamic Checking operating system … Win32 Checking for suitable working C compiler … /boot/develop/tools/gnupro/bin/gcc Checking for suitable working C++ compiler … /boot/develop/tools/gnupro/bin/g++ Checking for availability of switch -std=gnu99 in /boot/develop/tools/gnupro/bin/gcc … yes Checking for availability of switch -Wno-unused-result in /boot/develop/tools/gnupro/bin/gcc … yes Checking function bcm_host_init in -lbcm_host … no Checking for pkg-config … /boot/common/bin/pkg-config Checking presence of package egl … no Checking existence of -lEGL … no Checking function retro_init in -lretro … no Cannot find libretro.

You’ll need to have some sort of libretro.so library installed into your libs directory, I believe.

I tried putting libretro.so and libretro-vba.so from the libretro-vba directory into /boot/common/lib but it didn’t change anything.

Since it thinks it’s Win32, you might try renaming (or at least symlinking) your libretro.so to retro.dll.

Did nothing. Anyway, I managed to remove the dlopen error by installing this: http://haikuware.com/directory/view-details/development/class-libraries/libdlso

Still getting issues though.

I’ll probably get on a Haiku IRC channel and try to get help there if I can’t fix this.