PCem build guide

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

PCem build guide

Post by dreamer »

We will install MinGW as a build environment.

$ROOT refers to directory where MinGW is installed
~ refers to home directory of MSYS ($ROOT\msys\1.0\home\$USERNAME\)

All mentioned files are contained in reqs\ folder of https://bitbucket.org/svajoklis/pcem/src which is a fork of PCem I did for the kicks. Files mentioned are in svajoklis_repack branch.

============== MINGW ==============

From
> https://sourceforge.net/projects/mingw/files/
Download
> mingw-get-setup.exe

Open up the installer and mark these for installation from the "Basic Setup":
> mingw-developer-tools
> mingw32-base
> mingw32-gcc-g++
> msys-base

!! IMPORTANT !! Actually install marked packages by selecting "Apply changes".

Mark these for removal in "All packages" (bin, lic, src variants):
> mingw32-gcc
> mingw32-gcc-g++

Apply changes.

============== MINGW manual packages ==============

We'll manualy install GCC!

From
> Source: https://sourceforge.net/projects/mingw/ ... c-4.7.2-1/
Download
> gcc-core-4.7.2-1-mingw32-bin.tar.lzma
> gcc-c++-4.7.2-1-mingw32-bin.tar.lzma

We will also need some other manual MinGW packages:

From
> https://sourceforge.net/projects/mingw/ ... r-2.4.1-1/
Download
> libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma

From
> https://sourceforge.net/projects/mingw/ ... c-0.8.1-1/
Download
> libmpc-0.8.1-1-mingw32-dll-2.tar.lzma

From
> https://sourceforge.net/projects/mingw/ ... 2api-3.18/
Download
> w32api-3.18.2-mingw32-dev.tar.xz

Extract all downloaded archives to $ROOT (so that contained bin, include, etc. folders match the ones in $ROOT).

============== CMake ===============

From
> https://cmake.org/download/
Download
> CMake installer for Your architecture (x86-64 or x86, this has no relation to MinGW, just Your system)

Install CMake to a location of Your choosing. Make sure You either mark "Add to PATH" in installer or extend the PATH variable in MinGW shell Yourself by typing (or adding to Your .bash_profile if You want it to stick between sessions)

Code: Select all

$ PATH=$PATH:/c/Program Files/CMake/bin
We have installed all MinGW prerequisites. We will now install some outer dependencies, that is OpenAL, and DirectX.

============== OpenAL ==============

From
> http://openal.org/downloads/
Download
> OpenAL SDK.

Install it to default dir and navigate there.
Copy include\ folder to $ROOT.
Copy libs\win32\OpenAL32.lib to $ROOT\lib\libopenal32.a (notice the rename)

============== DirectX ==============

From
> http://liballeg.org/download.html
Download
> dx9mgw.zip

Extract files same as previous ones to $ROOT.

============== WinPcap networking ===========

IF You want networking capabilities:

From
> https://www.winpcap.org/devel.htm
Download
> WinPcap 4.1.2 Developer's Pack

Extract include directory to your /include directory.
Extract lib/libpacket.a and lib/libwpcap.a to your /lib directory.
Make sure -DUSE_NETWORKING is defined in C_FLAGS in Your makefile.

============== Get PCem source ==============

Download PCem source code using Your favourite hg client and put it to ~\pcem so that pcem\ contains README.

============== Compile PCem ==============

In
> ~\pcem\src
Run

Code: Select all

$ make -f Makefile.mingw
There is a heckload of warnings, but it should complete fine.

============== Install PCem ==============

Download the latest PCem from PCem homepage.
Copy pcem.exe You built from ~\pcem\src\
Create 'configs' folder in the same folder where You put the .exe
Run.

========================================

I'm concerned about the dx library swiped from Allegro, but if it's good enough for them, it's good enough for me!
Last edited by dreamer on Thu 03 Aug, 2017 7:56 am, edited 11 times in total.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: PCem build guide

Post by szadycbr »

Thank You very much, this Guide actually gets me going and so far every version works ok, there is no errors during compilation, only quite a bit of warnings .
Now i can build version with every CPU speed like MMX 115mhz, etc, i always was a overclocker,and its nice to see that i can do this now, and 486dx4 200Mhz is still slower that pentium 100.
The guide is very clear but as a nob i had few hickups, cos i had no clue what i do, for example i could not make freealut with "cmake -G "MSYS Makefiles" cos i m a nob and did not know that i have to make Cmake available in msys by setting the path in msys by " PATH=$PATH:/c/CMake/bin" i tried to use Cmake in windows shell, of course it didnt work.
For any nob trying to follow the guide and have a problem with freealut from source, dont forget to make Cmake avaliable in msys by above method.
I know that for You guys it is pretty obvious, but there are people who really have no clue what to do , but they really want to and now i can actually start to learn what the source code is about.
Thank you.
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide

