# Run autoreconf -fi to generate a configure script from this file.
AC_PREREQ([2.69])
-AC_INIT([i3], [4.12], [https://github.com/i3/i3/issues])
+AC_INIT([i3], [4.14.1], [https://github.com/i3/i3/issues])
# For AX_EXTEND_SRCDIR
AX_ENABLE_BUILDDIR
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
+dnl Verify macros defined in m4/ such as AX_SANITIZERS are not present in the
+dnl output, i.e. are replaced as expected. This line results in a better error
+dnl message when using aclocal < 1.13 (which does not understand
+dnl AC_CONFIG_MACRO_DIR) without passing the -I m4 parameter.
+m4_pattern_forbid([AX_SANITIZERS])
+
# Verify we are using GNU make because we use '%'-style pattern rules in
# Makefile.am, which are a GNU make extension. Pull requests to replace
# '%'-style pattern rules with a more portable alternative are welcome.
AS_IF([test -d ${srcdir}/.git],
[
- VERSION="$(git describe --tags --abbrev=0)"
- I3_VERSION="$(git describe --tags --always) ($(git log --pretty=format:%cd --date=short -n1), branch \\\"$(git describe --tags --always --all | sed s:heads/::)\\\")"
+ VERSION="$(git -C ${srcdir} describe --tags --abbrev=0)"
+ I3_VERSION="$(git -C ${srcdir} describe --tags --always) ($(git -C ${srcdir} log --pretty=format:%cd --date=short -n1), branch \\\"$(git -C ${srcdir} describe --tags --always --all | sed s:heads/::)\\\")"
# Mirrors what libi3/is_debug_build.c does:
is_release=$(test $(echo "${I3_VERSION}" | cut -d '(' -f 1 | wc -m) -lt 10 && echo yes || echo no)
],
[
VERSION="$(cut -d '-' -f 1 ${srcdir}/I3_VERSION | cut -d ' ' -f 1)"
- I3_VERSION="$(cat ${srcdir}/I3_VERSION)"
+ I3_VERSION="$(sed -e 's/@<:@\"?\\@:>@/\\&/g' ${srcdir}/I3_VERSION)"
is_release="$(grep -q non-git ${srcdir}/I3_VERSION && echo no || echo yes)"
])
+AC_SUBST([I3_VERSION], [$I3_VERSION])
MAJOR_VERSION="$(echo ${VERSION} | cut -d '.' -f 1)"
MINOR_VERSION="$(echo ${VERSION} | cut -d '.' -f 2)"
PATCH_VERSION="$(echo ${VERSION} | cut -d '.' -f 3)"
AC_PROG_CC_C99
-AC_DEFINE_UNQUOTED(SYSCONFDIR, "`eval echo $sysconfdir`", [Location of system configuration files])
-
# For strnlen() and vasprintf().
AC_USE_SYSTEM_EXTENSIONS
AC_SEARCH_LIBS([shm_open], [rt])
+AC_SEARCH_LIBS([iconv_open], [iconv], , [AC_MSG_FAILURE([cannot find the required iconv_open() function despite trying to link with -liconv])])
+
AX_PTHREAD
dnl Each prefix corresponds to a source tarball which users might have
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h locale.h netinet/in.h paths.h stddef.h stdint.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h], , [AC_MSG_FAILURE([cannot find the $ac_header header, which i3 requires])])
-AC_CONFIG_FILES([Makefile testcases/lib/i3test.pm])
+AC_CONFIG_FILES([Makefile testcases/lib/i3test.pm man/asciidoc.conf])
AC_CONFIG_FILES([testcases/complete-run.pl], [chmod +x testcases/complete-run.pl])
# Enable address sanitizer for non-release builds. The performance hit is a
print_BUILD_MANS=no
fi
+in_git_worktree=`git rev-parse --is-inside-work-tree 2>/dev/null`
+if [[ "$in_git_worktree" = "true" ]]; then
+ git_dir=`git rev-parse --git-dir 2>/dev/null`
+ srcdir=`dirname "$git_dir"`
+ exclude_dir=`pwd | sed "s,^$srcdir,,g"`
+ if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then
+ echo "$exclude_dir" >> "$git_dir/info/exclude"
+ fi
+fi
+
echo \
"--------------------------------------------------------------------------------
build configured: