Update Initialization code from Tizen 2.4
[platform/upstream/gst-plugins-tizen.git] / configure.ac
1
2 AC_INIT(extension, 1.0)
3  
4 dnl versions of gstreamer and plugins-base
5 GST_MAJORMINOR=1.0
6 GST_REQUIRED=1.2.0
7 GSTPB_REQUIRED=1.2.0
8 EFL_REQUIRED=1.0.0
9
10 dnl fill in your package name and version here
11 dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
12 dnl and 2... for a prerelease
13
14 dnl when going to/from release please set the nano correctly !
15 dnl releases only do Wall, cvs and prerelease does Werror too
16 AS_VERSION(gst-plugin, GST_PLUGIN_VERSION, 0, 10, 0, 1,
17     GST_PLUGIN_CVS="no", GST_PLUGIN_CVS="yes")
18
19 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
20 AM_MAINTAINER_MODE
21
22 #AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
23 AM_INIT_AUTOMAKE
24
25 #AC_CONFIG_MACRO_DIR([m4])
26
27 dnl make aclocal work in maintainer mode
28 dnl AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
29
30 dnl Add parameters for aclocal
31 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
32
33 AM_CONFIG_HEADER(config.h)
34
35 dnl check for tools
36 AC_PROG_CC
37 AC_PROG_CXX
38 AC_PROG_LIBTOOL
39
40 dnl decide on error flags
41 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
42                                                                                 
43 if test "x$GST_WALL" = "xyes"; then
44    GST_ERROR="$GST_ERROR -Wall"
45                                                                                 
46 #   if test "x$GST_PLUGIN_CVS" = "xyes"; then
47 #     AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
48 #   fi
49 fi
50
51 dnl Check for pkgconfig first
52 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
53
54 dnl Give error and exit if we don't have pkgconfig
55 if test "x$HAVE_PKGCONFIG" = "xno"; then
56   AC_MSG_ERROR(you need to have pkgconfig installed !)
57 fi
58
59 dnl Now we're ready to ask for gstreamer libs and cflags
60 dnl And we can also ask for the right version of gstreamer
61 AM_CONDITIONAL([IS_VODA_SDK], [test "x$DISTRO" = "xvodafone-sdk"])
62 AM_CONDITIONAL([ISPROTECTOR_VODA_SDK], [test "x$DISTRO" = "xvodafone-sdk" && test "x$MACHINE" = "xprotector"])
63 AM_CONDITIONAL([ISVOLANS_VODA_SDK], [test "x$DISTRO" = "xvodafone-sdk" && test "x$MACHINE" = "xvolans"])
64 AM_CONDITIONAL([ISPROTECTOR_TARGET], [test "x$ARCH" = "xarm" && test "x$MACHINE" = "xprotector"])
65 AM_CONDITIONAL([ISVOLANS_TARGET], [test "x$ARCH" = "xarm" && test "x$MACHINE" = "xvolans"])
66
67 PKG_CHECK_MODULES(GST, \
68   gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
69   HAVE_GST=yes,HAVE_GST=no)
70
71 dnl Give error and exit if we don't have gstreamer
72 if test "x$HAVE_GST" = "xno"; then
73   AC_MSG_ERROR(you need gstreamer development packages installed !)
74 fi
75
76 dnl append GST_ERROR cflags to GST_CFLAGS
77 GST_CFLAGS="$GST_CFLAGS $GST_ERROR"
78
79 dnl make GST_CFLAGS and GST_LIBS available
80 PKG_CHECK_MODULES(GST, gstreamer-1.0 >= 1.2.0)
81 AC_SUBST(GST_CFLAGS)
82 AC_SUBST(GST_LIBS)
83
84 dnl make GST_MAJORMINOR available in Makefile.am
85 AC_SUBST(GST_MAJORMINOR)
86
87 dnl If we need them, we can also use the base class libraries
88 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED,
89                   HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
90
91 dnl Give a warning if we don't have gstreamer libs
92 dnl you can turn this into an error if you need them
93 if test "x$HAVE_GST_BASE" = "xno"; then
94   AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR))
95 fi
96
97 dnl make _CFLAGS and _LIBS available
98 AC_SUBST(GST_BASE_CFLAGS)
99 AC_SUBST(GST_BASE_LIBS)
100
101 dnl If we need them, we can also use the gstreamer-plugins-base libraries
102 PKG_CHECK_MODULES(GSTPB_BASE,
103                   gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQUIRED,
104                   HAVE_GSTPB_BASE=yes, HAVE_GSTPB_BASE=no)
105
106 dnl Give a warning if we don't have gstreamer libs
107 dnl you can turn this into an error if you need them
108 if test "x$HAVE_GSTPB_BASE" = "xno"; then
109   AC_MSG_NOTICE(no GStreamer Plugins Base libraries found (gstreamer-plugins-base-$GST_MAJORMINOR))
110 fi
111
112 dnl make _CFLAGS and _LIBS available
113 AC_SUBST(GSTPB_BASE_CFLAGS)
114 AC_SUBST(GSTPB_BASE_LIBS)
115
116 dnl If we need them, we can also use the gstreamer-controller libraries
117 PKG_CHECK_MODULES(GSTCTRL,
118                   gstreamer-controller-$GST_MAJORMINOR >= $GSTPB_REQUIRED,
119                   HAVE_GSTCTRL=yes, HAVE_GSTCTRL=no)
120
121 dnl Give a warning if we don't have gstreamer-controller
122 dnl you can turn this into an error if you need them
123 if test "x$HAVE_GSTCTRL" = "xno"; then
124   AC_MSG_NOTICE(no GStreamer Controller libraries found (gstreamer-controller-$GST_MAJORMINOR))
125 fi
126
127 dnl make _CFLAGS and _LIBS available
128 AC_SUBST(GSTCTRL_CFLAGS)
129 AC_SUBST(GSTCTRL_LIBS)
130
131 dnl set the plugindir where plugins should be installed
132 if test "x${prefix}" = "x$HOME"; then
133   plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins"
134 else
135   plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
136 fi
137 AC_SUBST(plugindir)
138
139 dnl set proper LDFLAGS for plugins
140 #GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
141 GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\|FIR_\|arkamys_malloc\|arkamys_free\).*'
142 #GST_PLUGIN_LDFLAGS='-module -avoid-version'
143 AC_SUBST(GST_PLUGIN_LDFLAGS)
144
145
146 PKG_CHECK_MODULES(GST_AUDIO, gstreamer-audio-$GST_MAJORMINOR >= $GST_REQUIRED )
147
148
149 dnl make _CFLAGS and _LIBS available
150 AC_SUBST(GST_AUDIO_CFLAGS)
151 AC_SUBST(GST_AUDIO_LIBS)
152
153 PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-$GST_MAJORMINOR >= $GST_REQUIRED)
154
155 dnl make _CFLAGS and _LIBS available
156 AC_SUBST(GST_VIDEO_CFLAGS)
157 AC_SUBST(GST_VIDEO_LIBS)
158
159 dnl xvimagesrc _CFLAGS and _LIB available
160
161 PKG_CHECK_MODULES(DRI2, libdri2)
162 AC_SUBST(DRI2_CFLAGS)
163 AC_SUBST(DRI2_LIBS)
164
165 PKG_CHECK_MODULES(X11, x11)
166 AC_SUBST(X11_CFLAGS)
167 AC_SUBST(X11_LIBS)
168
169 PKG_CHECK_MODULES(XEXT, xext)
170 AC_SUBST(XEXT_CFLAGS)
171 AC_SUBST(XEXT_LIBS)
172
173 PKG_CHECK_MODULES(XV, xv)
174 AC_SUBST(XV_CFLAGS)
175 AC_SUBST(XV_LIBS)
176
177 PKG_CHECK_MODULES(XDAMAGE, xdamage)
178 AC_SUBST(XDAMAGE_CFLAGS)
179 AC_SUBST(XDAMAGE_LIBS)
180
181 PKG_CHECK_MODULES(DRM, libdrm)
182 AC_SUBST(DRM_CFLAGS)
183 AC_SUBST(DRM_LIBS)
184
185 PKG_CHECK_MODULES(DRM, libdrm-devel)
186 AC_SUBST(DRM_DEVEL_CFLAGS)
187 AC_SUBST(DRM_DEVEL_LIBS)
188
189 PKG_CHECK_MODULES(TBM, libtbm)
190 AC_SUBST(TBM_CFLAGS)
191 AC_SUBST(TBM_LIBS)
192
193 dnl required package for evasimagesink/evaspixmapsink
194 PKG_CHECK_MODULES(EFL, [
195   evas >= $EFL_REQUIRED
196   ecore >= $EFL_REQUIRED
197   ecore-x >= $EFL_REQUIRED
198 ], [
199   AC_SUBST(EFL_CFLAGS)
200   AC_SUBST(EFL_LIBS)
201 ], [
202   AC_MSG_ERROR([
203       You need to install or upgrade the EFL development
204       packages on your system. On debian-based systems these are
205       libevas-dev and libecore-dev.
206       The minimum version required is $EFL_REQUIRED.
207   ])
208 ])
209
210 dnl *** belows are related to evaspixmapsink plug-ins ***
211 AG_GST_ARG_WITH_PACKAGE_NAME
212 AG_GST_ARG_WITH_PACKAGE_ORIGIN
213
214 dnl set license and copyright notice
215 GST_LICENSE="LGPL"
216 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
217 AC_SUBST(GST_LICENSE)
218
219 echo
220 AC_MSG_NOTICE([Checking libraries for evaspixmapsink plugin])
221 echo
222 dnl *** X11 ***
223 translit(dnm, m, l) AM_CONDITIONAL(USE_X, true)
224 AG_GST_CHECK_FEATURE(X, [X libraries and plugins],
225                   [evaspixmapsink], [
226   AC_PATH_XTRA
227   ac_cflags_save="$CFLAGS"
228   ac_cppflags_save="$CPPFLAGS"
229   CFLAGS="$CFLAGS $X_CFLAGS"
230   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
231
232   dnl now try to find the HEADER
233   AC_CHECK_HEADER(X11/Xlib.h, HAVE_X="yes", HAVE_X="no")
234
235   if test "x$HAVE_X" = "xno"
236   then
237     AC_MSG_NOTICE([cannot find X11 development files])
238   else
239     dnl this is much more than we want
240     X_LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS"
241     dnl AC_PATH_XTRA only defines the path needed to find the X libs,
242     dnl it does not add the libs; therefore we add them here
243     X_LIBS="$X_LIBS -lX11"
244     AC_SUBST(X_CFLAGS)
245     AC_SUBST(X_LIBS)
246   fi
247   AC_SUBST(HAVE_X)
248   CFLAGS="$ac_cflags_save"
249   CPPFLAGS="$ac_cppflags_save"
250 ])
251
252 dnl Check for Xv extension
253 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
254 AG_GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions],
255                   [evaspixmapsink], [
256 AG_GST_CHECK_XV
257 ])
258
259 dnl check for X Shm
260 translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
261 AG_GST_CHECK_FEATURE(XSHM, [X Shared Memory extension], , [
262   if test x$HAVE_X = xyes; then
263     AC_CHECK_LIB(Xext, XShmAttach,
264                  HAVE_XSHM="yes", HAVE_XSHM="no",
265                  $X_LIBS)
266     if test "x$HAVE_XSHM" = "xyes"; then
267       XSHM_LIBS="-lXext"
268     else
269       dnl On AIX, it is in XextSam instead, but we still need -lXext
270       AC_CHECK_LIB(XextSam, XShmAttach,
271                    HAVE_XSHM="yes", HAVE_XSHM="no",
272                    $X_LIBS)
273       if test "x$HAVE_XSHM" = "xyes"; then
274         XSHM_LIBS="-lXext -lXextSam"
275       fi
276     fi
277   fi
278 ], , [
279   AC_SUBST(HAVE_XSHM)
280   AC_SUBST(XSHM_LIBS)
281 ])
282
283 dnl PKG_CHECK_MODULES(UDEVMGR, unified-dev-mgr)
284 dnl AC_SUBST(UDEVMGR_CFLAGS)
285 dnl AC_SUBST(UDEVMGR_LIBS)
286
287 dnl use ext-encodebin --------------------------------------------------------------------------
288 AC_ARG_ENABLE(ext-encodebin, AC_HELP_STRING([--enable-ext-encodebin], [using encodebin]),
289   [
290     case "${enableval}" in
291       yes) GST_EXT_USE_EXT_ENCODEBIN=yes ;;
292       no)  GST_EXT_USE_EXT_ENCODEBIN=no ;;
293       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-encodebin) ;;
294     esac
295   ],
296   [GST_EXT_USE_EXT_ENCODEBIN=yes])
297 AM_CONDITIONAL(GST_EXT_USE_EXT_ENCODEBIN, test "x$GST_EXT_USE_EXT_ENCODEBIN" = "xyes")
298
299 dnl use ext-evasimagesink --------------------------------------------------------------------------
300 AC_ARG_ENABLE(ext-evasimagesink, AC_HELP_STRING([--enable-ext-evasimagesink], [using evasimagesink]),
301   [
302     case "${enableval}" in
303       yes) GST_EXT_USE_EXT_EVASIMAGESINK=yes ;;
304       no)  GST_EXT_USE_EXT_EVASIMAGESINK=no ;;
305       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-evasimagesink) ;;
306     esac
307   ],
308   [GST_EXT_USE_EXT_EVASIMAGESINK=yes])
309 AM_CONDITIONAL(GST_EXT_USE_EXT_EVASIMAGESINK, test "x$GST_EXT_USE_EXT_EVASIMAGESINK" = "xyes")
310
311 dnl use evaspixmapsink ---------------------------------------------------------------------------
312 AC_ARG_ENABLE(ext-evaspixmapsink, AC_HELP_STRING([--enable-ext-evaspixmapsink], [using evaspixmapsink]),
313   [
314     case "${enableval}" in
315       yes) GST_EXT_USE_EXT_EVASPIXMAPSINK=yes ;;
316       no)  GST_EXT_USE_EXT_EVASPIXMAPSINK=no ;;
317       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-evaspixmapsink) ;;
318     esac
319   ],
320   [GST_EXT_USE_EXT_EVASPIXMAPSINK=yes])
321 AM_CONDITIONAL(GST_EXT_USE_EXT_EVASPIXMAPSINK, test "x$GST_EXT_USE_EXT_EVASPIXMAPSINK" = "xyes")
322
323 dnl use ext-xvimagesrc--------------------------------------------------------------------------
324 AC_ARG_ENABLE(ext-xvimagesrc, AC_HELP_STRING([--enable-ext-xvimagesrc], [using xvimagesrc]),
325   [
326     case "${enableval}" in
327       yes) GST_EXT_USE_EXT_XVIMAGESRC=yes ;;
328       no)  GST_EXT_USE_EXT_XVIMAGESRC=no ;;
329       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-xvimagesrc) ;;
330     esac
331   ],
332   [GST_EXT_USE_EXT_XVIMAGESRC=yes])
333 AM_CONDITIONAL(GST_EXT_USE_EXT_XVIMAGESRC, test "x$GST_EXT_USE_EXT_XVIMAGESRC" = "xyes")
334
335 dnl use ext-drmsrc --------------------------------------------------------------------------
336 AC_ARG_ENABLE(ext-drmsrc, AC_HELP_STRING([--enable-ext-drmsrc], [using drmsrc]),
337   [
338     case "${enableval}" in
339       yes) GST_EXT_USE_EXT_DRMSRC=yes ;;
340       no)  GST_EXT_USE_EXT_DRMSRC=no ;;
341       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-drmsrc) ;;
342     esac
343   ],
344   [GST_EXT_USE_EXT_DRMSRC=yes])
345 AM_CONDITIONAL(GST_EXT_USE_EXT_DRMSRC, test "x$GST_EXT_USE_EXT_DRMSRC" = "xyes")
346 dnl use ext-toggle --------------------------------------------------------------------------
347 AC_ARG_ENABLE(ext-toggle, AC_HELP_STRING([--enable-ext-toggle], [using toggle]),
348   [
349     case "${enableval}" in
350       yes) GST_EXT_USE_EXT_TOGGLE=yes ;;
351       no)  GST_EXT_USE_EXT_TOGGLE=no ;;
352       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-toggle) ;;
353     esac
354   ],
355   [GST_EXT_USE_EXT_TOGGLE=yes])
356 AM_CONDITIONAL(GST_EXT_USE_EXT_TOGGLE, test "x$GST_EXT_USE_EXT_TOGGLE" = "xyes")
357
358 dnl for i386 --------------------------------------------------------------------------
359 AC_ARG_ENABLE(i386, AC_HELP_STRING([--enable-i386], [i386 build]),
360         [
361          case "${enableval}" in
362           yes) IS_I386=yes ;;
363           no)  IS_I386=no ;;
364           *)   AC_MSG_ERROR(bad value ${enableval} for --enable-i386) ;;
365          esac
366         ],
367         [IS_I386=no])
368 AM_CONDITIONAL([IS_I386], [test "x$IS_I386" = "xyes"])
369
370 dnl use ext-pdpushsrc --------------------------------------------------------------------------
371 AC_ARG_ENABLE(ext-pdpushsrc, AC_HELP_STRING([--enable-ext-pdpushsrc], [using pdpushsrc]),
372 [
373  case "${enableval}" in
374          yes) GST_EXT_USE_EXT_PD_PUSHSRC=yes ;;
375          no)  GST_EXT_USE_EXT_PD_PUSHSRC=no ;;
376          *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-pdpushsrc) ;;
377  esac
378  ],
379  [GST_EXT_USE_EXT_PD_PUSHSRC=yes])
380 AM_CONDITIONAL(GST_EXT_USE_EXT_PD_PUSHSRC, test "x$GST_EXT_USE_EXT_PD_PUSHSRC" = "xyes")
381 dnl use ext-audiotp --------------------------------------------------------------------------
382 AC_ARG_ENABLE(ext-audiotp, AC_HELP_STRING([--enable-ext-audiotp], [using audiotp]),
383 [
384  case "${enableval}" in
385          yes) GST_EXT_USE_EXT_AUDIOTP=yes ;;
386          no)  GST_EXT_USE_EXT_AUDIOTP=no ;;
387          *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-audiotp) ;;
388  esac
389  ],
390  [GST_EXT_USE_EXT_AUDIOTP=yes])
391 AM_CONDITIONAL(GST_EXT_USE_EXT_AUDIOTP, test "x$GST_EXT_USE_EXT_AUDIOTP" = "xyes")
392
393 dnl use ext-audioeq --------------------------------------------------------------------------
394 AC_ARG_ENABLE(ext-audioeq, AC_HELP_STRING([--enable-ext-audioeq], [using audioeq]),
395 [
396  case "${enableval}" in
397          yes) GST_EXT_USE_EXT_AUDIOEQ=yes ;;
398          no)  GST_EXT_USE_EXT_AUDIOEQ=no ;;
399          *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-audioeq) ;;
400  esac
401  ],
402  [GST_EXT_USE_EXT_AUDIOEQ=yes])
403 AM_CONDITIONAL(GST_EXT_USE_EXT_AUDIOEQ, test "x$GST_EXT_USE_EXT_AUDIOEQ" = "xyes")
404
405 dnl use ext-fimcconvert ----------------------------------------------------------------------
406 AC_ARG_ENABLE(ext-fimcconvert, AC_HELP_STRING([--enable-ext-fimcconvert], [using fimcconvert]),
407 [
408  case "${enableval}" in
409          yes) GST_EXT_USE_EXT_FIMCCONVERT=yes ;;
410          no)  GST_EXT_USE_EXT_FIMCCONVERT=no ;;
411          *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-fimcconvert) ;;
412  esac
413  ],
414  [GST_EXT_USE_EXT_FIMCCONVERT=yes])
415 AM_CONDITIONAL(GST_EXT_USE_EXT_FIMCCONVERT, test "x$GST_EXT_USE_EXT_FIMCCONVERT" = "xyes")
416
417 dnl use ext-wfdrtspsrc --------------------------------------------------------------------------
418 AC_ARG_ENABLE(ext-wfdrtspsrc, AC_HELP_STRING([--enable-ext-wfdrtspsrc], [using wfdrtspsrc]),
419 [
420  case "${enableval}" in
421   yes) GST_EXT_USE_EXT_WFDRTSPSRC=yes ;;
422   no)  GST_EXT_USE_EXT_WFDRTSPSRC=no ;;
423   *)   AC_MSG_ERROR(bad value ${enableval} for --enable-ext-wfdrtspsrc) ;;
424  esac
425  ],
426  [GST_EXT_USE_EXT_WFDRTSPSRC=yes])
427 AM_CONDITIONAL(GST_EXT_USE_EXT_WFDRTSPSRC, test "x$GST_EXT_USE_EXT_WFDRTSPSRC" = "xyes")
428 dnl if [test "x$GST_EXT_USE_EXT_WFDRTSPSRC" = "xyes"];
429 dnl then
430 dnl PKG_CHECK_MODULES(MM_WFD_COMMON, mm-scmirroring-common)
431 dnl AC_SUBST(MM_WFD_COMMON_CFLAGS)
432 dnl AC_SUBST(MM_WFD_COMMON_LIBS)
433 dnl fi
434
435 AC_OUTPUT(
436 Makefile
437 common/Makefile
438 common/m4/Makefile
439 pdpushsrc/Makefile
440 pdpushsrc/src/Makefile
441 encodebin/Makefile
442 encodebin/src/Makefile
443 evasimagesink/Makefile
444 evasimagesink/src/Makefile
445 evaspixmapsink/Makefile
446 xvimagesrc/Makefile
447 xvimagesrc/src/Makefile
448 toggle/Makefile
449 toggle/src/Makefile
450 drmsrc/Makefile
451 drmsrc/src/Makefile
452 audiotp/Makefile
453 audiotp/src/Makefile
454 audioeq/Makefile
455 audioeq/src/Makefile
456 fimcconvert/Makefile
457 fimcconvert/src/Makefile
458 dnl wfdrtspsrc/Makefile
459 dnl wfdrtspsrc/src/Makefile
460 )