aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: d21771623904aaa851d5da2e8dd22ce2f2f53632 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
AC_INIT([kontext], [1.0.0], [christian@segundo.io])
AM_INIT_AUTOMAKE([foreign no-dependencies])
AC_CONFIG_FILES([Makefile])

AC_SUBST([CC])

AC_PATH_PROG([ENV_ABSOLUTE_PATH], [env])
AS_IF([test x"$ENV_ABSOLUTE_PATH" = x""], [AC_MSG_ERROR([env is not available])])
AC_SUBST([ENV_ABSOLUTE_PATH])

AC_CHECK_PROG(BASH_CHECK,bash,yes)
AC_CHECK_PROG(KUBECTL_CHECK,kubectl,yes)
AC_CHECK_PROG(MKTEMP_CHECK,mktemp,yes)
AS_IF([test x"$BASH_CHECK" != x"yes"], [AC_MSG_ERROR([bash is not available])])
AS_IF([test x"$KUBECTL_CHECK" != x"yes"], [AC_MSG_ERROR([kubectl is not available])])
AS_IF([test x"$MKTEMP_CHECK" != x"yes"], [AC_MSG_ERROR([mktemp is not available])])

AC_CACHE_CHECK([for GNU getopt], [ac_cv_path_gnu_getopt],
  [AC_PATH_PROGS_FEATURE_CHECK([gnu_getopt], [getopt],
    [[output=`$ac_path_gnu_getopt -V | grep util-linux`
      test -n "$output" \
      && ac_cv_path_gnu_getopt=$ac_path_gnu_getopt]],
    [AC_MSG_ERROR([could not find getopt from util-linux])])])
AC_SUBST([GNU_GETOPT], [$ac_cv_path_gnu_getopt])

AC_ARG_WITH([zsh-completion-dir],
    AS_HELP_STRING([--with-zsh-completion-dir[=PATH]],
        [Install the zsh auto-completion script in this directory. @<:@default=yes@:>@]),
    [],
    [with_zsh_completion_dir=yes])
AS_IF([test "x$with_zsh_completion_dir" = "xyes"],
  [ZSH_COMPLETION_DIR="$datadir/zsh/site-functions"],
  [ZSH_COMPLETION_DIR="$with_zsh_completion_dir"])

AC_SUBST([ZSH_COMPLETION_DIR])
AM_CONDITIONAL([ENABLE_ZSH_COMPLETION], [test "x$with_zsh_completion_dir" != "xno"])

AC_CONFIG_FILES([kontext], [chmod +x kontext])

AC_OUTPUT