summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 46924a17f909ec8eff246742af40673f4ab4c9c8 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
AC_INIT([talerbackoffice], [0.1.0], [taler-bug@gnunet.org])

AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AC_PROG_AWK
AC_PROG_SED

#
# Check for Python
#

PC_INIT([3.4])
pyheaders=0
PC_PYTHON_CHECK_HEADERS([pyheaders=1])
PC_PYTHON_CHECK_VERSION()


# Get python executable name
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python])
AM_PATH_PYTHON([3.4],, [:])
AC_SUBST([PYTHON])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])

#
# Check for pip3
# Since it is either pip3 or pip[3.4,3.5,3.6,3.7],
# we check using python module loading.
PIP_EXE="$PYTHON -m pip"
PIP_VERSION=$($PIP_EXE -V | grep -v "No module named" | tr -d '\n' | $AWK '{ print $2 }')

VERSION=$PIP_VERSION
AC_MSG_RESULT([pip3 version: $VERSION])

AX_COMPARE_VERSION([$VERSION],[lt],[6.0], [AC_MSG_ERROR([Please install pip3>=6.0])])

# On Debian systems, we may need to pass "--system" to pip3 to get
# to the desired installation target directory
AC_MSG_CHECKING([for pip3 --system])
$PIP_EXE install --help | grep '\-\-system' >> /dev/null
if test $? -ne 0;
then
   DEBIAN_PIP3_SYSTEM=""
else
   DEBIAN_PIP3_SYSTEM="--system"
fi
AC_SUBST(DEBIAN_PIP3_SYSTEM)

#
# Check for tsc
#
AC_CHECK_PROG([tsc],[tsc],[yes],[no])
AM_CONDITIONAL([HAVE_TSC], [test "x$tsc" = xyes])

#
# Check for Yarn
#
AC_MSG_CHECKING([Yarn])
yarn --version &> /dev/null
if test $? -ne 0;
  then
  AC_MSG_ERROR([Please install Yarn])
fi


#
# Check for minifier
#
AC_MSG_CHECKING([jsmin])
$PYTHON -m jsmin | grep "No module named" > /dev/null
if test $? -eq 0;
  then
  AC_MSG_ERROR([Please install Python3 module 'jsmin'])
fi

#
# Report
#
if test x$pyheaders != x1; then
  AC_MSG_WARN([Python headers not installed, might be required to build uwsgi])
fi


#
# Finish
#

AC_CONFIG_FILES([Makefile
  talerbackoffice/backoffice/static/web-common/Makefile])

AC_OUTPUT