diff options
author | Regis Merlino <regis.merlino@intel.com> | 2013-03-07 10:58:13 +0100 |
---|---|---|
committer | Regis Merlino <regis.merlino@intel.com> | 2013-03-18 16:12:22 +0100 |
commit | 84c824f8f5bd5852ba52686e4ad81351d2c52bc0 (patch) | |
tree | 4a43d8df34039a7d1572fa46c85fc8be5683eb6b /configure.ac | |
parent | e7ff72861ea768fe40f0ed522b15e68e79bbb1e3 (diff) | |
download | GUPnP-DLNA-84c824f8f5bd5852ba52686e4ad81351d2c52bc0.tar.gz GUPnP-DLNA-84c824f8f5bd5852ba52686e4ad81351d2c52bc0.tar.bz2 GUPnP-DLNA-84c824f8f5bd5852ba52686e4ad81351d2c52bc0.zip |
Updated GUPnP-DLNA version to 0.10.0 (a245d94)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 226 |
1 files changed, 205 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac index f6b5c54..42725af 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.63]) AC_INIT([gupnp-dlna], - [0.6.6], + [0.10.0], [https://bugzilla.gnome.org/enter_bug.cgi?product=gupnp&component=gupnp-dlna], [gupnp-dlna], [http://www.gupnp.org/]) @@ -11,12 +11,13 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-xz]) +AM_MAINTAINER_MODE([enable]) AM_SILENT_RULES([yes]) dnl library versioning dnl Increase when changing the API -GUPNP_DLNA_CURRENT=2 +GUPNP_DLNA_CURRENT=3 dnl Update when changing implementation of current API, dnl reset to 0 when changing CURRENT. This is the revision of @@ -37,45 +38,228 @@ AC_HEADER_STDC LT_PREREQ([2.2]) LT_INIT([win32-dll]) -PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.5.0) +PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= 2.5.0]) -GST_MAJORMINOR=0.10 -GST_REQ=0.10.29.2 -GSTPBU_REQ=0.10.32 +AM_PROG_CC_C_O -PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ) -PKG_CHECK_MODULES(GST_PBU, gstreamer-pbutils-$GST_MAJORMINOR >= $GSTPBU_REQ) -AC_SUBST(GST_MAJORMINOR) +AC_ARG_WITH([default-metadata-backend], + [AS_HELP_STRING([--with-default-metadata-backend=your_backend], + [set a default metadata backend @<:@default=gstreamer@:>@])]) -GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API" -AC_SUBST(GST_CFLAGS) +if test "x$with_default_metadata_backend" = 'x' +then + with_default_metadata_backend='gstreamer' +fi + +if test "x$with_default_metadata_backend" = 'xyes' || test "x$with_default_metadata_backend" = 'xno' +then + AC_MSG_WARN([Dubious default metadata backend name: $with_default_metadata_backend]) +fi + +GUPNP_DLNA_METADATA_BACKEND_CFLAGS="$GUPNP_DLNA_METADATA_BACKEND_CFLAGS -DGUPNP_DLNA_DEFAULT_METADATA_BACKEND=\\\"$with_default_metadata_backend\\\"" + +AC_ARG_ENABLE([gstreamer-metadata-backend], + [AS_HELP_STRING([--enable-gstreamer-metadata-backend], + [build a GStreamer metadata backend @<:@default=auto@:>@])], + , + [enable_gstreamer_metadata_backend=auto]) + +if test "x$enable_gstreamer_metadata_backend" != 'xno' +then + gstreamer_found='yes' + GST_MAJORMINOR=1.0 + GST_REQ=1.0 + GSTPBU_REQ=1.0 + + PKG_CHECK_MODULES([GST], + [gstreamer-$GST_MAJORMINOR >= $GST_REQ], + , + [gstreamer_found='no']) + PKG_CHECK_MODULES([GST_PBU], + [gstreamer-pbutils-$GST_MAJORMINOR >= $GSTPBU_REQ], + , + [gstreamer_found='no']) + + if test "x$gstreamer_found" = 'xyes' + then + AC_SUBST(GST_MAJORMINOR) + + GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API" + AC_SUBST(GST_CFLAGS) + enable_gstreamer_metadata_backend='yes' + elif test "x$enable_gstreamer_metadata_backend" = 'xyes' + then + AC_MSG_ERROR([GStreamer $GST_MAJORMINOR not found.]) + else + enable_gstreamer_metadata_backend='no' + fi +fi + +if test "x$enable_gstreamer_metadata_backend" = 'xyes' +then + AM_CONDITIONAL(GSTREAMER_METADATA_BACKEND_ENABLED, true) +else + AM_CONDITIONAL(GSTREAMER_METADATA_BACKEND_ENABLED, false) +fi + +AC_ARG_ENABLE([legacy-gstreamer-metadata-backend], + [AS_HELP_STRING([--enable-legacy-gstreamer-metadata-backend], + [build a GStreamer 0.10 metadata backend @<:@default=no@:>@])], + , + [enable_legacy_gstreamer_metadata_backend=no]) + +if test "x$enable_legacy_gstreamer_metadata_backend" != 'xno' +then + gstreamer_found='yes' + GST_LEGACY_MAJORMINOR=0.10 + GST_LEGACY_REQ=0.10.36 + GSTPBU_LEGACY_REQ=0.10.36 + + PKG_CHECK_MODULES([GST_LEGACY], + [gstreamer-$GST_LEGACY_MAJORMINOR >= $GST_LEGACY_REQ], + , + [gstreamer_found='no']) + PKG_CHECK_MODULES([GST_PBU_LEGACY], + [gstreamer-pbutils-$GST_LEGACY_MAJORMINOR >= $GSTPBU_LEGACY_REQ], + , + [gstreamer_found='no']) + + if test "x$gstreamer_found" = 'xyes' + then + AC_SUBST(GST_LEGACY_MAJORMINOR) + enable_legacy_gstreamer_metadata_backend='yes' + elif test "x$enable_legacy_gstreamer_metadata_backend" = 'xyes' + then + AC_MSG_ERROR([GStreamer $GST_LEGACY_MAJORMINOR not found.]) + else + enable_legacy_gstreamer_metadata_backend='no' + fi +fi -# glib-genmarshal -GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` -AC_SUBST(GLIB_GENMARSHAL) +if test "x$enable_legacy_gstreamer_metadata_backend" = 'xyes' +then + AM_CONDITIONAL(GSTREAMER_LEGACY_METADATA_BACKEND_ENABLED, true) +else + AM_CONDITIONAL(GSTREAMER_LEGACY_METADATA_BACKEND_ENABLED, false) +fi + +AC_ARG_WITH([default-metadata-backend-dir], + [AS_HELP_STRING([--with-default-metadata-backend-dir=your_directory], + [set a default metadata backend directory @<:@default=$libdir/$PACKAGE_NAME@:>@])]) + +if test "x$with_default_metadata_backend_dir" = 'x' +then + with_default_metadata_backend_dir="$libdir/$PACKAGE_NAME" +fi + +if test "x$with_default_metadata_backend_dir" = 'xyes' || test "x$with_default_metadata_backend_dir" = 'xno' +then + AC_MSG_WARN([Dubious default metadata backend directory: $with_default_metadata_backend_dir]) +fi + +AC_SUBST(METADATA_DIRECTORY, $with_default_metadata_backend_dir) + +GUPNP_DLNA_METADATA_BACKEND_CFLAGS="$GUPNP_DLNA_METADATA_BACKEND_CFLAGS -DGUPNP_DLNA_DEFAULT_METADATA_BACKEND_DIR=\\\"$with_default_metadata_backend_dir\\\"" + +AC_SUBST(GUPNP_DLNA_METADATA_BACKEND_CFLAGS) + +PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32]) +PKG_CHECK_MODULES([GOBJECT], [gobject-2.0]) +PKG_CHECK_MODULES([GMODULE], [gmodule-2.0]) + +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) +AC_SUBST(GOBJECT_CFLAGS) +AC_SUBST(GOBJECT_LIBS) +AC_SUBST(GMODULE_CFLAGS) +AC_SUBST(GMODULE_LIBS) + +# Check for g_clear_pointer +have_g_clear_pointer='no' +PKG_CHECK_EXISTS([glib-2.0 >= 2.34], + [have_g_clear_pointer='yes']) +AS_VAR_IF([have_g_clear_pointer], [no], + [AC_MSG_CHECKING([for g_clear_pointer]) + GUPNP_DLNA_TEMP_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + GUPNP_DLNA_TEMP_LIBS="$LIBS" + LIBS="$LIBS $GLIB_LIBS" + AC_LANG([C]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include <glib.h> + ]], + [[ + gchar *test = g_malloc (2); + g_clear_pointer (&test, g_free); + return (test == NULL) + ]])], + [have_g_clear_pointer='yes']) + LIBS="$GUPNP_DLNA_TEMP_LIBS" + CFLAGS="$GUPNP_DLNA_TEMP_CFLAGS" + AC_MSG_RESULT([$have_g_clear_pointer])]) + +AS_VAR_IF([have_g_clear_pointer], [no], + [AC_DEFINE([g_clear_pointer(ptr, func)], + [\ + G_STMT_START { \ + if (ptr != NULL && func != NULL) { \ + gpointer g_clear_pointer_tmp_var = *ptr; \ + *ptr = NULL; \ + func (g_clear_pointer_tmp_var); \ + } \ + } G_STMT_END], + [Naive g_clear_pointer implementation.])]) # Debugging -AC_ARG_ENABLE(debug, - [ --enable-debug enable debugging],, - enable_debug=no) +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=no@:>@]), + , + [enable_debug=no]) if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -g -Wall" fi GOBJECT_INTROSPECTION_CHECK([0.6.4]) +# vapigen +AS_IF([test "x$found_introspection" = "xyes"], + [ + VALA_PROG_VAPIGEN([0.18]) + ] +) +AM_CONDITIONAL([HAVE_VAPIGEN], [test "x$VAPIGEN" != "x"]) + GTK_DOC_CHECK([1.11],[--flavour no-tmpl]) +# for fixxref +GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" +AC_SUBST(GLIB_PREFIX) AC_CONFIG_FILES([ Makefile libgupnp-dlna/Makefile tools/Makefile tests/Makefile -tests/test-discoverer.sh +data/Makefile +gupnp-dlna-2.0.pc +gupnp-dlna-metadata-2.0.pc +gupnp-dlna-gst-2.0.pc +gupnp-dlna-gst-legacy-2.0.pc doc/Makefile doc/version.xml -data/Makefile -gupnp-dlna-1.0.pc -gupnp-dlna-1.0-uninstalled.pc +doc/gupnp-dlna/Makefile +doc/gupnp-dlna-metadata/Makefile +doc/gupnp-dlna-gst/Makefile +vala/Makefile ]) +AC_CONFIG_FILES([tests/test-discoverer.sh], + [chmod a+x tests/test-discoverer.sh]) AC_OUTPUT + +echo +echo 'Configuration status:' +echo +echo "Default metadata backend: $with_default_metadata_backend" +echo "Default metadata backend directory: $with_default_metadata_backend_dir" +echo "Build GStreamer metadata backend: $enable_gstreamer_metadata_backend" +echo "Build legacy GStreamer metadata backend: $enable_legacy_gstreamer_metadata_backend" +echo |