Blame view

node_modules/node-sass/src/libsass/docs/build-with-autotools.md 1.98 KB
aaac7fed   liuqimichale   add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  ### Get the sources
  ```bash
  # using git is preferred
  git clone https://github.com/sass/libsass.git
  # only needed for sassc and/or testsuite
  git clone https://github.com/sass/sassc.git libsass/sassc
  git clone https://github.com/sass/sass-spec.git libsass/sass-spec
  ```
  
  ### Prerequisites
  
  In order to run autotools you need a few tools installed on your system.
  ```bash
  yum install automake libtool # RedHat Linux
  emerge -a automake libtool # Gentoo Linux
  pkgin install automake libtool # SmartOS
  ```
  
  
  ### Create configure script
  ```bash
  cd libsass
  autoreconf --force --install
  cd ..
  ```
  
  ### Create custom makefiles
  ```bash
  cd libsass
  ./configure \
    --disable-tests \
    --disable-shared \
    --prefix=/usr
  cd ..
  ```
  
  ### Build the library
  ```bash
  make -C libsass -j5
  ```
  
  ### Install the library
  The library will be installed to the location given as `prefix` to `configure`. This is standard behavior for autotools and not `libsass` specific.
  ```bash
  make -C libsass -j5 install
  ```
  
  ### Configure options
  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.
  
  There are some `libsass` specific options:
  
  ```
  Optional Features:
    --enable-tests              enable testing the build
    --enable-coverage           enable coverage report for test suite
    --enable-shared             build shared libraries [default=yes]
    --enable-static             build static libraries [default=yes]
  
  Optional Packages:
    --with-sassc-dir=<dir>      specify directory of sassc sources for
                                testing (default: sassc)
    --with-sass-spec-dir=<dir>  specify directory of sass-spec for testing
                                (default: sass-spec)
  ```
  
  ### Build sassc and run spec test-suite
  
  ```bash
  cd libsass
  autoreconf --force --install
  ./configure \
    --enable-tests \
    --enable-shared \
    --prefix=/usr
  make -j5 test_build
  cd ..
  ```