Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 88 additions & 55 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,73 @@ AM_CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
AM_CXXFLAGS += -std=c++0x

if ENABLE_COVERAGE
AM_CFLAGS += -O0 --coverage
AM_CXXFLAGS += -O0 --coverage
AM_LDFLAGS += -O0 --coverage -lgcov
AM_CFLAGS += -O0 --coverage
AM_CXXFLAGS += -O0 --coverage
AM_LDFLAGS += -O0 --coverage -lgcov
else
AM_CFLAGS += -O2
AM_CXXFLAGS += -O2
AM_LDFLAGS += -O2
AM_CFLAGS += -O2
AM_CXXFLAGS += -O2
AM_LDFLAGS += -O2
endif

VERSION = $(LIBSASS_VERSION)

EXTRA_DIST = \
COPYING \
INSTALL \
LICENSE \
Readme.md

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = support/libsass.pc

lib_LTLIBRARIES = libsass.la

libsass_la_SOURCES = \
cencode.c \
ast.cpp \
base64vlq.cpp \
bind.cpp \
constants.cpp \
context.cpp \
contextualize.cpp \
copy_c_str.cpp \
error_handling.cpp \
eval.cpp \
expand.cpp \
extend.cpp \
file.cpp \
functions.cpp \
inspect.cpp \
node.cpp \
json.cpp \
output_compressed.cpp \
output_nested.cpp \
parser.cpp \
prelexer.cpp \
remove_placeholders.cpp \
sass.cpp \
sass_util.cpp \
sass_values.cpp \
sass_context.cpp \
sass_functions.cpp \
sass_interface.cpp \
sass2scss.cpp \
source_map.cpp \
to_c.cpp \
to_string.cpp \
units.cpp \
utf8_string.cpp \
util.cpp
ast_fwd_decl.hpp ast_def_macros.hpp \
kwd_arg_macros.hpp memory_manager.hpp \
position.hpp operation.hpp \
subset_map.hpp mapping.hpp \
color_names.hpp backtrace.hpp \
cencode.c b64/cencode.h b64/encode.h \
token.hpp environment.hpp \
paths.hpp debug.hpp \
utf8.h utf8/core.h \
utf8/checked.h utf8/unchecked.h \
ast.cpp ast.hpp \
base64vlq.cpp base64vlq.hpp \
bind.cpp bind.hpp \
constants.cpp constants.hpp \
context.cpp context.hpp \
contextualize.cpp contextualize.hpp \
copy_c_str.cpp copy_c_str.hpp \
error_handling.cpp error_handling.hpp \
eval.cpp eval.hpp \
expand.cpp expand.hpp \
extend.cpp extend.hpp \
file.cpp file.hpp \
functions.cpp functions.hpp \
inspect.cpp inspect.hpp \
node.cpp node.hpp \
json.cpp json.hpp \
output_compressed.cpp output_compressed.hpp \
output_nested.cpp output_nested.hpp \
parser.cpp parser.hpp \
prelexer.cpp prelexer.hpp \
remove_placeholders.cpp remove_placeholders.hpp \
sass.cpp sass.h \
sass_util.cpp sass_util.hpp \
sass_values.cpp sass_values.h \
sass_context.cpp sass_context.h \
sass_functions.cpp sass_functions.h \
sass_interface.cpp sass_interface.h \
sass2scss.cpp sass2scss.h \
source_map.cpp source_map.hpp \
to_c.cpp to_c.hpp \
to_string.cpp to_string.hpp \
units.cpp units.hpp \
utf8_string.cpp utf8_string.hpp \
util.cpp util.hpp

libsass_la_CFLAGS = $(AM_CFLAGS)
libsass_la_CXXFLAGS = $(AM_CXXFLAGS)
Expand All @@ -81,32 +98,48 @@ nodist_EXTRA_sassc_bin_SOURCES = non-existent-file-to-force-CXX-linking.cxx
nodist_EXTRA_libsass_la_SOURCES = non-existent-file-to-force-CXX-linking.cxx
endif

SASS_SASSC_PATH ?= sassc
SASS_SPEC_PATH ?= sass-spec
SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc

TESTS = \
$(SASS_SPEC_PATH)/spec/basic \
$(SASS_SPEC_PATH)/spec/benchmarks \
$(SASS_SPEC_PATH)/spec/bourbon \
$(SASS_SPEC_PATH)/spec/css \
$(SASS_SPEC_PATH)/spec/extend-tests \
$(SASS_SPEC_PATH)/spec/extends \
$(SASS_SPEC_PATH)/spec/libsass \
$(SASS_SPEC_PATH)/spec/libsass-closed-issues \
$(SASS_SPEC_PATH)/spec/maps \
$(SASS_SPEC_PATH)/spec/misc \
$(SASS_SPEC_PATH)/spec/regressions \
$(SASS_SPEC_PATH)/spec/scss \
$(SASS_SPEC_PATH)/spec/todo

LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
AM_LOG_FLAGS = -c ./sass-tester

SASS_SASSC_PATH ?= sassc
SASS_SPEC_PATH ?= sass-spec
SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
RUBY_BIN = ruby
$(SASS_SPEC_PATH)/spec/scss-tests \
$(SASS_SPEC_PATH)/spec/types

SASS_TEST_FLAGS =
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) ./script/tap-driver
AM_LOG_FLAGS = -c ./sassc_bin --ignore-todo $(LOG_FLAGS)
if USE_TAP
AM_LOG_FLAGS += -t
SASS_TEST_FLAGS += -t | tapout
LOG_COMPILER = ./script/tap-runner $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
else
LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
endif

$(SASSC_BIN): libsass.la
cd $(SASS_SASSC_PATH) && $(MAKE)

test: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s $(LOG_FLAGS) $(SASS_SPEC_PATH)
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)

test_build: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)

test_full: $(SASSC_BIN)
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)

test_issues: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues $(SASS_TEST_FLAGS)

endif
38 changes: 25 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.61])
AC_INIT([libsass], [1.0], [[email protected]])
AC_INIT([libsass], [3.0.3], [[email protected]])
AC_CONFIG_SRCDIR([ast.hpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10 foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_AUX_DIR([script])
AM_INIT_AUTOMAKE([foreign parallel-tests])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
LT_INIT

# Checks for programs.
Expand All @@ -32,7 +33,11 @@ AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [enable testing the build]
if test "x$enable_tests" = "xyes"; then
AC_PROG_CC
AC_PROG_AWK
# test need minitest gem
AC_PATH_PROG(RUBY, [ruby])
AC_PATH_PROG(TAPOUT, [tapout])
AC_REQUIRE_AUX_FILE([tap-driver])
AC_REQUIRE_AUX_FILE([tap-runner])
AC_ARG_WITH(sassc-dir,
AS_HELP_STRING([--with-sassc-dir=<dir>], [specify directory of sassc sources for testing (default: sassc)]),
[sassc_dir="$withval"], [sassc_dir="sassc"])
Expand Down Expand Up @@ -64,9 +69,21 @@ the --with-sass-spec-dir=<dir> argument.
;;
esac
AC_SUBST(SASS_SPEC_PATH)

# TODO: Remove this when automake requirements are 1.12+
AC_MSG_CHECKING([whether we can use TAP mode])
tmp=`$AWK '/TEST_LOG_DRIVER/' $srcdir/Makefile.in`
if test "x$tmp" != "x"; then
use_tap=yes
else
use_tap=no
fi
AC_MSG_RESULT([$use_tap])

fi

AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "xyes")
AM_CONDITIONAL(USE_TAP, test "x$use_tap" = "xyes")

AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
Expand All @@ -93,18 +110,13 @@ AC_ARG_VAR(LIBSASS_VERSION, libsass version)
if test "x$LIBSASS_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 LIBSASS_VERSION:
# export LIBSASS_VERSION="x.y.z"
])
LIBSASS_VERSION=$VERSION
else
AC_CHECK_FILE(.git/config, [], [
AC_MSG_ERROR([Unable to find .git directory to query version.
You can solve this by setting LIBSASS_VERSION:
# export LIBSASS_VERSION="x.y.z"
])
AC_CHECK_FILE(.git/config, [
LIBSASS_VERSION=`$GIT describe --abbrev=4 --dirty --always --tags`
], [
LIBSASS_VERSION=$VERSION
])
LIBSASS_VERSION=`$GIT describe --abbrev=4 --dirty --always --tags`
fi
if test "x$LIBSASS_VERSION" = "x"; then
AC_MSG_ERROR([LIBSASS_VERSION not defined.
Expand Down
1 change: 1 addition & 0 deletions script/ci-install-compiler
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash

gem install minitest
gem install minitap
7 changes: 7 additions & 0 deletions script/ci-install-deps
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ if [ "x$COVERAGE" == "xyes" ]; then
else
echo "no dependencies to install"
fi

if [ "x$AUTOTOOLS" == "xyes" ]; then
sudo add-apt-repository -y ppa:rbose-debianizer/automake &> /dev/null
sudo apt-get -qq update
sudo apt-get -qq install automake
AUTOTOOLS=yes
fi
Loading