Post by dreamer »

Hey, szadycbr, I'm glad I could help! It's strange, that CMake was not available if You did the switcheroo of the packages I described at the start of the guide. It seems, that You ended up using another CMake installation that You already had on Your system, which is fine :3

Welp, it seems, that I did too! Oh dear oh dear, have to update the guide!
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

Is this guide for Windows? How do I open .lzma files?
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide

Post by dreamer »

I use 7-zip, it opens lzma fine
A. Naim
Posts: 139
Joined: Thu 09 Jul, 2015 5:06 pm

Re: PCem build guide

Post by A. Naim »

dreamer wrote:I use 7-zip, it opens lzma fine
I haven't gone off and done any real research, but I haven't run into any common compression format that 7-zip won't open, so it's pretty much my go-to for that.

For Linux, it's command-line only, though.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

Hi dreamer!

I'm trying to follow step by step, here what I'm stuck for the moment. Please help!

- I didn't remove mingw32-gcc-g++ because that's the exact same file you asked to install in the previous step! I didn't remove mingw32-gcc either...

- I've read OpenAL is no longer part of PCem, so I didn't install it yet. Is that true?

- I'm unable to locate the file dx9mgw.zip.
You said it was removed from the Allegro library... so... Do I need to install Allegro? Which file?

Thank you for bearing with me :D
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: PCem build guide

Post by szadycbr »

the dx9mgw.zip is there, on the link from Dreamer, just must press "browse all files" , the go "parent dir" , then "files" and its there ,near the bottom. You dont bother to look deeper? http://download.gna.org/allegro/files/
and dont skip things, cos the guide is to follow in full, not by taking shortcuts. anyway , wait for Dreamer response. sorry for poking my nose in question not adressed to me.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

szadycbr wrote:the dx9mgw.zip is there, on the link from Dreamer, just must press "browse all files" , the go "parent dir" , then "files" and its there ,near the bottom. You dont bother to look deeper? http://download.gna.org/allegro/files/
and dont skip things, cos the guide is to follow in full, not by taking shortcuts. anyway , wait for Dreamer response. sorry for poking my nose in question not adressed to me.
Thank you szadycbr! Anyone's help is much appreciated
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

Oh boy! I finally did it!
I´m very happy!
I had some troubles locating al.h, but I finally managed it
Dreamer you have my eternal gratitude.
Thank you for taking the time in writing this guide
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: PCem build guide

Post by ndavis82 »

Awesome guide! Thanks!!
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: PCem build guide

Post by ndavis82 »

Can someone please tell me what I'm missing here?... I followed the instructions to the letter and I was able to get PCem.exe compiled, but when I click on it I see the PCem Configuration Manager and it won't go any further. None of the buttons work except New and Quit, and clicking on New will allow me to create a new configuration file, but it just goes back to that blank screen. Did I miss something in the compile?

Image
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: PCem build guide

Post by Battler »

You need to create a configs directory in your PCem directory.
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide

Post by dreamer »

So just an empty 'configs' directory in the folder where pcem.exe is?
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: PCem build guide

Post by szadycbr »

Hi dreamer , in windows probably yes or where PCem Path's are assigned , cos lots change with new config method.
I like the new thing very much, using linux created /.pcem directory with all subfolders and after compiling PCem it runs no problem from src folder, no need to even copy it.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

dreamer wrote:So just an empty 'configs' directory in the folder where pcem.exe is?
That's right.
PCem should make that folder automatically if it doesn't exist. It is the easiest bug to fix, but it hasn't been address yet :shock:
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: PCem build guide

Post by ndavis82 »

Battler wrote:You need to create a configs directory in your PCem directory.
That was it! Thanks!!
Katakis
Posts: 118
Joined: Thu 05 Mar, 2015 6:42 am

Re: PCem build guide

Post by Katakis »

