2014-03-20 17:17:24 +01:00
|
|
|
|
2014-04-11 22:25:43 +02:00
|
|
|
AC_INIT([libpsl], [0.1], [tim.ruehsen@gmx.de], [libpsl], [http://github.com/rockdaboot/libpsl])
|
2014-03-20 17:17:24 +01:00
|
|
|
AC_PREREQ([2.59])
|
|
|
|
AM_INIT_AUTOMAKE([1.10 -Wall no-define])
|
|
|
|
|
|
|
|
# Generate two configuration headers; one for building the library itself with
|
|
|
|
# an autogenerated template, and a second one that will be installed alongside
|
|
|
|
# the library.
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
AC_PROG_CXX
|
|
|
|
LT_INIT([disable-static])
|
2014-03-20 22:43:04 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2014-03-20 17:17:24 +01:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2014-03-20 22:43:04 +01:00
|
|
|
#
|
|
|
|
# Gettext
|
|
|
|
#
|
|
|
|
AM_GNU_GETTEXT([external],[need-ngettext])
|
|
|
|
AM_GNU_GETTEXT_VERSION([0.18.1])
|
|
|
|
|
2014-04-02 10:27:13 +02:00
|
|
|
#
|
|
|
|
# check for gtk-doc
|
|
|
|
#
|
|
|
|
m4_ifdef([GTK_DOC_CHECK], [
|
|
|
|
GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
|
|
|
|
],[
|
|
|
|
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
|
|
|
|
])
|
|
|
|
|
|
|
|
#
|
|
|
|
# enable creation of man pages
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(man,[AC_HELP_STRING([--enable-man],
|
|
|
|
[generate man pages [default=auto]])],enable_man=yes,enable_man=no)
|
|
|
|
AS_IF([test "$enable_man" != no], [
|
|
|
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
|
|
|
AS_IF([test -z "$XSLTPROC"], [
|
|
|
|
AS_IF([test "$enable_man" = yes], [
|
|
|
|
AC_MSG_ERROR([xsltproc is required for --enable-man])
|
|
|
|
])
|
|
|
|
enable_man=no
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
|
|
|
|
AC_MSG_CHECKING([whether to generate man pages])
|
|
|
|
AS_IF([ test "$enable_man" != no ], [
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-03-20 17:17:24 +01:00
|
|
|
# Define these substitions here to keep all version information in one place.
|
|
|
|
# For information on how to properly maintain the library version information,
|
|
|
|
# refer to the libtool manual, section "Updating library version information":
|
|
|
|
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
|
|
|
AC_SUBST([LIBPSL_SO_VERSION], [0:0:0])
|
|
|
|
AC_SUBST([LIBPSL_API_VERSION], [0.1])
|
|
|
|
|
2014-03-30 17:02:56 +02:00
|
|
|
# Check for idn2
|
|
|
|
AC_CHECK_PROG(HAVE_IDN2, idn2, yes, AC_MSG_ERROR(Cannot find required tool 'idn2'.))
|
|
|
|
|
|
|
|
# Check for enable/disable builtin PSL data
|
|
|
|
AC_ARG_ENABLE(builtin,
|
|
|
|
AS_HELP_STRING([--disable-builtin], [do not compile PSL data into library]),
|
|
|
|
[
|
|
|
|
enable_builtin=no
|
|
|
|
], [
|
|
|
|
enable_builtin=yes
|
|
|
|
AC_DEFINE([WITH_BUILTIN], [1], [compile PSL data into library])
|
|
|
|
])
|
2014-04-17 13:09:29 +02:00
|
|
|
AM_CONDITIONAL([WITH_BUILTIN], [test $enable_builtin = yes])
|
2014-03-30 17:02:56 +02:00
|
|
|
|
2014-03-20 17:17:24 +01:00
|
|
|
# Check for valgrind
|
|
|
|
ac_enable_valgrind=no
|
|
|
|
AC_ARG_ENABLE(valgrind-tests,
|
|
|
|
AS_HELP_STRING([--enable-valgrind-tests], [enable using Valgrind for tests]),
|
|
|
|
[ac_enable_valgrind=$enableval], [ac_enable_valgrind=no])
|
|
|
|
|
|
|
|
if test "${ac_enable_valgrind}" = "yes" ; then
|
|
|
|
AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
|
|
|
|
if test "$HAVE_VALGRIND" = "yes" ; then
|
|
|
|
VALGRIND_ENVIRONMENT="valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-origins=yes"
|
|
|
|
AC_SUBST(VALGRIND_ENVIRONMENT)
|
|
|
|
TESTS_INFO="Test suite will be run under Valgrind"
|
|
|
|
else
|
|
|
|
TESTS_INFO="Valgrind not found"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
TESTS_INFO="Valgrind testing not enabled"
|
|
|
|
fi
|
|
|
|
|
2014-04-13 16:35:28 +02:00
|
|
|
# Check for custom PSL file
|
|
|
|
AC_ARG_WITH(psl-file,
|
|
|
|
AC_HELP_STRING([--with-psl-file=[PATH]],
|
|
|
|
[path to PSL file]),
|
|
|
|
PSL_FILE=$withval,
|
|
|
|
PSL_FILE="\$(top_srcdir)/data/effective_tld_names.dat")
|
|
|
|
AC_SUBST(PSL_FILE)
|
|
|
|
|
2014-04-13 16:43:03 +02:00
|
|
|
# Check for custom PSL test file
|
|
|
|
AC_ARG_WITH(psl-testfile,
|
|
|
|
AC_HELP_STRING([--with-psl-testfile=[PATH]],
|
|
|
|
[path to PSL test file]),
|
|
|
|
PSL_TESTFILE=$withval,
|
|
|
|
PSL_TESTFILE="\$(top_srcdir)/data/test_psl.txt")
|
|
|
|
AC_SUBST(PSL_TESTFILE)
|
|
|
|
|
2014-03-20 17:17:24 +01:00
|
|
|
# Override the template file name of the generated .pc file, so that there
|
|
|
|
# is no need to rename the template file when the API version changes.
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
include/Makefile
|
|
|
|
src/Makefile
|
2014-04-11 17:16:23 +02:00
|
|
|
tools/Makefile
|
2014-03-20 17:17:24 +01:00
|
|
|
po/Makefile.in
|
2014-04-02 10:27:13 +02:00
|
|
|
docs/libpsl/Makefile
|
2014-03-20 22:43:04 +01:00
|
|
|
data/Makefile
|
2014-03-20 17:17:24 +01:00
|
|
|
tests/Makefile
|
|
|
|
libpsl-${LIBPSL_API_VERSION}.pc:libpsl.pc.in])
|
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
AC_MSG_NOTICE([Summary of build options:
|
|
|
|
|
|
|
|
Version: ${PACKAGE_VERSION}
|
|
|
|
Host OS: ${host_os}
|
|
|
|
Install prefix: ${prefix}
|
|
|
|
Compiler: ${CC}
|
|
|
|
CFlags: ${CFLAGS} ${CPPFLAGS}
|
|
|
|
LDFlags: ${LDFLAGS}
|
2014-03-30 17:02:56 +02:00
|
|
|
Builtin PSL: ${enable_builtin}
|
2014-04-13 16:35:28 +02:00
|
|
|
PSL File: ${PSL_FILE}
|
2014-04-13 16:43:03 +02:00
|
|
|
PSL Test File: ${PSL_TESTFILE}
|
2014-03-20 17:17:24 +01:00
|
|
|
Tests: ${TESTS_INFO}
|
|
|
|
])
|