Blame docs/build-with-autotools.md
Branch: bfcc3371e0ccd4d7394d1bf3a0814863556b22a3
Packit
bfcc33
### Get the sources
Packit
bfcc33
```bash
Packit
bfcc33
# using git is preferred
Packit
bfcc33
git clone https://github.com/sass/libsass.git
Packit
bfcc33
# only needed for sassc and/or testsuite
Packit
bfcc33
git clone https://github.com/sass/sassc.git libsass/sassc
Packit
bfcc33
git clone https://github.com/sass/sass-spec.git libsass/sass-spec
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
### Prerequisites
Packit
bfcc33
Packit
bfcc33
In order to run autotools you need a few tools installed on your system.
Packit
bfcc33
```bash
Packit
bfcc33
yum install automake libtool # RedHat Linux
Packit
bfcc33
emerge -a automake libtool # Gentoo Linux
Packit
bfcc33
pkgin install automake libtool # SmartOS
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
Packit
bfcc33
### Create configure script
Packit
bfcc33
```bash
Packit
bfcc33
cd libsass
Packit
bfcc33
autoreconf --force --install
Packit
bfcc33
cd ..
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
### Create custom makefiles
Packit
bfcc33
```bash
Packit
bfcc33
cd libsass
Packit
bfcc33
./configure \
Packit
bfcc33
--disable-tests \
Packit
bfcc33
--disable-shared \
Packit
bfcc33
--prefix=/usr
Packit
bfcc33
cd ..
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
### Build the library
Packit
bfcc33
```bash
Packit
bfcc33
make -C libsass -j5
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
### Install the library
Packit
bfcc33
The library will be installed to the location given as `prefix` to `configure`. This is standard behavior for autotools and not `libsass` specific.
Packit
bfcc33
```bash
Packit
bfcc33
make -C libsass -j5 install
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
### Configure options
Packit
bfcc33
The `configure` script is created by autotools. To get an overview of available options you can call `./configure --help`. When you execute this script, it will create specific makefiles, which you then use via the regular make command.
Packit
bfcc33
Packit
bfcc33
There are some `libsass` specific options:
Packit
bfcc33
Packit
bfcc33
```
Packit
bfcc33
Optional Features:
Packit
bfcc33
--enable-tests enable testing the build
Packit
bfcc33
--enable-coverage enable coverage report for test suite
Packit
bfcc33
--enable-shared build shared libraries [default=yes]
Packit
bfcc33
--enable-static build static libraries [default=yes]
Packit
bfcc33
Packit
bfcc33
Optional Packages:
Packit
bfcc33
--with-sassc-dir=<dir> specify directory of sassc sources for
Packit
bfcc33
testing (default: sassc)
Packit
bfcc33
--with-sass-spec-dir=<dir> specify directory of sass-spec for testing
Packit
bfcc33
(default: sass-spec)
Packit
bfcc33
```
Packit
bfcc33
Packit
bfcc33
### Build sassc and run spec test-suite
Packit
bfcc33
Packit
bfcc33
```bash
Packit
bfcc33
cd libsass
Packit
bfcc33
autoreconf --force --install
Packit
bfcc33
./configure \
Packit
bfcc33
--enable-tests \
Packit
bfcc33
--enable-shared \
Packit
bfcc33
--prefix=/usr
Packit
bfcc33
make -j5 test_build
Packit
bfcc33
cd ..
Packit
bfcc33
```