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
  
79
  
80
  
81
  
82
  
83
  
AC_INIT(sass.cmod) 
AC_ARG_WITH( 
    [sass], 
    [AS_HELP_STRING( 
         [--with(out)-sass], 
         [Support for SASS])], 
    [], 
    [with_sass=yes]) 
AC_ARG_WITH( 
    [sass-debug], 
    [AS_HELP_STRING( 
         [--with(out)-sass-debug], 
         [Enable module debug. Only for dev purposes])], 
    [with_sass_debug="$withval"], 
    [with_sass_debug=no]) 
 
AC_MODULE_INIT() 
 
AC_CONFIG_HEADER(config.h) 
 
PIKE_FEATURE_WITHOUT(Sass) 
 
have_libsass="no" 
 
AS_IF( 
    [ test "x$with_sass_debug" != xno ], 
    [ AC_DEFINE(PIKE_SASS_DEBUG, [1], [Defined if --with-sass-debug]) ]) 
 
AS_IF( 
    [ test "x$with_sass" != "xno" ], 
    [ 
        PIKE_FEATURE_NODEP(Sass) 
 
        AC_CHECK_HEADER( 
            [sass.h], 
            [ 
                # NB: When linking to the static library, 
                #     -lstdc++ must be listed explicitly. 
                AC_CHECK_LIB(stdc++, __dynamic_cast) 
 
                AC_CHECK_LIB( 
                    sass, libsass_version, 
                    [ 
                        CMOD_LIBS=" -lsass" 
                        CMOD_CFLAGS="" 
 
                        AC_SUBST(CMOD_CFLAGS) 
                        AC_SUBST(CMOD_LIBS) 
 
                        PIKE_FEATURE_OK(Sass) 
 
                        AC_DEFINE(HAVE_LIBSASS, [1], 
                                  [Define to 1 if you have libsass.]) 
                        have_libsass="yes" 
                    ]) 
            ]) 
    ]) 
 
AS_IF( 
    [ test "x$have_libsass" = "xyes" ], 
    [ 
        # 
        # Check for features in libsass 
        # 
        AC_CHECK_LIB( 
            sass, sass_delete_options, 
            [ 
                #LIBS="${LIBS-} -lsass" 
                AC_DEFINE(HAVE_LIBSASS_DELETE_OPTIONS, [1], 
                          [Defined if sass_delete_options is available ]) 
            ]) 
 
        AC_CHECK_LIB( 
            sass, libsass_language_version, 
            [ 
                #LIBS="${LIBS-} -lsass" 
                AC_DEFINE(HAVE_LIBSASS_LANGUAGE_VERSION, [1], 
                          [True if libsass_language_version() is available]) 
            ]) 
    ]) 
 
AC_OUTPUT(Makefile, echo FOO >stamp-h)