-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
305 lines (251 loc) · 9.6 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
AC_INIT
dnl versions of gstreamer and plugins-base
GST_MAJORMINOR=0.10
GST_REQUIRED=0.10.0
GSTPB_REQUIRED=0.10.0
dnl fill in your package name and version here
dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
dnl and 2... for a prerelease
dnl when going to/from release please set the nano correctly !
dnl releases only do Wall, cvs and prerelease does Werror too
AS_VERSION(gstticodecplugin, GST_PLUGIN_VERSION, 0, 10, 0, 1,
GST_PLUGIN_CVS="no", GST_PLUGIN_CVS="yes")
dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
AM_MAINTAINER_MODE
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
dnl make aclocal work in maintainer mode
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
AM_CONFIG_HEADER(config.h)
dnl check for tools
AC_PROG_CC
AC_PROG_LIBTOOL
dnl Local macros
AC_CONFIG_MACRO_DIR([m4])
dnl decide on error flags
AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
if test "x$GST_WALL" = "xyes"; then
GST_ERROR="-Wall"
fi
dnl Check for pkgconfig first
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
dnl Give error and exit if we don't have pkgconfig
if test "x$HAVE_PKGCONFIG" = "xno"; then
AC_MSG_ERROR(you need to have pkgconfig installed !)
fi
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.31], AC_DEFINE(GLIB_2_31_AND_UP,1,[Glib greater than 2.31]),AC_DEFINE(OLD_GLIB,1,[Glib lower than 2.31]))
dnl Now we're ready to ask for gstreamer libs and cflags
dnl And we can also ask for the right version of gstreamer
PKG_CHECK_MODULES(GST, \
gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
HAVE_GST=yes,HAVE_GST=no)
dnl Give error and exit if we don't have gstreamer
if test "x$HAVE_GST" = "xno"; then
AC_MSG_ERROR(you need gstreamer development packages installed !)
fi
dnl append GST_ERROR cflags to GST_CFLAGS
GST_CFLAGS="$GST_CFLAGS $GST_ERROR"
dnl make GST_CFLAGS and GST_LIBS available
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
dnl make GST_MAJORMINOR available in Makefile.am
AC_SUBST(GST_MAJORMINOR)
dnl If we need them, we can also use the base class libraries
PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED,
HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
dnl Give a warning if we don't have gstreamer libs
dnl you can turn this into an error if you need them
if test "x$HAVE_GST_BASE" = "xno"; then
AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR))
fi
dnl make _CFLAGS and _LIBS available
AC_SUBST(GST_BASE_CFLAGS)
AC_SUBST(GST_BASE_LIBS)
dnl If we need them, we can also use the gstreamer-plugins-base libraries
PKG_CHECK_MODULES(GSTPB_BASE,
gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQUIRED,
HAVE_GSTPB_BASE=yes, HAVE_GSTPB_BASE=no)
dnl Give a warning if we don't have gstreamer libs
dnl you can turn this into an error if you need them
if test "x$HAVE_GSTPB_BASE" = "xno"; then
AC_MSG_NOTICE(no GStreamer Plugins Base libraries found (gstreamer-plugins-base-$GST_MAJORMINOR))
fi
dnl make _CFLAGS and _LIBS available
AC_SUBST(GSTPB_BASE_CFLAGS)
AC_SUBST(GSTPB_BASE_LIBS)
dnl If we need them, we can also use the gstreamer-controller libraries
PKG_CHECK_MODULES(GSTCTRL,
gstreamer-controller-$GST_MAJORMINOR >= $GSTPB_REQUIRED,
HAVE_GSTCTRL=yes, HAVE_GSTCTRL=no)
dnl Give a warning if we don't have gstreamer-controller
dnl you can turn this into an error if you need them
if test "x$HAVE_GSTCTRL" = "xno"; then
AC_MSG_NOTICE(no GStreamer Controller libraries found (gstreamer-controller-$GST_MAJORMINOR))
fi
dnl make _CFLAGS and _LIBS available
AC_SUBST(GSTCTRL_CFLAGS)
AC_SUBST(GSTCTRL_LIBS)
dnl set the plugindir where plugins should be installed
if test "x${prefix}" = "x$HOME"; then
plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins"
else
plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
fi
AC_SUBST(plugindir)
dnl set proper LDFLAGS for plugins
GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
AC_SUBST(GST_PLUGIN_LDFLAGS)
dnl lttng-support is optional, used to get debug traces
AC_ARG_ENABLE(lttng-support,
AC_HELP_STRING([--enable-lttng-support],[use lttng if installed]),
[case "${enableval}" in
yes) enable_lttng_support=yes ;;
no) enable_lttng_support=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-lttng-support) ;;
esac
],
[enable_lttng_support=yes]) dnl Default value
AC_MSG_CHECKING([whether to use lttng if it is available])
if test "x$enable_lttng_support" = "xyes"; then
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES(UST,
lttng-ust >= 2.0.0,
HAVE_UST=yes, HAVE_UST=no)
dnl Give a warning if we don't have userspace tracer libraries
dnl you can turn this into an error if you need them
if test "x$HAVE_UST" = "xyes"; then
AC_MSG_NOTICE(Found userspace tracer library, enabling lltng support)
AC_DEFINE([HAVE_UST],[1],[LTTng userspace tracer support])
fi
dnl make _CFLAGS and _LIBS available
AC_SUBST(UST_CFLAGS)
AC_SUBST(UST_LIBS)
else
AC_MSG_RESULT([no (disabled via --disable-lttng-support)])
fi
dnl DMAI PLUGINS OPTIONS
dnl Define presets
AC_ARG_WITH(preset,
[AS_HELP_STRING([--with-preset=<preset>],
[Select a preset (autoselects the platform and optimizations for
the default codec servers):
dm355 (2.00), dm355s (dvsdk2.0 + DM355s codecs),
dm365 (dvsdk 4), dm6446 (dvsdk 2.00), dm357 (dvsdk 2)
dm6467 (dvsdk 3), omap35x (dvsdk 4), omapl138 (dvsdk 4),
dm37x (dvsdk 4)
])],
[preset=$withval]
)
if test "x$preset" = "xomap35x" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
AC_DEFINE([MPEG4_C64X_TI_ENCODER],[1],[TI DSP MPEG4 Encoder])
with_platform=omap35x;
fi
if test "x$preset" = "xdm37x" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
with_platform=dm37x;
fi
if test "x$preset" = "xdm355" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
with_platform=dm355;
fi
if test "x$preset" = "xdm365" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
AC_DEFINE([AACLC_ARM_ITTIAM_ENCODER],[1],[Ittiam ARM AACLC Encoder])
AC_DEFINE([H264_DM36x_TI_ENCODER],[1],[TI DM36x Platinum Encoder])
AC_DEFINE([H264_DM36x_TI_DECODER],[1],[TI DM36x Platinum Decoder])
with_platform=dm365;
with_xdc_config_basename=dm365;
fi
if test "x$preset" = "xdm357" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
with_platform=dm357;
fi
if test "x$preset" = "xdm6446" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
AC_DEFINE([MPEG4_C64X_TI_ENCODER],[1],[TI DSP MPEG4 Encoder])
with_platform=dm6446;
fi
if test "x$preset" = "xdm6467" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
with_platform=dm6467;
fi
if test "x$preset" = "xomapl138" ; then
AC_MSG_NOTICE(The following preset has been selected: $preset);
with_platform=omapl138;
fi
dnl Define the platform
AC_ARG_WITH(platform,
[AS_HELP_STRING([--with-platform=<platform>],
[Select the platform to build: dm355, dm365, dm357, dm6446, dm6467, omap35x, omapl138, dm37x])],
[AC_MSG_NOTICE([Setting the platform to "$withval"])
AC_SUBST([PLATFORM],[$withval])
]
)
if test "x$PLATFORM" = "xdm37x" ; then
with_xdcplatform=ti.platforms.evm3530;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xomap35x" ; then
with_xdcplatform=ti.platforms.evm3530;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xdm6446" ; then
with_xdcplatform=ti.platforms.evmDM6446;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xdm355" ; then
with_xdcplatform=ti.platforms.evmDM355;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xdm365" ; then
with_xdcplatform=ti.platforms.evmDM365;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xdm6467" ; then
with_xdcplatform=ti.platforms.evmDM6467;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xdm357" ; then
with_xdcplatform=ti.platforms.evmDM357;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
if test "x$PLATFORM" = "xomapl138" ; then
with_xdcplatform=ti.platforms.evmOMAPL138;
with_xdctarget=gnu.targets.arm.GCArmv5T;
fi
dnl Define the xdcplatform
AC_ARG_WITH(xdcplatform,
[AS_HELP_STRING([--with-xdcplatform=<xdcplatform>],
[Set a custom XDC platform (overwrite the one selected by platform)])],
[AC_SUBST([XDC_PLATFORM],[$withval])
AC_MSG_NOTICE([Setting the XDC platform to "$XDC_PLATFORM"])]
)
dnl Define the xdctarget
AC_ARG_WITH(xdctarget,
[AS_HELP_STRING([--with-xdctarget=<xdctarget>],
[Set a custom XDC target (overwrite the one selected by platform)])],
[AC_SUBST([XDC_TARGET],[$withval])
AC_MSG_NOTICE([Setting the XDC target to "$XDC_TARGET"])]
)
if test "${with_platform+set}" != set ; then
AC_MSG_ERROR([The platform is not defined, please set the platform or one
preset configuration])
fi
if test "${with_xdcplatform+set}" != set ; then
AC_MSG_ERROR([The XDC platform is not defined, please set the platform or
one preset configuration])
fi
if test "${with_xdctarget+set}" != set ; then
AC_MSG_ERROR([The XDC target is not defined, please set the platform or
one preset configuration])
fi
dnl Define XDC config file. This allow to compile against other codec servers
AC_SUBST([XDC_CONFIG_BASENAME],[$PLATFORM])
AC_ARG_WITH(xdc-config-basename,
[AS_HELP_STRING([--with-xdc-config-basename=<basename>],
[Set a custom base name for the XDC config file
(should be available on src/ directory)])],
[AC_SUBST([XDC_CONFIG_BASENAME],[$withval])
AC_MSG_NOTICE([Setting the XDC config basename to "$XDC_CONFIG_BASENAME"])]
)
AC_OUTPUT(Makefile m4/Makefile src/Makefile)