szadycbr wrote:the dx9mgw.zip is there, on the link from Dreamer, just must press "browse all files" , the go "parent dir" , then "files" and its there ,near the bottom. You dont bother to look deeper? http://download.gna.org/allegro/files/
and dont skip things, cos the guide is to follow in full, not by taking shortcuts. anyway , wait for Dreamer response. sorry for poking my nose in question not adressed to me.
That link you posted is dead, and all the other links that point to dx9mgw.zip are also dead.
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: PCem build guide

Post by ndavis82 »

Katakis wrote:
szadycbr wrote:the dx9mgw.zip is there, on the link from Dreamer, just must press "browse all files" , the go "parent dir" , then "files" and its there ,near the bottom. You dont bother to look deeper? http://download.gna.org/allegro/files/
and dont skip things, cos the guide is to follow in full, not by taking shortcuts. anyway , wait for Dreamer response. sorry for poking my nose in question not adressed to me.
That link you posted is dead, and all the other links that point to dx9mgw.zip are also dead.
As stated in the OP, all files can be downloaded from here:

https://bitbucket.org/svajoklis/pcem/sr ... lis_repack
Katakis
Posts: 118
Joined: Thu 05 Mar, 2015 6:42 am

Re: PCem build guide

Post by Katakis »

Thanks, but the last of the instructions, where you type $ make -f Makefile.mingw doesn't work. Does the command only apply to Linux, or does dreamer mean cmake -f?

If so, it says it is expecting a directory, not a file.
szadycbr
Posts: 295
Joined: Mon 21 Nov, 2016 6:23 pm

Re: PCem build guide

Post by szadycbr »

The command You use is fine, but are you trying from minGW shell or windows shell? remember to set patch $ PATH=$PATH:/c/Program Files/CMake/bin
Katakis
Posts: 118
Joined: Thu 05 Mar, 2015 6:42 am

Re: PCem build guide

Post by Katakis »

szadycbr wrote:are you trying from minGW shell or windows shell? remember to set patch $ PATH=$PATH:/c/Program Files/CMake/bin
I have done that in MinGW shell, but executing ~\pcem\src to change directory to the /src folder results in "~pcemsrc: command not found"
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: PCem build guide

Post by Battler »

You use / as directory separator in the MinGW shell, not \.
ndavis82
Posts: 47
Joined: Sun 25 Dec, 2016 5:54 am

Re: PCem build guide

Post by ndavis82 »

Katakis wrote:
szadycbr wrote:are you trying from minGW shell or windows shell? remember to set patch $ PATH=$PATH:/c/Program Files/CMake/bin
I have done that in MinGW shell, but executing ~\pcem\src to change directory to the /src folder results in "~pcemsrc: command not found"
To change to the /src directory from your home folder (~) you type:
cd pcem/src

Then run make:
make -f makefile.mingw
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

ndavis82 wrote: Then run make:
make -f makefile.mingw
Any idea how to compile PCem with Networking capability? It doesn't seem to work this way
basic2004
Posts: 124
Joined: Sun 08 Jan, 2017 5:59 pm

Re: PCem build guide

Post by basic2004 »

omarsis81 wrote:
ndavis82 wrote: Then run make:
make -f makefile.mingw
Any idea how to compile PCem with Networking capability? It doesn't seem to work this way
Let's download WinPcap 4.1.2 Developer's Pack
https://www.winpcap.org/devel.htm
Extract Include directory to your mingw32/include directory
and extract lib/libpacket.a and lib/libwpcap.a to your mingw32/lib directory.
and compile network version.
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide

Post by dreamer »

Added info about compiling with networking, thanks basic2004!
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

Thank you basic2004! It compiles great now! I get a slight larger EXE than normal, but I still can't see the Network card. I guess I'm missing the BIOS
basic2004
Posts: 124
Joined: Sun 08 Jan, 2017 5:59 pm

Re: PCem build guide

Post by basic2004 »

omarsis81 wrote:Thank you basic2004! It compiles great now! I get a slight larger EXE than normal, but I still can't see the Network card. I guess I'm missing the BIOS
If you want to use Pcap, download Win10Pcap from here.
This supports Windows 10/8/7.
http://www.win10pcap.org/download/

if you use Windows XP or Vista, download from here.
https://www.winpcap.org/install/default.htm
User avatar
ender
Posts: 51
Joined: Tue 14 Oct, 2014 12:51 pm

Re: PCem build guide

Post by ender »

For recent Windows versions there's also npcap, which seems a bit better maintained than winpcap/win10pcap (just make sure to install it in winpcap-compatibility mode).
Post Reply