Blame configure.ac

Packit Service 7770af
#                                               -*- Autoconf -*-
Packit Service 7770af
# Process this file with autoconf to produce a configure script.
Packit Service 7770af
Packit Service 7770af
AC_PREREQ([2.61])
Packit Service 7770af
Packit Service 7770af
AC_INIT([libsass], m4_esyscmd_s([./version.sh]), [support@moovweb.com])
Packit Service 7770af
AC_CONFIG_SRCDIR([src/ast.hpp])
Packit Service 7770af
AC_CONFIG_MACRO_DIR([m4])
Packit Service 7770af
AC_CONFIG_HEADERS([src/config.h])
Packit Service 7770af
AC_CONFIG_FILES([include/sass/version.h])
Packit Service 7770af
AC_CONFIG_AUX_DIR([script])
Packit Service 7770af
# These are flags passed to automake
Packit Service 7770af
# Though they look like gcc flags!
Packit Service 7770af
AM_INIT_AUTOMAKE([foreign parallel-tests -Wall])
Packit Service 7770af
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
Packit Service 7770af
Packit Service 7770af
# Checks for programs.
Packit Service 7770af
AC_PROG_CC
Packit Service 7770af
AC_PROG_CXX
Packit Service 7770af
AC_LANG_PUSH([C])
Packit Service 7770af
AC_LANG_PUSH([C++])
Packit Service 7770af
AC_GNU_SOURCE
Packit Service 7770af
# Check fails on Travis, but it works fine
Packit Service 7770af
# AX_CXX_COMPILE_STDCXX_11([ext],[optional])
Packit Service 7770af
AC_CHECK_TOOL([AR], [ar], [false])
Packit Service 7770af
AC_CHECK_TOOL([DLLTOOL], [dlltool], [false])
Packit Service 7770af
AC_CHECK_TOOL([DLLWRAP], [dllwrap], [false])
Packit Service 7770af
AC_CHECK_TOOL([WINDRES], [windres], [false])
Packit Service 7770af
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Packit Service 7770af
LT_INIT([dlopen])
Packit Service 7770af
Packit Service 7770af
# Checks for header files.
Packit Service 7770af
AC_CHECK_HEADERS([unistd.h])
Packit Service 7770af
Packit Service 7770af
# Checks for typedefs, structures, and compiler characteristics.
Packit Service 7770af
AC_TYPE_SIZE_T
Packit Service 7770af
Packit Service 7770af
# Checks for library functions.
Packit Service 7770af
AC_FUNC_MALLOC
Packit Service 7770af
AC_CHECK_FUNCS([floor getcwd strtol])
Packit Service 7770af
Packit Service 7770af
# Checks for testing.
Packit Service 7770af
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [enable testing the build]),
Packit Service 7770af
              [enable_tests="$enableval"], [enable_tests=no])
Packit Service 7770af
Packit Service 7770af
AS_CASE([$host], [*-*-mingw*], [is_mingw32=yes], [is_mingw32=no])
Packit Service 7770af
AM_CONDITIONAL(COMPILER_IS_MINGW32, test "x$is_mingw32" = "xyes")
Packit Service 7770af
Packit Service 7770af
dnl The dlopen() function is in the C library for *BSD and in
Packit Service 7770af
dnl libdl on GLIBC-based systems
Packit Service 7770af
if test "x$is_mingw32" != "xyes"; then
Packit Service 7770af
  AC_SEARCH_LIBS([dlopen], [dl dld], [], [
Packit Service 7770af
    AC_MSG_ERROR([unable to find the dlopen() function])
Packit Service 7770af
  ])
Packit Service 7770af
fi
Packit Service 7770af
Packit Service 7770af
if test "x$enable_tests" = "xyes"; then
Packit Service 7770af
  AC_PROG_CC
Packit Service 7770af
  AC_PROG_AWK
Packit Service 7770af
  # test need minitest gem
Packit Service 7770af
  AC_PATH_PROG(RUBY, [ruby])
Packit Service 7770af
  AC_PATH_PROG(TAPOUT, [tapout])
Packit Service 7770af
  AC_REQUIRE_AUX_FILE([tap-driver])
Packit Service 7770af
  AC_REQUIRE_AUX_FILE([tap-runner])
Packit Service 7770af
  AC_ARG_WITH(sassc-dir,
Packit Service 7770af
              AS_HELP_STRING([--with-sassc-dir=<dir>], [specify directory of sassc sources for testing (default: sassc)]),
Packit Service 7770af
              [sassc_dir="$withval"], [sassc_dir="sassc"])
Packit Service 7770af
  AC_CHECK_FILE([$sassc_dir/sassc.c], [], [
Packit Service 7770af
    AC_MSG_ERROR([Unable to find sassc directory.
Packit Service 7770af
You must clone the sassc repository in this directory or specify
Packit Service 7770af
the --with-sassc-dir=<dir> argument.
Packit Service 7770af
])
Packit Service 7770af
  ])
Packit Service 7770af
  SASS_SASSC_PATH=$sassc_dir
Packit Service 7770af
  AC_SUBST(SASS_SASSC_PATH)
Packit Service 7770af
Packit Service 7770af
  AC_ARG_WITH(sass-spec-dir,
Packit Service 7770af
              AS_HELP_STRING([--with-sass-spec-dir=<dir>], [specify directory of sass-spec for testing (default: sass-spec)]),
Packit Service 7770af
              [sass_spec_dir="$withval"], [sass_spec_dir="sass-spec"])
Packit Service 7770af
  AC_CHECK_FILE([$sass_spec_dir/sass-spec.rb], [], [
Packit Service 7770af
    AC_MSG_ERROR([Unable to find sass-spec directory.
Packit Service 7770af
You must clone the sass-spec repository in this directory or specify
Packit Service 7770af
the --with-sass-spec-dir=<dir> argument.
Packit Service 7770af
])
Packit Service 7770af
  ])
Packit Service 7770af
  # Automake doesn't like its tests in an absolute path, so we make it relative.
Packit Service 7770af
  case $sass_spec_dir in
Packit Service 7770af
    /*)
Packit Service 7770af
      SASS_SPEC_PATH=`$RUBY -e "require 'pathname'; puts Pathname.new('$sass_spec_dir').relative_path_from(Pathname.new('$PWD')).to_s"`
Packit Service 7770af
      ;;
Packit Service 7770af
    *)
Packit Service 7770af
      SASS_SPEC_PATH="$sass_spec_dir"
Packit Service 7770af
      ;;
Packit Service 7770af
  esac
Packit Service 7770af
  AC_SUBST(SASS_SPEC_PATH)
Packit Service 7770af
Packit Service 7770af
  # TODO: Remove this when automake requirements are 1.12+
Packit Service 7770af
  AC_MSG_CHECKING([whether we can use TAP mode])
Packit Service 7770af
  tmp=`$AWK '/TEST_LOG_DRIVER/' $srcdir/GNUmakefile.in`
Packit Service 7770af
  if test "x$tmp" != "x"; then
Packit Service 7770af
    use_tap=yes
Packit Service 7770af
  else
Packit Service 7770af
    use_tap=no
Packit Service 7770af
  fi
Packit Service 7770af
  AC_MSG_RESULT([$use_tap])
Packit Service 7770af
Packit Service 7770af
fi
Packit Service 7770af
Packit Service 7770af
AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "xyes")
Packit Service 7770af
AM_CONDITIONAL(USE_TAP, test "x$use_tap" = "xyes")
Packit Service 7770af
Packit Service 7770af
AC_ARG_ENABLE([coverage],
Packit Service 7770af
  [AS_HELP_STRING([--enable-coverage],
Packit Service 7770af
    [enable coverage report for test suite])],
Packit Service 7770af
    [enable_cov=$enableval],
Packit Service 7770af
    [enable_cov=no])
Packit Service 7770af
Packit Service 7770af
if test "x$enable_cov" = "xyes"; then
Packit Service 7770af
Packit Service 7770af
    AC_CHECK_PROG(GCOV, gcov, gcov)
Packit Service 7770af
Packit Service 7770af
    # Remove all optimization flags from C[XX]FLAGS
Packit Service 7770af
    changequote({,})
Packit Service 7770af
    CFLAGS=`echo "$CFLAGS -O1 -fno-omit-frame-pointer" | $SED -e 's/-O[0-9]*//g'`
Packit Service 7770af
    CXXFLAGS=`echo "$CXXFLAGS -O1 -fno-omit-frame-pointer" | $SED -e 's/-O[0-9]*//g'`
Packit Service 7770af
    changequote([,])
Packit Service 7770af
Packit Service 7770af
    AC_SUBST(GCOV)
Packit Service 7770af
fi
Packit Service 7770af
Packit Service 7770af
AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_cov" = "xyes")
Packit Service 7770af
Packit Service 7770af
AC_SUBST(PACKAGE_VERSION)
Packit Service 7770af
Packit Service 7770af
AC_MSG_NOTICE([Building libsass ($VERSION)])
Packit Service 7770af
Packit Service 7770af
AC_CONFIG_FILES([GNUmakefile src/GNUmakefile src/support/libsass.pc])
Packit Service 7770af
AC_OUTPUT