Rebuilding native libraries

Started by monkey0506, Sat 20/09/2014 19:17:49

Previous topic - Next topic

monkey0506

I've been looking to rebuild the native libraries (alfont_mt.lib, alleg_s_crt.lib, ddraw.lib, etc.). I'm just curious, does anyone have an exhaustive list of what is needed to rebuild the libraries?

Crimson Wizard

#1
I do not think you really should rebuild ddraw.lib, AFAIK it should be taken from DirectX SDK. The fact that we have it in repository is... strange.
And dinput, and dsound, and dxguid... weird.

AL* libs are either part of Allegro 4, or 3rd party libs accompanying Allegro 4.
I think the recent allegro sources (including community patches) are here: http://alleg.sourceforge.net/git.html
(you need 4.4 branch).

Others should be found in the webs.

Crimson Wizard


UPD
OGG vorbis and Theora:
http://xiph.org/downloads/
+ libogg
+ libvorbis
+ libtheora
Note: their names are different (were changed perhaps) having a "lib" prefix.
We need to build projects with "_static" word (as statically linked libs).

The libs should be compiled with /MT option (Multithreaded static C runtime library), otherwise there will be linker errors when building engine with them.

Crimson Wizard

#3
I am finally(!) working on removing prebuilt libs to enable compiling all from sources, which would let us move to any Visual Studio we want on Windows.

Work so far:
https://github.com/ivan-mogilko/ags-refactoring/commits/win-libraries

Most prebuilt libraries did not cause problems, while for Allegro I had to create a patch to make it work, because CJ used modified variant for the needs of AGS.

Engine: only alfont.lib left, which requires some investigation (AFAIK AGS uses very old version, so it may take some effort to retrieve sources).


EDIT: Nick Sonneveld found the original sources of AlFont used by AGS:
https://sourceforge.net/p/alfont/code/HEAD/tree/branches/alfont_1.9.x/
They have to be patched with changes made by CJ (and reverse-engineered by JJS in Engine\libsrc\alfont-2.0.9\alfont.c)

Crimson Wizard

Well, I made it! At least it works on my computer (c) :).

Version of AGS stripped of precompiled libraries is in this branch: https://github.com/ivan-mogilko/ags-refactoring/tree/win-libraries
Build instructions: https://github.com/ivan-mogilko/ags-refactoring/blob/win-libraries/Windows/README.md
Pull request and discussion: https://github.com/adventuregamestudio/ags/pull/346

I need other developers test if they can actually follow those and build working engine/editor.
Note that you may even try newer versions of MSVS now (but you will have to convert solutions first.

morganw

Just to check, your final link to download Allegro 4 source looks like it's pointing at the Allegro 5 GitHub repo. Is that a mistake or is the Allegro 4 source in there somewhere?

Crimson Wizard

Quote from: morganw on Sun 07/08/2016 19:30:16
Just to check, your final link to download Allegro 4 source looks like it's pointing at the Allegro 5 GitHub repo. Is that a mistake or is the Allegro 4 source in there somewhere?
There are all allegro versions inside. You need to find 4.2.2 tag and make some branch at it.

Crimson Wizard

Done couple of fixes; now we've got confirmation from monkey0506 that this works. Anyone else wants to test this (links are few posts above)?

monkey0506

Not entirely related, but CW, I can also confirm that with the pull requests I've submitted merged into your branch, I have successfully built the engine and editor with VS2015.

Aside from the pull requests, I also had to make sure to define the macro ALLEGRO_HAVE_STDINT_H and make one small patch to the Allegro almsvc.h platform header (don't #define int64_t and uint64_t). Also, the DirectX include folder must be listed after the Windows SDK include folders in the VC++ Directories.

SMF spam blocked by CleanTalk