forked from MarvellEmbeddedProcessors/musdk-marvell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·207 lines (183 loc) · 6.8 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
# -*- 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}')
##########################################################################
# 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=false])
AM_CONDITIONAL([SAM_BUILD], [test x$sam = xtrue])
if test x$sam = xtrue; then
##########################################################################
# 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
##########################################################################
# Set IS_DDK_PATH - using --with-is-ddk-path
##########################################################################
AC_ARG_WITH([is-ddk-path],
AC_HELP_STRING([--with-is-ddk-path=DIR path to Marvell (C) SAM IS-DDK libs and headers],
[(or in the default path if not specified).]),
[IS_DDK_PATH=$withval
SAM_CFLAGS+="-DDRIVER_EIP197_HW_CONF_B "
SAM_CFLAGS+="-I$IS_DDK_PATH/Examples/Driver/build -I$IS_DDK_PATH/Examples/Driver/build/MVEBU "
SAM_CFLAGS+="-I$IS_DDK_PATH/Integration/SLAD_Adapter/incl "
SAM_CFLAGS+="-I$IS_DDK_PATH/Kit/DriverFramework/Basic_Defs_API/incl "
SAM_CFLAGS+="-I$IS_DDK_PATH/Kit/SABuilder/incl "
SAM_CFLAGS+="-I$IS_DDK_PATH/Kit/TokenBuilder/incl "
SAM_LDFLAGS+="-L$IS_DDK_PATH/Examples/Driver/build -L$IS_DDK_PATH/Examples/DemoApp_PEC/build "
SAM_LIBS+="-ldriver_197_u -lsa_bld_u -ltk_bld_u"
],[])
fi
##########################################################################
# Set MUSDK debug level
##########################################################################
MUSDK_DEBUG=4
AC_ARG_ENABLE([debug-level],
[ --enable-debug-level Set musdk debug-level: Range 1-5],
[if test $enableval -ge 1 -a $enableval -le 9; then
MUSDK_DEBUG=$enableval
fi])
MUSDK_CFLAGS+="-DMVCONF_DBG_LEVEL=$MUSDK_DEBUG "
##########################################################################
# Set BPOOL_COOKIE_SIZE
##########################################################################
BPOOL_COOKI_SZ=32
AC_ARG_ENABLE([bpool-cookie],
[ --enable-bpool-cookie Set bpool cookie size: 32/64],
[if test $enableval -eq 32 -o $enableval -eq 64; then
BPOOL_COOKI_SZ=$enableval
fi])
MUSDK_CFLAGS+="-DCONF_PP2_BPOOL_COOKIE_SIZE=$BPOOL_COOKI_SZ "
##########################################################################
# Set BPOOL_DMA_ADDR_USE_32B
##########################################################################
BPOOL_DMA_ADDR_USE_32B=32
AC_ARG_ENABLE([bpool-dma],
[ --enable-bpool-dma Set bpool dma_addr size: 32/64],
[if test $enableval -eq 32 -o $enableval -eq 64; then
BPOOL_DMA_ADDR_USE_32B=$enableval
fi])
if test $BPOOL_DMA_ADDR_USE_32B -eq 32; then
MUSDK_CFLAGS+="-DCONF_PP2_BPOOL_DMA_ADDR_USE_32B "
fi
##########################################################################
# 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])
if test $DMA_ADDR_SIZE -eq 64; then
MUSDK_CFLAGS+="-DMVCONF_ARCH_DMA_ADDR_T_64BIT "
fi
##########################################################################
# 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
# 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="-Wall "
#CFLAGS+="-Werror "
CFLAGS+="-Wstrict-prototypes "
CFLAGS+="-Wmissing-prototypes "
CFLAGS+="-pthread "
CFLAGS+="$MUSDK_CFLAGS $SAM_CFLAGS"
LDFLAGS+="$SAM_LDFLAGS"
LIBS+="$SAM_LIBS"
CC=${CROSS_COMPILE}gcc
LD=${CROSS_COMPILE}ld
AR=${CROSS_COMPILE}ar
# define LIBTOOL (for libraries)
LT_INIT
AC_CONFIG_FILES([Makefile
src/Makefile
apps/Makefile
apps/tests/Makefile
apps/examples/Makefile
])
##########################################################################
# 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_OUTPUT
AC_MSG_RESULT([
libdir: ${libdir}
includedir: ${includedir}
cc: ${CC}
cppflags: ${CPPFLAGS}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
libs: ${LIBS}
])