Blame docs/build-with-autotools.md

Packit Service 7770af
### Get the sources
Packit Service 7770af
```bash
Packit Service 7770af
# using git is preferred
Packit Service 7770af
git clone https://github.com/sass/libsass.git
Packit Service 7770af
# only needed for sassc and/or testsuite
Packit Service 7770af
git clone https://github.com/sass/sassc.git libsass/sassc
Packit Service 7770af
git clone https://github.com/sass/sass-spec.git libsass/sass-spec
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
### Prerequisites
Packit Service 7770af
Packit Service 7770af
In order to run autotools you need a few tools installed on your system.
Packit Service 7770af
```bash
Packit Service 7770af
yum install automake libtool # RedHat Linux
Packit Service 7770af
emerge -a automake libtool # Gentoo Linux
Packit Service 7770af
pkgin install automake libtool # SmartOS
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
Packit Service 7770af
### Create configure script
Packit Service 7770af
```bash
Packit Service 7770af
cd libsass
Packit Service 7770af
autoreconf --force --install
Packit Service 7770af
cd ..
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
### Create custom makefiles
Packit Service 7770af
```bash
Packit Service 7770af
cd libsass
Packit Service 7770af
./configure \
Packit Service 7770af
  --disable-tests \
Packit Service 7770af
  --disable-shared \
Packit Service 7770af
  --prefix=/usr
Packit Service 7770af
cd ..
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
### Build the library
Packit Service 7770af
```bash
Packit Service 7770af
make -C libsass -j5
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
### Install the library
Packit Service 7770af
The library will be installed to the location given as `prefix` to `configure`. This is standard behavior for autotools and not `libsass` specific.
Packit Service 7770af
```bash
Packit Service 7770af
make -C libsass -j5 install
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
### Configure options
Packit Service 7770af
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 Service 7770af
Packit Service 7770af
There are some `libsass` specific options:
Packit Service 7770af
Packit Service 7770af
```
Packit Service 7770af
Optional Features:
Packit Service 7770af
  --enable-tests              enable testing the build
Packit Service 7770af
  --enable-coverage           enable coverage report for test suite
Packit Service 7770af
  --enable-shared             build shared libraries [default=yes]
Packit Service 7770af
  --enable-static             build static libraries [default=yes]
Packit Service 7770af
Packit Service 7770af
Optional Packages:
Packit Service 7770af
  --with-sassc-dir=<dir>      specify directory of sassc sources for
Packit Service 7770af
                              testing (default: sassc)
Packit Service 7770af
  --with-sass-spec-dir=<dir>  specify directory of sass-spec for testing
Packit Service 7770af
                              (default: sass-spec)
Packit Service 7770af
```
Packit Service 7770af
Packit Service 7770af
### Build sassc and run spec test-suite
Packit Service 7770af
Packit Service 7770af
```bash
Packit Service 7770af
cd libsass
Packit Service 7770af
autoreconf --force --install
Packit Service 7770af
./configure \
Packit Service 7770af
  --enable-tests \
Packit Service 7770af
  --enable-shared \
Packit Service 7770af
  --prefix=/usr
Packit Service 7770af
make -j5 test_build
Packit Service 7770af
cd ..
Packit Service 7770af
```