alac/README.md

68 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

2016-07-04 08:19:35 +00:00
ALAC
====
2016-07-03 18:59:13 +00:00
2016-07-04 08:26:52 +00:00
This repository is a clone of the Apple Lossless Audio Codec (ALAC) repository at http://alac.macosforge.org with added files to enable it to be built using GNU `autotools`. Use it to build and install the ALAC library `libalac`.
2016-07-04 08:19:35 +00:00
2016-07-04 08:33:13 +00:00
The added files are based on work done by [Tiancheng "Timothy" Gu](https://github.com/TimothyGu) in his repository https://github.com/TimothyGu/alac with some changes. Many thanks to him for his work. This respository is bare-bones for Visual Studio or Debian packaging support or for `man` pages, please go to Timothy's repository.
2016-07-04 08:19:35 +00:00
2018-08-17 14:18:27 +00:00
**Note:** In the rest of the note, a command prefixed with `#` means that it must be executed in superuser mode. The `$` prefix means it should be executed in regular user mode.
2018-08-17 14:15:17 +00:00
Install Build Tools
---
2018-08-17 14:18:27 +00:00
Building `libalac` requires a number of tools, such a the compiler and linker, `git` and more. Ensure they are already in place by running the following command. If the tools are already in place, it'll do no harm.
2018-08-17 14:15:17 +00:00
```
# apt get update
# apt-get install build-essential git autoconf automake libtool
```
2017-04-16 19:11:15 +00:00
Download, Build, Install
---
2016-07-04 08:19:35 +00:00
To download, build and install `libalac` do the following:
* Clone the repository and `cd` into the folder:
```
2022-04-20 18:18:57 +00:00
$ git clone https://git.gammaspectra.live/S.O.N.G/alac.git
2016-07-04 08:19:35 +00:00
$ cd alac
```
* Configure the build and make the library:
```
$ autoreconf -fi
$ ./configure
$ make
```
The `autoconfigure` command may take a long time. You may get a warning which you can ignore:
```
aclocal: warning: couldn't open directory 'm4': No such file or directory
```
2016-07-04 08:19:35 +00:00
* Install the library:
```
2017-04-16 19:09:04 +00:00
# make install
2016-07-04 08:19:35 +00:00
```
2017-04-16 19:11:15 +00:00
Make it Available
---
2017-05-24 10:47:29 +00:00
To make the library visible during compilation, you need to tell `ld` about it. Be careful here if you are on FreeBSD, the Linux command will mess up your system. On Linux, use the following command:
2016-07-04 08:19:35 +00:00
```
2017-05-24 10:43:21 +00:00
# ldconfig
2017-04-16 19:09:04 +00:00
```
2017-05-24 10:47:29 +00:00
2017-05-24 10:48:09 +00:00
Using the library
---
2017-05-24 10:47:29 +00:00
The library can be found and linked to via `pkg-config` the module name is `alac`.
Thus:
2016-07-04 14:57:49 +00:00
```
PKG_CHECK_MODULES([ALAC], [alac], [LIBS="${ALAC_LIBS} ${LIBS}"])
```
2017-05-24 10:47:29 +00:00
should work in a `configure.ac` file. If you are using `AC_CHECK_LIB`, something like this will work:
2016-07-04 14:57:49 +00:00
```
AC_CHECK_LIB([alac], [BitBufferInit], , AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library!))
```
2017-05-24 10:47:29 +00:00
On FreeBSD you must add the location of the `alac.pc` file to the `PKG_CONFIG_PATH`, if it exists, and define it otherwise. Here is what you do if it doesn't already exist:
```
$ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
$ export PKG_CONFIG_PATH
```