Page 1 of 2

PCem build guide

Posted: Thu 29 Dec, 2016 7:43 am
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!

Re: PCem build guide

Posted: Wed 11 Jan, 2017 7:06 am
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.

Re: PCem build guide

Posted: Wed 11 Jan, 2017 7:33 am
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!

Re: PCem build guide

Posted: Sun 26 Feb, 2017 10:05 pm
by omarsis81
Is this guide for Windows? How do I open .lzma files?

Re: PCem build guide

Posted: Sun 26 Feb, 2017 10:36 pm
by dreamer
I use 7-zip, it opens lzma fine

Re: PCem build guide

Posted: Wed 01 Mar, 2017 4:11 am
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.

Re: PCem build guide

Posted: Fri 03 Mar, 2017 4:55 pm
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

Re: PCem build guide

Posted: Fri 03 Mar, 2017 6:45 pm
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.

Re: PCem build guide

Posted: Fri 03 Mar, 2017 7:34 pm
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

Re: PCem build guide

Posted: Tue 07 Mar, 2017 2:07 pm
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

Re: PCem build guide

Posted: Tue 18 Jul, 2017 8:36 pm
by ndavis82
Awesome guide! Thanks!!

Re: PCem build guide

Posted: Thu 20 Jul, 2017 12:43 am
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

Re: PCem build guide

Posted: Thu 20 Jul, 2017 8:24 am
by Battler
You need to create a configs directory in your PCem directory.

Re: PCem build guide

Posted: Thu 20 Jul, 2017 11:48 am
by dreamer
So just an empty 'configs' directory in the folder where pcem.exe is?

Re: PCem build guide

Posted: Thu 20 Jul, 2017 1:12 pm
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.

Re: PCem build guide

Posted: Thu 20 Jul, 2017 2:04 pm
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:

Re: PCem build guide

Posted: Thu 20 Jul, 2017 2:05 pm
by ndavis82
Battler wrote:You need to create a configs directory in your PCem directory.
That was it! Thanks!!

Re: PCem build guide

Posted: Thu 27 Jul, 2017 6:36 am
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.

Re: PCem build guide

Posted: Thu 27 Jul, 2017 6:41 am
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

Re: PCem build guide

Posted: Thu 27 Jul, 2017 8:09 am
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.

Re: PCem build guide

Posted: Thu 27 Jul, 2017 9:50 am
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

Re: PCem build guide

Posted: Thu 27 Jul, 2017 11:19 am
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"

Re: PCem build guide

Posted: Thu 27 Jul, 2017 1:46 pm
by Battler
You use / as directory separator in the MinGW shell, not \.

Re: PCem build guide

Posted: Thu 27 Jul, 2017 2:53 pm
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

Re: PCem build guide

Posted: Tue 01 Aug, 2017 4:47 pm
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

Re: PCem build guide

Posted: Tue 01 Aug, 2017 5:01 pm
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.

Re: PCem build guide

Posted: Tue 01 Aug, 2017 5:43 pm
by dreamer
Added info about compiling with networking, thanks basic2004!

Re: PCem build guide

Posted: Tue 01 Aug, 2017 5:58 pm
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

Re: PCem build guide

Posted: Tue 01 Aug, 2017 6:34 pm
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

Re: PCem build guide

Posted: Wed 02 Aug, 2017 8:50 am
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).