[gstreamermm/devel-other-plugins] build: add macro for finding gstreamer modules



commit 552cb5fda8e211562e3befa4d8a2ddf0bf06dbc8
Author: Marcin Kolny <marcin kolny flytronic pl>
Date:   Fri Jul 17 12:17:22 2015 +0200

    build: add macro for finding gstreamer modules
    
        * build/gstreamermm.m4: add file with m4 build macros
          (FIND_GST_MODULE).
        * configure.ac: use new macro in configure script.
        * examples/Makefile.am:
        * gstreamer/src/filelist.am: update variable name.

 build/gstreamermm.m4      |   36 ++++++++++++++++++++++++++++++++++++
 configure.ac              |    7 +------
 examples/Makefile.am      |    2 +-
 gstreamer/src/filelist.am |    2 +-
 4 files changed, 39 insertions(+), 8 deletions(-)
---
diff --git a/build/gstreamermm.m4 b/build/gstreamermm.m4
new file mode 100644
index 0000000..beffa79
--- /dev/null
+++ b/build/gstreamermm.m4
@@ -0,0 +1,36 @@
+## Copyright 2015 The gstreamermm Development Team
+##
+## This library is free software: you can redistribute it and/or modify it
+## under the terms of the GNU Lesser General Public License as published
+## by the Free Software Foundation, either version 2.1 of the License,
+## or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+## Arguments: 
+##  * $1 - var_name (e.g. GSTREAMERMM_GL, GSTREAMERMM_NET)
+##  * $2 - pkg-config module name sufix (e.g. gl, net)
+## Macro creates two variables:
+##  * ENABLE_$1 - true, if module will be enabled, false otherwise
+##  * gstmm_enable_$2 - "yes", if module will be enabled, "no" otherwise
+## Module $2 can be explicitly disabled, using --disable-$2 argument
+## in ./configure script.
+AC_DEFUN([FIND_GST_MODULE], 
+[
+
+  PKG_CHECK_MODULES($1, gstreamer-[$2]-1.0 >= GSTREAMERMM_VERSION,
+                  [gstmm_enable_$2=yes], [gstmm_enable_$2=no])
+  
+  AC_ARG_ENABLE($2,
+              AS_HELP_STRING([--disable-$2], [Disable gstreamer-$2 library]))
+  
+  AS_IF([test "x$enable_$2" = "xno"], [gstmm_enable_$2=no])
+  AM_CONDITIONAL([ENABLE_$1], [test "x$gstmm_enable_$2" = xyes])
+])
diff --git a/configure.ac b/configure.ac
index cca1678..2cbf696 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,12 +75,7 @@ PKG_CHECK_MODULES([GSTREAMERMM_PLUGINS_BAD], gstreamer-plugins-bad-1.0 >= GSTREA
                     gstmm_enable_bad=yes
                   ], [gstmm_enable_bad=no])
 
-PKG_CHECK_MODULES([GSTREAMERMM_GL], gstreamer-gl-1.0 >= GSTREAMERMM_VERSION,
-                  [gstmm_enable_gl=yes], [gstmm_enable_gl=no])
-AC_ARG_ENABLE([gl],
-              AS_HELP_STRING([--disable-gl], [Disable gl libraries]))
-AS_IF([test "x$enable_gl" = "xno"], [gstmm_enable_gl=no])
-AM_CONDITIONAL([ENABLE_GL], [test "x$gstmm_enable_gl" = xyes])
+FIND_GST_MODULE(GSTREAMERMM_GL, gl)
 
 PKG_CHECK_MODULES([GUI_EXAMPLES], [$GSTREAMERMM_MODULES gtkmm-3.0 >= 3.0],
                   [gstmm_enable_gui_examples=yes], [gstmm_enable_gui_examples=no])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index da821db..9c40c43 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -22,7 +22,7 @@ gui_examples = media_player_gtkmm/example ogg_player_gtkmm/example
 examples_cppflags = $(GUI_EXAMPLES_CFLAGS) $(examples_cppflags)
 endif
 
-if ENABLE_GL
+if ENABLE_GSTREAMERMM_GL
 gl_examples = opengl_filter/example
 endif
 
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index f2b66cf..7f0feb9 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -162,7 +162,7 @@ files_hg  =                     \
         videooverlay.hg         \
         $(plugins_hg)
 
-if ENABLE_GL
+if ENABLE_GSTREAMERMM_GL
 files_hg += $(gl_files_hg)
 endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]