Skip to content

Instantly share code, notes, and snippets.

@ePirat
Last active Aug 21, 2022
Embed
What would you like to do?
Cross-compile libaacs for Windows (64bit)

Cross-compile libaacs for Windows (64bit)

For this guide the ubuntu:yakkety Docker image was used.

Install the cross-compile toolchain

apt-get install mingw-w64-tools gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wget gettext bison flex

Build dependencies

Now we need to build the libaacs dependencies first, those are, as time of writing:

In this guide I assume we created a folder libaacs:

mkdir /libaacs && cd /libaacs

Of course you can choose any location you want.

libgpg-error

  1. Download the source:
    wget https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.25.tar.bz2
  2. Extract the source:
    tar xvfj libgpg-error-1.25.tar.bz2
  3. Configure:
    cd libgpg-error-1.25/
    ./configure --host=x86_64-w64-mingw32 --prefix=/libaacs/build-64/
    
  4. Build it:
    make
    make install
    cd ..
    

libgcrypt

  1. Download the source:
    wget https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.3.tar.bz2
  2. Extract the source:
    tar xvfj libgcrypt-1.7.3.tar.bz2
  3. Configure it:
    cd libgcrypt-1.7.3/
    ./configure --host=x86_64-w64-mingw32 --with-gpg-error-prefix=/libaacs/build-64 --prefix=/libaacs/build-64
    
  4. Build it:
    make
    make install
    cd ..
    

Build libaacs

Now that we have built the dependencies, we can continue building libbluray.

  1. First we need to download the source:
    wget ftp://ftp.videolan.org/pub/videolan/libaacs/0.8.1/libaacs-0.8.1.tar.bz2
  2. Extract it:
    tar xvfj libaacs-0.8.1.tar.bz2
  3. Configure:
    cd libaacs-0.8.1/
    ./configure --host=x86_64-w64-mingw32 --with-gpg-error-prefix=/libaacs/build-64 --with-libgcrypt-prefix=/libaacs/build-64 --prefix=/libaacs/build-64
    
  4. Build it:
    make
    make install
    cd ..
    

You will find the build results in /libaacs/build-64/bin

@bobpaw
Copy link

bobpaw commented Mar 12, 2022

libgpg-error must be libgpg-error-1.37 at minimum to include commit 7865041c77f4f7005282f10f9b6666b19072fbdf. Otherwise it won't build on systems with gawk (which ./configure seems to prefer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment