PCem build guide help needed

Discussion of development and patch submission.
Post Reply
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

PCem build guide help needed

Post by dreamer »

!!!! COMPLETED GUIDE HERE: https://pcem-emulator.co.uk/phpBB3/view ... ?f=3&t=597 !!!!

Hello everyone!

I have been following PCem for a while now and I think this project is really interesting, taking up a niche of software that seems to get forgotten by other emulation solutions. It's always nice to get a stable version to use, but at the same time it's nice to get the latest version, even if it's buggy or unstable. I am not very experienced in building software from source, but I do have enough knowledge in software to take it up. I was trying my hand at building DOSBox and I noticed it had a great guide on building it, even though not all details are there. I was meaning to write a similar guide for PCem, but I seem to get stuck at every point of the way.

From what I gather I should use TDM GCC envionment, use GCC v4.X and `make` with Makefile.mingw, but I seem to always get stuck on a wall of errors. It's always just bits of pieces of information, even though I scoured this forum for solutions. I'd love to package a collection of .zip files (same way DOSBox did) with all installation and library files needed to get a build of PCem going in an easy and accessible way!

I realize, it should be as easy as running `makefile -f Makefile.mingw` or `makefile -f Makefile.mingw64`, but what exactly should I run it on? It's really easy to install openal and ALUT on MSYS2, but then it throws up on the redeclarations that an old GCC version is supposed to solve, and yet there is no real way to get an old GCC version going there, and even then it's not everything. I tried original MinGW with MSYS, but it lacks a way to get all the needed Win32 headers. TDM GCC fails at running on my system, even though it has the required Win32 headers it lacks OpenAL and ALUT that should be build from source. Should I build everything from source? Does it make sense to run MSYS 2 in MINGW32 mode and compile an old gcc from source?

Thanks! :)
Last edited by dreamer on Wed 11 Jan, 2017 9:32 am, edited 2 times in total.
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: PCem build guide help needed

Post by leilei »

I compile my build with GCC 4.7.2 as provided with MinGW32. Getting TDM isn't necessary (and its automatic multithreading won't do any good for pcem anyway)

IIRC the dependencies were OpenAL and DirectX9 libs/headers
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide help needed

Post by dreamer »

So OK. Trying again I have installed MinGW with MSYS through MinGW-get (skipping GCC and G++ there). I manually installed the 4.7.2-1 versions of GCC and G++, also their required dependencies just to get them to run, they run OK. I also found the required Win32 headers and added them too, so the part I was stuck on works fine now. I also have added necessary .dll files for some floating point libs GCC was requiring, so GCC is all up and running.

I am looking into OpenAL and ALUT now. I have retrieved the source of ALUT and I believe I will just have to give it the good old "../configure make make install" spell, and it should just go. The problem is the OpenAL. I have installed the OpenAL SDK from openal.org, it contains the required headers, but it only has a .lib version of the library, not .a in there, so ALUT fails to compile with "symbol not found" errors if I try to adapt that. I also tried http://kcat.strangesoft.net/openal.html but it fails to compile even on the new GCC on another instance of MinGW. It's supposed to be a case of `cmake -G "MSYS Makefiles"; make; make install` but it fails immediately on the `make` part with some redefinition that comes from time.h. Which OpenAL is the correct one?

I should get the DirectX headers going since I did get the DirectX SDK and it contains all required files it seems.

So I managed to swipe a built OpenAL version from SFML since openal-soft didn't do what I wanted it to do and openal.org didn't have what I needed. I forked PCem repository, I'll add that zip file (and probably others too) there, so that they don't disappear. I think I have managed to pass OpenAL now, I'll work on adding DirectX lib now!

OH MY GOD I ACTUALLY DID IT AND IT ACTUALLY WORKS. Full, (relatively) easy to follow build guide coming soon! :33
Last edited by dreamer on Thu 29 Dec, 2016 3:11 pm, edited 2 times in total.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide help needed

Post by omarsis81 »

dreamer wrote:OH MY GOD I ACTUALLY DID IT AND IT ACTUALLY WORKS. Full, (relatively) easy to follow build guide coming soon! :33
Have you made that guide yet? :roll:
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide help needed

Post by dreamer »

I mention the guide in the first line of my first post in this thread! :)
Post Reply