From a0c52823205a99dbe9d49fe0f453459440b788b9 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Sun, 13 Feb 2011 17:41:03 +0100 Subject: [PATCH] build: Make configure --help less ugly Move all the plugin autofoo into m4 helper functions --- configure.ac | 78 ++++++++++++------------------------------------------------ m4/rygel.m4 | 53 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 63 deletions(-) create mode 100644 m4/rygel.m4 diff --git a/configure.ac b/configure.ac index 21e5379..5dde8de 100644 --- a/configure.ac +++ b/configure.ac @@ -50,11 +50,11 @@ GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) AC_ARG_ENABLE(vala, - [ --enable-vala enable checks for vala],, + AC_HELP_STRING([--enable-vala],[enable checks for vala]),, enable_vala=no) AC_ARG_ENABLE(sql-debugging, - [ --enable-sql-debugging enable SQL statement debugging],, - enable_sql_debugging=no) + AC_HELP_STRING([--enable-sql-debugging],[enable SQL statement debugging]),, + enable_sql_debugging=no) if test x$enable_sql_debugging = xyes ; then VALAFLAGS="$VALAFLAGS -D RYGEL_DEBUG_SQL" @@ -100,14 +100,14 @@ AC_SUBST(VAPIDIR) # Debugging AC_ARG_ENABLE(debug, - [ --enable-debug enable debugging],, + AC_HELP_STRING([--enable-debug],[enable debugging]),, enable_debug=no) if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -O0 -g" fi AC_ARG_ENABLE([strict-valac], - [ --enable-strict-valac enable strict Vala compiler],, + AC_HELP_STRING([--enable-strict-valac],[enable strict Vala compiler]),, [enable_strict_valac=no]) if test "x$enable_strict_valac" = "xyes"; then VALAFLAGS="$VALAFLAGS --fatal-warnings" @@ -115,7 +115,7 @@ fi # Strict compiler AC_ARG_ENABLE(strict-cc, - [ --enable-strict-cc enable strict C compiler],, + AC_HELP_STRING([--enable-strict-cc],[enable strict C compiler]),, enable_strict_cc=no) if test "x$enable_strict_cc" = "xyes"; then CFLAGS="$CFLAGS -Wall -Werror" @@ -125,7 +125,7 @@ fi # Run uninstalled AC_ARG_ENABLE(uninstalled, - [ --enable-uninstalled run uninstalled],, + AC_HELP_STRING([--enable-uninstalled],[run uninstalled]),, enable_uninstalled=no) if test "x$enable_uninstalled" = "xyes"; then AC_MSG_WARN("You want to run the tools uninstalled only? Fine!") @@ -169,58 +169,18 @@ AC_SUBST(HAVE_GTK) AM_CONDITIONAL(BUILD_UI, test x$BUILD_UI = xyes) # Build test plugin -AC_ARG_ENABLE(test-plugin, - [ --enable-test-plugin build test plugin],, - enable_test_plugin=no) - -# Build Tracker plugin -AC_ARG_ENABLE(tracker-plugin, - [ --enable-tracker-plugin build tracker plugin],, - enable_tracker_plugin=yes) - -# Build MediaExport plugin -AC_ARG_ENABLE(media-export-plugin, - [ --enable-media-export-plugin build MediaExport plugin],, - enable_media_export_plugin=yes) - -# Build External plugin -AC_ARG_ENABLE(external-plugin, - [ --enable-external-plugin build External plugin],, - enable_external_plugin=yes) - -# Build MPRIS2 plugin -AC_ARG_ENABLE(mpris-plugin, - [ --enable-mpris-plugin build MPRIS2 plugin],, - enable_mpris_plugin=yes) - -# Build GstRenderer plugin -AC_ARG_ENABLE(playbin-plugin, - [ --enable-playbin_plugin build Gstreamer Playbin plugin],, - enable_playbin_plugin=yes) - -# Build Mediathek plugin -AC_ARG_ENABLE(mediathek-plugin, - [ --enable-mediathek-plugin build Mediathek plugin],, - enable_mediathek_plugin=no) - -# Build GstLaunch plugin -AC_ARG_ENABLE(gst-launch-plugin, - [ --enable-gst-launch-plugin build Gstreamer launchline plugin],, - enable_gst_launch_plugin=no) - +RYGEL_ADD_PLUGIN([test],[Test],[no]) +RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes]) +RYGEL_ADD_PLUGIN([external],[MediaServer2 DBus consumer],[yes]) +RYGEL_ADD_PLUGIN([mpris],[MPRIS2 DBus consumer],[yes]) +RYGEL_ADD_PLUGIN([playbin],[GStreamer playbin],[yes]) +RYGEL_ADD_PLUGIN([mediathek],[ZDF Mediathek],[no]) +RYGEL_ADD_PLUGIN([media-export],[MediaExport],[yes]) +RYGEL_ADD_PLUGIN([gst-launch],[GStreamer launchline],[no]) AC_SUBST(abs_top_builddir) AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"]) -AM_CONDITIONAL([BUILD_TEST_PLUGIN], [test "x$enable_test_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_TRACKER_PLUGIN], - [test "x$enable_tracker_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_MEDIATHEK_PLUGIN], [test "x$enable_mediathek_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_MEDIA_EXPORT_PLUGIN], [test "x$enable_media_export_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_EXTERNAL_PLUGIN], [test "x$enable_external_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_MPRIS_PLUGIN], [test "x$enable_mpris_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_PLAYBIN_PLUGIN], [test "x$enable_playbin_plugin" = "xyes"]) -AM_CONDITIONAL([BUILD_GST_LAUNCH_PLUGIN], [test "x$enable_gst_launch_plugin" = "xyes"]) if test "x$enable_media_export_plugin" = "xyes"; then @@ -260,14 +220,6 @@ src/Makefile src/rygel/Makefile src/ui/Makefile src/plugins/Makefile -src/plugins/media-export/Makefile -src/plugins/external/Makefile -src/plugins/mpris/Makefile -src/plugins/gst-launch/Makefile -src/plugins/mediathek/Makefile -src/plugins/tracker/Makefile -src/plugins/playbin/Makefile -src/plugins/test/Makefile data/Makefile data/xml/Makefile data/icons/Makefile diff --git a/m4/rygel.m4 b/m4/rygel.m4 new file mode 100644 index 0000000..d748737 --- /dev/null +++ b/m4/rygel.m4 @@ -0,0 +1,53 @@ +dnl rygel.m4 +dnl +dnl Copyright 2011 Jens Georg +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +AC_DEFUN([RYGEL_ADD_STAMP], +[ + rygel_stamp_files="$rygel_stamp_files $1" +]) + +# _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN, +# NAME-OF-PLUGIN-WITH-UNDERSCORES, +# NAME-OF-PLUGIN-FOR-HELP, +# DEFAULT-FOR-ENABLE) +# -------------------------------------- +# Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the +# conditional +AC_DEFUN([_RYGEL_ADD_PLUGIN_INTERNAL], +[ + AC_ARG_ENABLE([$1-plugin], + AC_HELP_STRING([--enable-$1-plugin],[enable $3 plugin]),, + enable_$2_plugin=$4) + AC_CONFIG_FILES([src/plugins/$1/Makefile]) + AM_CONDITIONAL(m4_toupper(build_$2_plugin), test "x$[]enable_$2_plugin" = "xyes") + RYGEL_ADD_STAMP([src/plugins/$1/librygel_$2_la_vala.stamp]) +]) + +# _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN, +# NAME-OF-PLUGIN-FOR-HELP, +# DEFAULT-FOR-ENABLE) +# -------------------------------------- +# Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the +# conditional +AC_DEFUN([RYGEL_ADD_PLUGIN], +[ + _RYGEL_ADD_PLUGIN_INTERNAL([$1], + m4_translit([$1],[-],[_]), + [$2], + [$3]) +]) -- 2.7.4