forked from sass/sassc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
78 lines (66 loc) · 2.09 KB
/
configure.ac
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
AC_PREREQ([2.61])
AC_INIT([sassc], [1.0], [[email protected]])
AC_CONFIG_SRCDIR([sassc.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10 foreign])
AC_ARG_WITH([libsass-include],
[AS_HELP_STRING([--with-libass-include],
[location of the libsass headers, defaults to /usr/include])],
[LIBSASS_CFLAGS="-I$withval"],
[LIBSASS_CFLAGS='-I/usr/include'])
AC_SUBST([LIBSASS_CFLAGS])
AC_ARG_WITH([libsass-lib],
[AS_HELP_STRING([--with-libsass-lib], [location of the libsass library])],
[LIBSASS_LIBS="-L$withval -lsass"],
[LIBSASS_LIBS='-lsass'])
AC_SUBST([LIBSASS_LIBS])
LT_INIT
AC_PROG_CXX
AC_CHECK_HEADERS([sass.h])
AC_CHECK_HEADERS([sass2scss.h])
AC_CHECK_HEADERS([sass_values.h])
AC_CHECK_HEADERS([sass_context.h])
AC_CHECK_HEADERS([sass_functions.h])
AC_CHECK_HEADERS([sass_interface.h])
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
[enable coverage report for test suite])],
[enable_cov=$enableval],
[enable_cov=no])
if test "x$enable_cov" = "xyes"; then
AC_CHECK_PROG(GCOV, gcov, gcov)
# Remove all optimization flags from C[XX]FLAGS
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
changequote([,])
AC_SUBST(GCOV)
fi
AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_cov" = "xyes")
AC_ARG_VAR(SASSC_VERSION, libsass version)
if test "x$SASSC_VERSION" = "x"; then
AC_CHECK_PROG(GIT, git, git)
if test "x$GIT" = "x"; then
AC_MSG_ERROR([Unable to find git binary to query version.
You can solve this by setting SASSC_VERSION:
# export SASSC_VERSION="x.y.z"
])
else
AC_CHECK_FILE(.git/config, [], [
AC_MSG_ERROR([Unable to find .git directory to query version.
You can solve this by setting SASSC_VERSION:
# export SASSC_VERSION="x.y.z"
])
])
SASSC_VERSION=`$GIT describe --abbrev=4 --dirty --always --tags`
fi
if test "x$SASSC_VERSION" = "x"; then
AC_MSG_ERROR([SASSC_VERSION not defined.
You can solve this by setting SASSC_VERSION:
# export SASSC_VERSION="x.y.z"
])
fi
fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT