X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=configure.ac;h=ec1d9d0307295bc43cb8010bccb0150dcddc2e4f;hb=88912d6f0033bace799a3b18a5a73aefb18c2f87;hp=3c47c6b59b7cea507e9832a3549ea6213e7880ae;hpb=f58dde28504cd78267439ec232be9689ff82d47c;p=i3%2Fi3 diff --git a/configure.ac b/configure.ac index 3c47c6b5..ec1d9d03 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # 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.16], [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]) @@ -15,6 +15,12 @@ AC_CONFIG_SRCDIR([libi3/ipc_recv_message.c]) 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. @@ -25,14 +31,14 @@ AX_EXTEND_SRCDIR 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} rev-list --format=%cd --date=short -n1 $(git rev-parse HEAD) | tail -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]) @@ -53,8 +59,6 @@ AX_CHECK_ENABLE_DEBUG([yes], , [UNUSED_NDEBUG], [$is_release]) AC_PROG_CC_C99 -AC_DEFINE_UNQUOTED(SYSCONFDIR, "`eval echo $sysconfdir`", [Location of system configuration files]) - # For strnlen() and vasprintf(). AC_USE_SYSTEM_EXTENSIONS @@ -77,14 +81,17 @@ AC_SEARCH_LIBS([floor], [m], , [AC_MSG_FAILURE([cannot find the required floor() # libev does not ship with a pkg-config file :(. AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_run() function despite trying to link with -lev])]) -AC_SEARCH_LIBS([shm_open], [rt]) +AC_SEARCH_LIBS([shm_open], [rt], [], [], [-pthread]) + +AC_SEARCH_LIBS([iconv_open], [iconv], , +AC_SEARCH_LIBS([libiconv_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 dnl downloaded in a newer version and would like to overwrite. PKG_CHECK_MODULES([LIBSN], [libstartup-notification-1.0]) -PKG_CHECK_MODULES([XCB], [xcb xcb-xkb xcb-xinerama xcb-randr]) +PKG_CHECK_MODULES([XCB], [xcb xcb-xkb xcb-xinerama xcb-randr xcb-shape]) PKG_CHECK_MODULES([XCB_UTIL], [xcb-event xcb-util]) PKG_CHECK_MODULES([XCB_UTIL_CURSOR], [xcb-cursor]) PKG_CHECK_MODULES([XCB_UTIL_KEYSYMS], [xcb-keysyms]) @@ -94,6 +101,7 @@ PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon xkbcommon-x11]) PKG_CHECK_MODULES([YAJL], [yajl]) PKG_CHECK_MODULES([LIBPCRE], [libpcre >= 8.10]) PKG_CHECK_MODULES([PANGOCAIRO], [cairo >= 1.14.4 pangocairo]) +PKG_CHECK_MODULES([GLIBGOBJECT], [glib-2.0 gobject-2.0]) # Checks for programs. AC_PROG_AWK @@ -103,12 +111,27 @@ AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_LN_S -AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc]) -AC_PATH_PROG([PATH_XMLTO], [xmlto]) -AC_PATH_PROG([PATH_POD2MAN], [pod2man]) - -AM_CONDITIONAL([BUILD_MANS], [test x$PATH_ASCIIDOC != x && test x$PATH_XMLTO != x && test x$PATH_POD2MAN != x]) -AM_CONDITIONAL([BUILD_DOCS], [test x$PATH_ASCIIDOC != x]) +AC_ARG_ENABLE(docs, + AS_HELP_STRING( + [--disable-docs], + [disable building documentation]), + [ax_docs=$enableval], + [ax_docs=yes]) +AC_ARG_ENABLE(mans, + AS_HELP_STRING( + [--disable-mans], + [disable building manual pages]), + [ax_mans=$enableval], + [ax_mans=yes]) +AS_IF([test x$ax_docs = xyes || test x$ax_mans = xyes], [ + AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc]) +]) +AS_IF([test x$ax_mans = xyes], [ + AC_PATH_PROG([PATH_XMLTO], [xmlto]) + AC_PATH_PROG([PATH_POD2MAN], [pod2man]) +]) +AM_CONDITIONAL([BUILD_MANS], [test x$ax_mans = xyes && test x$PATH_ASCIIDOC != x && test x$PATH_XMLTO != x && test x$PATH_POD2MAN != x]) +AM_CONDITIONAL([BUILD_DOCS], [test x$ax_docs = xyes && test x$PATH_ASCIIDOC != x]) AM_PROG_AR @@ -146,6 +169,16 @@ else 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: