summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac51
1 files changed, 47 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 3ff9f79..5b527de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
#
-# Copyright (C) 2013, 2017, 2019, 2021 P. J. McDermott
+# Copyright (C) 2013, 2017, 2019, 2021, 2022 P. J. McDermott
#
# This file is part of @
#
@@ -30,6 +30,14 @@ AM_CONDITIONAL([IN_GIT],
AM_CONDITIONAL([OUT_OF_TREE], [test x"${srcdir}" != x'.' ])
+AM_CONDITIONAL([CROSS_COMPILING], [! test x"${build_alias}" = x"${host_alias}"])
+
+GETTEXT_PACKAGE="${PACKAGE}"
+AC_SUBST([GETTEXT_PACKAGE])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"],
+ [Define the gettext package to be used.])
+AM_GNU_GETTEXT([external])
+
save_CFLAGS="${CFLAGS-}"
AC_PROG_CC()
AM_PROG_CC_C_O()
@@ -38,8 +46,9 @@ test -d "${srcdir}/.git" || CFLAGS="${save_CFLAGS}"
funcs_missing=false
AC_CHECK_FUNCS(
[\
- calloc fprintf fputs free isspace localtime mktime printf \
- realloc setvbuf sleep strerror strlen strftime strptime time
+ calloc difftime fprintf fputs free isspace localtime mktime \
+ printf realloc setvbuf sleep strerror strlen strftime strptime \
+ time
],
[],
[funcs_missing=true])
@@ -53,6 +62,40 @@ if ${funcs_missing}; then
AC_MSG_ERROR([required functions are missing])
fi
+AC_PROG_LN_S()
+AC_ARG_ENABLE([symlink],
+ [AS_HELP_STRING([--disable-symlink],
+ [don't install \`@' symbolic link])],
+ [case "${enableval}" in yes|no) symlink=${enableval};;
+ *) AC_MSG_ERROR(
+ [bad value ${enableval} for symlink option]);;
+ esac],
+ [symlink=yes]
+)
+AM_CONDITIONAL([ENABLE_SYMLINK], [test x"${symlink}" = x'yes'])
+
+AC_ARG_ENABLE([tests],
+ [AS_HELP_STRING([--disable-tests],
+ [exclude test suite support from executable])],
+ [case "${enableval}" in yes|no) tests=${enableval};;
+ *) AC_MSG_ERROR(
+ [bad value ${enableval} for tests option]);;
+ esac],
+ [tests=yes]
+)
+if test x"${tests}" = x'yes'; then
+ AC_DEFINE([ENABLE_TESTS], [1],
+ [Define to 1 to include test suite support])
+ AC_CHECK_FUNCS(
+ [sscanf],
+ [],
+ [AC_MSG_ERROR([required functions are missing])])
+else
+ AC_DEFINE([ENABLE_TESTS], [0],
+ [Define to 1 to include test suite support])
+fi
+AM_CONDITIONAL([ENABLE_TESTS], [test x"${tests}" = x'yes'])
+
AX_CFLAGS_WARN_ALL() dnl Adds -Wall or equivalent
AX_CHECK_COMPILE_FLAG([-Wpedantic], [AX_APPEND_FLAG([-Wpedantic])])
AX_CHECK_COMPILE_FLAG([-Wextra], [AX_APPEND_FLAG([-Wextra])])
@@ -114,6 +157,6 @@ for flag in -Os -fno-unwind-tables -fno-asynchronous-unwind-tables \
AX_CHECK_COMPILE_FLAG([${flag}], [AX_APPEND_FLAG([${flag}])])
done
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile po/Makefile.in])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT()