Author Topic: Rebuilding native libraries  (Read 2331 times)

monkey0506

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Rebuilding native libraries
« on: 20 Sep 2014, 19:17 »
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

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #1 on: 20 Sep 2014, 20:20 »
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.
« Last Edit: 10 Oct 2014, 09:18 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #2 on: 10 Oct 2014, 09:18 »

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

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #3 on: 06 Aug 2016, 00:10 »
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)
« Last Edit: 06 Aug 2016, 03:33 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #4 on: 06 Aug 2016, 22:42 »
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.

Re: Rebuilding native libraries
« Reply #5 on: 07 Aug 2016, 19:30 »
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

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #6 on: 07 Aug 2016, 20:29 »
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

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #7 on: 14 Aug 2016, 13:35 »
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

  • SEND PIZZA.
    • Best Innovation Award Winner 2017, for his work to help AGS games reach the widest possible audience - through popular distribution platforms (Steam, Galaxy) as well as other operating systems (Android, Linux)
    • monkey0506 worked on one or more games that won an AGS Award!
    •  
    • monkey0506 worked on one or more games that was nominated for an AGS Award!
Re: Rebuilding native libraries
« Reply #8 on: 15 Aug 2016, 17:38 »
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.