<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[A4]How to cross-compile allegro on mingw for Gitlab CI</title>
		<link>http://www.allegro.cc/forums/view/618722</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 07 Sep 2022 08:25:48 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So far, I have successfully cross-compiled on linux a windows program using mingw64 if only using the basic libc libraries. I also managed to configure a remote CI cross-compilation on gitlab and it worked.</p><p>Now, If I try to do the same with a program that needs the allegro library, it fails as it cannot find any of the libs and includes. That is normal since Mingw use it&#39;s own set of lib and includes instead of those installed on the system.</p><p>So I guess, I&#39;ll have to re-build Allegro library specifically for mingw 32bit and 64 bit compiler. So the questions are:</p><ul><li><p>How can I build my own lib for mingw on my local machine?
</p></li><li><p>Is there some pre-compiled binaries I can use instead of building it? Is there some artifacts somewhere I can just download?
</p></li><li><p>Is there a way to shorten the build process? (For example, not building the tools, examples, etc) Since it could consume too much CI time if I have to rebuild allegro after each commit.
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (larienna)</author>
		<pubDate>Wed, 24 Aug 2022 23:37:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s been a looong time since I&#39;ve touched A4, but I can give you some pointers re CI and cross-compiling.</p><p>To get build times down, you&#39;ll probably want to bring your own Docker image with mingw64 pre-installed. I dug out one I used ages ago for cross-compiling with A5, which is as follows:</p><div class="source-code snippet"><div class="inner"><pre>FROM ubuntu:20.04

RUN apt-get update
RUN apt-get install <span class="k3">-</span>y p7zip-full mingw-w64
RUN <a href="http://www.delorie.com/djgpp/doc/libc/libc_570.html" target="_blank">mkdir</a> <span class="k3">/</span>allegro-w64
RUN curl <span class="k3">-</span>L https:<span class="c">//github.com/liballeg/allegro5/releases/download/5.2.6/allegro-x86_64-w64-mingw32-gcc-9.2.0-posix-seh-dynamic-5.2.6.zip &gt; /allegro-w64/allegro.zip</span>
RUN curl <span class="k3">-</span>L https:<span class="c">//github.com/liballeg/allegro_winpkg/releases/download/1.11.0/allegro_deps-x86_64-w64-mingw32-gcc-9.2.0-posix-seh-1.11.0.zip &gt; /allegro-w64/deps.zip</span>
RUN cd <span class="k3">/</span>allegro-w64 <span class="k3">&amp;</span><span class="k3">&amp;</span> <span class="n">7</span>z x allegro.zip <span class="k3">&amp;</span><span class="k3">&amp;</span> <span class="n">7</span>z x deps.zip <span class="k3">&amp;</span><span class="k3">&amp;</span> \
  cp <span class="k3">-</span>r <span class="k3">/</span>allegro-w64<span class="k3">/</span>allegro<span class="k3">/</span>bin<span class="c">/*          /usr/x86_64-w64-mingw32/bin/     &amp;&amp; \</span>
<span class="c">  cp -r /allegro-w64/allegro/include/*      /usr/x86_64-w64-mingw32/include/ &amp;&amp; \</span>
<span class="c">  cp -r /allegro-w64/allegro/lib/*          /usr/x86_64-w64-mingw32/lib/     &amp;&amp; \</span>
<span class="c">  cp -r /allegro-w64/allegro_deps/include/* /usr/x86_64-w64-mingw32/include/ &amp;&amp; \</span>
<span class="c">  cp -r /allegro-w64/allegro_deps/lib/*     /usr/x86_64-w64-mingw32/lib/     &amp;&amp; \</span>
<span class="c">  rm -rf /allegro-w64</span>
</pre></div></div><p>

I&#39;m using A5&#39;s precompiled mingw libs here. I believe some have ventured into binary distributions for A4 (Edgar?) but you can find precompiled stuff for some (slightly older) 4.4 releases <a href="https://www.allegro.cc/files/?v=4.4">right here on a.cc</a>. If none of that works, you&#39;ll probably want to run the mingw compilation itself inside of the Dockerfile, which I won&#39;t go into unless you absolutely need it <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Also worth noting is that once you&#39;ve built your CI image, <a href="https://docs.gitlab.com/ee/user/packages/container_registry/">you can host it on GitLab itself</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (dthompson)</author>
		<pubDate>Thu, 25 Aug 2022 15:19:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;re using a CI system, you might like my prepared docker images:</p><ul><li><p><a href="https://hub.docker.com/repository/docker/amarillion/alleg4-buildenv">https://hub.docker.com/repository/docker/amarillion/alleg4-buildenv</a>
</p></li><li><p><a href="https://github.com/amarillion/allegro-buildenv/">https://github.com/amarillion/allegro-buildenv/</a></p></li></ul><p>Now I&#39;ve prepared an allegro4 image for linux, and an allegro5 image for mingw and linux. What I don&#39;t have yet is an allegro4 image for mingw...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (amarillion)</author>
		<pubDate>Thu, 25 Aug 2022 21:13:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="">dthompson</a> said:</div><div class="quote"><p>
I believe some have ventured into binary distributions for A4 (Edgar?) but you can find precompiled stuff for some (slightly older) 4.4 releases right here on a.cc.
</p></div></div><p>
The binaries on a.cc are a decade old by now.</p><p>I have a <i>more</i> modern version on bitbucket here :</p><p><a href="https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/Allegro443_GCC81_MinGW_W64_i686_posix_dwarf.7z">https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/Allegro443_GCC81_MinGW_W64_i686_posix_dwarf.7z</a></p><p>You would need the appropriate mingw-w64 from sourceforge to use it though.</p><p>I may also be inspired to make up to date versions if you really need them. It isn&#39;t too hard.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 25 Aug 2022 23:02:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ll give it a try later when I have more time. I need to wrap things up for my release. Seems that a lot of other CI stuff is also ot working as intended.</p><p>Old binaries could be fine since A4 is old. As long as it is compatible with the binaries I am trying to build with Mingw64.</p><p>I have not much experience with Docker, besides that the Gitlab CI system use a docker image to build my software.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (larienna)</author>
		<pubDate>Wed, 07 Sep 2022 08:25:48 +0000</pubDate>
	</item>
</rss>
