-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfigure.ac
326 lines (292 loc) · 10.7 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([1.0])
AC_INIT([musdk], [1.0], [[email protected]])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# no build parameters print
AM_SILENT_RULES([yes])
# set install prefix
AC_PREFIX_DEFAULT($(pwd)/usr/local)
AC_SUBST(includedir, '${exec_prefix}')
MUSDK_VERSION=$(git describe --long --always --dirty --tags)
# Add MUSDK types flags. They are always defined in musdk_lib compilation,
# and are optional during user compilation.
MUSDK_EXT_CFLAGS="-DMVCONF_TYPES_PUBLIC "
MUSDK_EXT_CFLAGS+="-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC "
##########################################################################
# Set PP2_BUILD - using --enable-pp2
##########################################################################
AC_ARG_ENABLE([pp2],
[ --enable-pp2 Enable pp2 driver and applications build],
[case "${enableval}" in
yes) pp2=true ;;
no) pp2=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-pp2]) ;;
esac],[pp2=true])
AM_CONDITIONAL([PP2_BUILD], [test x$pp2 = xtrue])
if test x$pp2 = xtrue; then
PP2_BUILT_FLAG="#define MVCONF_PP2_BUILT"
##########################################################################
# Set pp2-lock - using --enable-pp2-lock
##########################################################################
AC_ARG_ENABLE([pp2-lock],
[ --enable-pp2-lock Enable musdk pp2 driver HIF/TX locking],
[case "${enableval}" in
yes) pp2_lock=true ;;
no) pp2_lock=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-pp2-lock]) ;;
esac],[pp2_lock=false])
if test x$pp2_lock = xtrue; then
PP2_CFLAGS+="-DMVCONF_PP2_LOCK "
fi
if test x$pp2_lock = xtrue; then
##########################################################################
# Set pp2-lock-stat - using --enable-pp2-lock-stat
##########################################################################
AC_ARG_ENABLE([pp2-lock-stat],
[ --enable-pp2-lock-stat Enable musdk pp2 driver HIF/TX locking stats],
[case "${enableval}" in
yes) pp2_lock_stat=true ;;
no) pp2_lock_stat=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-pp2-lock-stat]) ;;
esac],[pp2_lock_stat=false])
if test x$pp2_lock_stat = xtrue; then
PP2_CFLAGS+="-DMVCONF_PP2_LOCK_STAT "
fi
fi
fi
##########################################################################
# Set NETA_BUILD - using --enable-neta
##########################################################################
AC_ARG_ENABLE([neta],
[ --enable-neta Enable neta driver and applications build],
[case "${enableval}" in
yes) neta=true ;;
no) neta=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-neta]) ;;
esac],[neta=true])
AM_CONDITIONAL([NETA_BUILD], [test x$neta = xtrue])
if test x$neta = xtrue; then
NETA_BUILT_FLAG="#define MVCONF_NETA_BUILT"
fi
##########################################################################
# Set NMP_BUILD - using --enable-nmp
##########################################################################
AC_ARG_ENABLE([nmp],
[ --enable-nmp Enable nmp build],
[case "${enableval}" in
yes) nmp=true ;;
no) nmp=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-nmp]) ;;
esac],[nmp=false])
##########################################################################
# Set GIU_BUILD - using --enable-giu
##########################################################################
AC_ARG_ENABLE([giu],
[ --enable-giu Enable giu driver and applications build],
[case "${enableval}" in
yes) giu=true ;;
no) giu=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-giu]) ;;
esac],[giu=false])
AM_CONDITIONAL([GIU_BUILD], [test x$giu = xtrue])
if test x$giu = xtrue; then
#enable NMP builf if GIU build was enabled
nmp=true
GIU_BUILT_FLAG="#define MVCONF_GIU_BUILT"
fi
AM_CONDITIONAL([NMP_BUILD], [test x$nmp = xtrue])
if test x$nmp = xtrue; then
NMP_BUILT_FLAG="#define MVCONF_NMP_BUILT"
fi
##########################################################################
# Set SAM_BUILD - using --enable-sam
##########################################################################
AC_ARG_ENABLE([sam],
[ --enable-sam Enable musdk sam driver and application build],
[case "${enableval}" in
yes) sam=true ;;
no) sam=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-sam]) ;;
esac],[sam=true])
AM_CONDITIONAL([SAM_BUILD], [test x$sam = xtrue])
if test x$sam = xtrue; then
SAM_BUILT_FLAG="#define MVCONF_SAM_BUILT"
##########################################################################
# Set MVCONF_SAM_STATS - using --enable-sam-statistics
##########################################################################
AC_ARG_ENABLE([sam-statistics],
[ --enable-sam-statistics Enable musdk sam driver statistics],
[case "${enableval}" in
yes) SAM_STATS=true ;;
no) SAM_STATS=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-sam-statistics]) ;;
esac],[SAM_STATS=false])
if test x$SAM_STATS = xtrue; then
SAM_CFLAGS+="-DMVCONF_SAM_STATS "
fi
##########################################################################
# Set MVCONF_SAM_DEBUG - using --enable-sam-debug
##########################################################################
AC_ARG_ENABLE([sam-debug],
[ --enable-sam-debug Enable musdk sam driver debug],
[case "${enableval}" in
yes) SAM_DEBUG=true ;;
no) SAM_DEBUG=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-sam-debug]) ;;
esac],[SAM_DEBUG=false])
if test x$SAM_DEBUG = xtrue; then
SAM_CFLAGS+="-DMVCONF_SAM_DEBUG "
fi
fi
##########################################################################
# Set DEBUG - using --enable-debug
##########################################################################
AC_ARG_ENABLE([debug],
[ --enable-debug Enable musdk debug],
[case "${enableval}" in
yes) DEBUG=true ;;
no) DEBUG=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[DEBUG=false])
if test x$DEBUG = xtrue; then
MUSDK_CFLAGS+="-DDEBUG "
fi
##########################################################################
# Set MUSDK debug level
##########################################################################
MUSDK_DEBUG=6
AC_ARG_ENABLE([debug-level],
[ --enable-debug-level Set musdk debug-level: Range 0-7],
[if test $enableval -ge 0 -a $enableval -le 7; then
MUSDK_DEBUG=$enableval
fi])
MUSDK_CFLAGS+="-DMVCONF_DBG_LEVEL=$MUSDK_DEBUG "
##########################################################################
# Enable MUSDK log facility
##########################################################################
AC_ARG_ENABLE([log],
[ --enable-log Enable syslog utility],
[case "${enableval}" in
yes) log=true ;;
no) log=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-log]) ;;
esac],[log=false])
if test x$log = xtrue; then
MUSDK_CFLAGS+="-DMVCONF_SYSLOG "
fi
AM_CONDITIONAL([LOG_BUILD], [test x$log = xtrue])
##########################################################################
# Enable MUSDK trave facility
##########################################################################
AC_ARG_ENABLE([trace],
[ --enable-trace Enable lttng trace utility],
[case "${enableval}" in
yes) trace=true ;;
no) trace=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-trace]) ;;
esac],[trace=false])
AM_CONDITIONAL([TRACE_BUILD], [test x$trace = xtrue])
##########################################################################
# Set DMA_ADDR_SIZE
##########################################################################
DMA_ADDR_SIZE=64
AC_ARG_ENABLE([dma-addr],
[ --enable-dma-addr Set dma_addr size: 32/64],
[if test $enableval -eq 32 -o $enableval -eq 64; then
DMA_ADDR_SIZE=$enableval
fi])
MUSDK_EXT_CFLAGS+="-DMVCONF_DMA_PHYS_ADDR_T_SIZE=$DMA_ADDR_SIZE "
##########################################################################
# Set MVCONF_SYS_DMA_UIO
##########################################################################
UIO_CMA=true
AC_ARG_ENABLE([uio-cma],
[ --enable-uio-cma Enable dma_memory by uio-cma],
[case "${enableval}" in
yes) UIO_CMA=true ;;
no) UIO_CMA=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-dmamem-uio-cma]) ;;
esac])
if test x$UIO_CMA = xtrue; then
MUSDK_CFLAGS+="-DMVCONF_SYS_DMA_UIO "
fi
##########################################################################
# Set MVCONF_SYS_DMA_HUGE_PAGE
##########################################################################
HUGE_PG=false
AC_ARG_ENABLE([uio-hugepage],
[ --enable-uio-hugepage Enable hugepages for dma_memory uio-cma],
[case "${enableval}" in
yes) HUGE_PG=true ;;
no) HUGE_PG=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-uio-hugepage]) ;;
esac])
if test x$HUGE_PG = xtrue; then
MUSDK_CFLAGS+="-DMVCONF_SYS_DMA_HUGE_PAGE "
fi
MUSDK_CFLAGS+=$MUSDK_EXT_CFLAGS
# Checks for programs.
AC_PROG_CC
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
CFLAGS="$CFLAGS -Wall "
CFLAGS+="-Werror "
CFLAGS+="-Wstrict-prototypes "
CFLAGS+="-Wmissing-prototypes "
CFLAGS+="-pthread "
CFLAGS+="$MUSDK_CFLAGS $SAM_CFLAGS $PP2_CFLAGS"
LDFLAGS+="$SAM_LDFLAGS"
LIBS+="$SAM_LIBS"
# define LIBTOOL (for libraries)
LT_INIT
AC_CONFIG_FILES([Makefile
src/Makefile
src/libmusdk.pc
apps/Makefile
apps/tests/Makefile
apps/examples/Makefile
])
# Auto-created code files
AC_CONFIG_FILES([src/include/env/mv_autogen_build_assert.h])
AC_CONFIG_FILES([src/include/env/mv_autogen_comp_flags.h])
# Variables used by auto-created code files.
# Should not be distributed among Makefiles.
AC_SUBST([DMA_ADDR_SIZE])
AM_SUBST_NOTMAKE([DMA_ADDR_SIZE])
AC_SUBST([PP2_BUILT_FLAG])
AM_SUBST_NOTMAKE([PP2_BUILT_FLAG])
AC_SUBST([NETA_BUILT_FLAG])
AM_SUBST_NOTMAKE([NETA_BUILT_FLAG])
AC_SUBST([GIU_BUILT_FLAG])
AM_SUBST_NOTMAKE([GIU_BUILT_FLAG])
AC_SUBST([SAM_BUILT_FLAG])
AM_SUBST_NOTMAKE([SAM_BUILT_FLAG])
AC_SUBST([NMP_BUILT_FLAG])
AM_SUBST_NOTMAKE([NMP_BUILT_FLAG])
##########################################################################
# distribute the changed variables among the Makefiles
AC_SUBST([LIBS])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([CFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_SUBST([LDFLAGS])
AC_SUBST([MUSDK_EXT_CFLAGS])
AC_SUBST([MUSDK_VERSION])
AC_OUTPUT
AC_MSG_RESULT([
MUSDK Library name: ${MUSDK_VERSION}
libdir: ${libdir}
includedir: ${includedir}
cc: ${CC}
cppflags: ${CPPFLAGS}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
libs: ${LIBS}
])