-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
118 lines (89 loc) · 3.26 KB
/
configure.ac
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
AC_INIT([rhasspy-microphone-pyaudio-hermes], [0.1.0], [mike@rhasspy.org])
AC_CONFIG_MACRO_DIR([m4])
PC_INIT([3.7.0])
dnl ---------------------------------------------------------------------------
AC_PREFIX_DEFAULT([$PWD/.venv])
dnl Template files to write
AC_CONFIG_FILES([Makefile rhasspy-microphone-pyaudio-hermes])
AC_CANONICAL_HOST
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_CC
AC_PROG_CXX
dnl ---------------------------------------------------------------------------
is_virtualenv_enabled=yes
is_dependency_check_enabled=yes
dnl An in-place install does not include Rhasspy Python modules, since they will
dnl be used directly from source.
is_in_place=no
dnl Set architectures based on host CPU
AS_CASE([$host_cpu],
[armv6l],[
dnl ARM 32-bit v6 (Pi 1/0)
docker_arch=armv6
],
[armv7l],[
dnl ARM 32-bit v7 (Pi 2/3/4)
docker_arch=armv7
],
[aarch64],[
dnl ARM 64-bit (Pi 3/4)
docker_arch=arm64
],
[x86_64],[
dnl x86_64 compatible
docker_arch=amd64
])
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([in-place],
AS_HELP_STRING([--enable-in-place],
[do not install Rhasspy Python modules in virtual environment (will be used from source)]))
dnl ---------------------------------------------------------------------------
dnl Python virtual environment
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([virtualenv],
[AS_HELP_STRING([--disable-virtualenv],
[don't create a Python virtual environment at prefix])])
AC_ARG_VAR([VIRTUALENV_FLAGS], [flags to pass to when creating virtual environment])
dnl In-place install
AS_CASE([$enable_in_place],
[yes],[is_in_place=yes],
[no],[is_in_place=no])
dnl ---------------------------------------------------------------------------
dnl Extra Dependency Checks
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([dependency-check],
AS_HELP_STRING([--disable-dependency-check],
[disable checking for external dependencies]),
[is_dependency_check_enabled=$enableval])
AS_IF([test "x$is_dependency_check_enabled" = xyes], [
dnl PyAudio requires portaudio.h
AS_IF([test "x$is_pyaudio_enabled" = xyes],
[
AC_CHECK_HEADER([portaudio.h], [], [
AC_MSG_ERROR([portaudio development libary is required for PyAudio microphone (portaudio19-dev package)])
])
])
])
dnl ---------------------------------------------------------------------------
dnl Summary
dnl ---------------------------------------------------------------------------
dnl Prefix is NONE for some reason instead of default value
summary_prefix=$prefix
AS_IF([test "x$summary_prefix" = xNONE], [
summary_prefix=$PWD/.venv
])
AS_ECHO(["
configuration summary:
architecture: ${host_cpu}/${docker_arch}
prefix: ${summary_prefix}
virtualenv: ${is_virtualenv_enabled}
in-place: ${is_in_place}"])
AS_ECHO([""])
dnl ---------------------------------------------------------------------------
dnl Output
dnl ---------------------------------------------------------------------------
AC_SUBST([VIRTUALENV], [$is_virtualenv_enabled])
AC_SUBST([DOCKER_ARCH], [$docker_arch])
AC_SUBST([IN_PLACE], [$is_in_place])
AC_OUTPUT