-
Notifications
You must be signed in to change notification settings - Fork 8
Install Allegro from source on Ubuntu
SiegeLord edited this page Mar 15, 2022
·
2 revisions
-
Install general system dependencies.
sudo apt install git cmake build-essential
-
Install various dependencies.
sudo apt install libdumb1-dev \ libflac-dev \ libfreetype6-dev \ libgl1-mesa-dev \ libglu1-mesa-dev \ libgtk-3-dev \ libjpeg-dev \ libopenal-dev \ libphysfs-dev \ libpng-dev \ libpulse-dev \ libtheora-dev \ libvorbis-dev \ libwebp-dev \ libxext-dev \ libxxf86vm-dev \ libxrandr-dev \ libxinerama-dev \ libxpm-dev \ libopusfile-dev
-
Download Allegro's source from git and navigate to its directory.
git clone https://github.com/liballeg/allegro5.git cd allegro5
Naturally, you can replace the repository to something else if you want grab the code from, e.g., a GitHub fork.
-
If you want MP3 support, download the header-only MiniMP3 library as follows:
mkdir -p deps/include cd deps/include curl -O https://raw.githubusercontent.com/lieff/minimp3/master/minimp3.h curl -O https://raw.githubusercontent.com/lieff/minimp3/master/minimp3_ex.h cd ../..
-
Configure and build Allegro.
mkdir build cd build cmake .. make -j$(nproc)
If you're reproducing some sort of bug or developing a new feature, it can be helpful to build Allegro in debug mode by issuing
cmake .. -DCMAKE_BUILD_TYPE=Debug
. The defaultCMAKE_BUILD_TYPE
isRelWithDebInfo
. -
Test by running an example.
cd examples ./ex_draw_bitmap