summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0011-gl-Add-switches-for-explicitely-enabling-disabling-P.patch
blob: 65d191a3966bcf4a76aaa9a10477d24201e08eda (plain)
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
From 092aadfc1df69c46d920b0cd39f98d363d6988b3 Mon Sep 17 00:00:00 2001
From: Carlos Rafael Giani <dv@pseudoterminal.org>
Date: Thu, 19 Jul 2018 11:16:05 +0200
Subject: [PATCH] gl: Add switches for explicitely enabling/disabling PNG and
 JPEG support

Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=796833]

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 m4/gst-gl.m4 | 66 ++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 46 insertions(+), 20 deletions(-)

diff --git a/m4/gst-gl.m4 b/m4/gst-gl.m4
index 20b2233de..f8809981c 100644
--- a/m4/gst-gl.m4
+++ b/m4/gst-gl.m4
@@ -126,6 +126,24 @@ AC_ARG_ENABLE([gbm],
        *) AC_MSG_ERROR([bad value ${enableval} for --enable-gbm]) ;;
      esac],[NEED_GBM=auto])
 
+AC_ARG_ENABLE([png],
+     [  --enable-png        Enable libpng support @<:@default=auto@:>@],
+     [case "${enableval}" in
+       yes)  NEED_PNG=yes ;;
+       no)   NEED_PNG=no ;;
+       auto) NEED_PNG=auto ;;
+       *) AC_MSG_ERROR([bad value ${enableval} for --enable-png]) ;;
+     esac],[NEED_PNG=auto])
+
+AC_ARG_ENABLE([jpeg],
+     [  --enable-jpeg        Enable libjpeg support @<:@default=auto@:>@],
+     [case "${enableval}" in
+       yes)  NEED_JPEG=yes ;;
+       no)   NEED_JPEG=no ;;
+       auto) NEED_JPEG=auto ;;
+       *) AC_MSG_ERROR([bad value ${enableval} for --enable-jpeg]) ;;
+     esac],[NEED_JPEG=auto])
+
 AG_GST_PKG_CHECK_MODULES(X11_XCB, x11-xcb)
 save_CPPFLAGS="$CPPFLAGS"
 save_LIBS="$LIBS"
@@ -1043,9 +1061,13 @@ dnl Needed by plugins that use g_module_*() API
 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
 
 dnl libpng is optional
-PKG_CHECK_MODULES(LIBPNG, libpng >= 1.0, HAVE_PNG=yes, HAVE_PNG=no)
-if test "x$HAVE_PNG" = "xyes"; then
-  AC_DEFINE(HAVE_PNG, [1] , [Use libpng])
+if test "x$NEED_PNG" != "xno"; then
+  PKG_CHECK_MODULES(LIBPNG, libpng >= 1.0, HAVE_PNG=yes, HAVE_PNG=no)
+  if test "x$HAVE_PNG" = "xyes"; then
+    AC_DEFINE(HAVE_PNG, [1] , [Use libpng])
+  elif test "x$NEED_PNG" = "xyes"; then
+    AC_MSG_ERROR([libpng support requested but libpng is not available])
+  fi
 fi
 AC_SUBST(HAVE_PNG)
 AC_SUBST(LIBPNG_LIBS)
@@ -1053,25 +1075,29 @@ AC_SUBST(LIBPNG_CFLAGS)
 
 dnl libjpeg is optional
 AC_ARG_WITH(jpeg-mmx, [  --with-jpeg-mmx, path to MMX'ified JPEG library])
-OLD_LIBS="$LIBS"
-if test x$with_jpeg_mmx != x; then
-  LIBS="$LIBS -L$with_jpeg_mmx"
-fi
-AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
-JPEG_LIBS="$LIBS -ljpeg-mmx"
-LIBS="$OLD_LIBS"
-if test x$HAVE_JPEG != xyes; then
-  JPEG_LIBS="-ljpeg"
-  AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
-fi
+if test "x$NEED_JPEG" != "xno"; then
+  OLD_LIBS="$LIBS"
+  if test x$with_jpeg_mmx != x; then
+    LIBS="$LIBS -L$with_jpeg_mmx"
+  fi
+  AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
+  JPEG_LIBS="$LIBS -ljpeg-mmx"
+  LIBS="$OLD_LIBS"
+  if test x$HAVE_JPEG != xyes; then
+    JPEG_LIBS="-ljpeg"
+    AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
+  fi
 
-if test x$HAVE_JPEG = xyes; then
-  AC_DEFINE(HAVE_JPEG, [1], [Use libjpeg])
-else
-  JPEG_LIBS=
+  if test x$HAVE_JPEG = xyes; then
+    AC_DEFINE(HAVE_JPEG, [1], [Use libjpeg])
+  elif test "x$NEED_JPEG" = "xyes"; then
+    AC_MSG_ERROR([libjpeg support requested but libjpeg is not available])
+  else
+    JPEG_LIBS=
+  fi
+  AC_SUBST(JPEG_LIBS)
+  AC_SUBST(HAVE_JPEG)
 fi
-AC_SUBST(JPEG_LIBS)
-AC_SUBST(HAVE_JPEG)
 ])
 
 dnl --------------------------------------------------------------------------
-- 
2.17.1