15.12.2014 13:38, a...@accosted.net wrote:
From: Arun Raghavan <g...@arunraghavan.net>

https://bugs.freedesktop.org/show_bug.cgi?id=72173
---
  Makefile.am     | 11 +++++++++--
  configure.ac    | 17 +++++++++++++----
  man/Makefile.am |  2 +-
  src/Makefile.am | 25 +++++++++++++++++++++++++
  4 files changed, 48 insertions(+), 7 deletions(-)

This is obviously a step in the right direction, but I have a few nitpicks.

Note: I have not tested the patch yet, will do so later today. If that testing finds any issues, I will send a follow-up email.


diff --git a/Makefile.am b/Makefile.am
index 665736d..470f127 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,11 @@ EXTRA_DIST = \
        src/daemon/.gitignore \
        src/pulse/.gitignore

-SUBDIRS = src doxygen man po
+SUBDIRS = src doxygen
+
+if !CLIENT_LIBS_ONLY
+SUBDIRS += man po
+endif

  MAINTAINERCLEANFILES =
  noinst_DATA =
@@ -62,6 +66,9 @@ cmakedir = $(libdir)/cmake/PulseAudio
  cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake

  bashcompletiondir=$(sysconfdir)/bash_completion.d
+zshcompletiondir=@zshcompletiondir@
+
+if !CLIENT_LIBS_ONLY
  dist_bashcompletion_DATA = shell-completion/bash/pulseaudio

  install-bashcompletion-aliases:
@@ -76,8 +83,8 @@ install-bashcompletion-aliases:

  install-data-hook: install-bashcompletion-aliases

-zshcompletiondir=@zshcompletiondir@
  dist_zshcompletion_DATA = shell-completion/zsh/_pulseaudio
+endif # !CLIENT_LIBS_ONLY

  homepage: all dist doxygen
        test -d $$HOME/homepage/private
diff --git a/configure.ac b/configure.ac
index ef250cd..b74f2ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,6 +230,12 @@ esac
  AC_SUBST([NOUNDEFINED_LDFLAGS])


+#### Just build client libs, or everything?
+AC_ARG_ENABLE([client-libs-only],
+    AS_HELP_STRING([--enable-client-libs-only],[build only the client 
libraries]))
+AM_CONDITIONAL(CLIENT_LIBS_ONLY, [test "x$enable_client_libs_only" = "xyes"])
+
+
  #### Atomic operations ####

  # Native atomic operation support
@@ -391,7 +397,7 @@ AC_CHECK_HEADER([ltdl.h],
      [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
      [LIBLTDL=])

-AS_IF([test "x$LIBLTDL" = "x"],
+AS_IF([test "x$LIBLTDL" = "x" -a "x$enable_client_libs_only" != "xyes"],
      [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have 
libtool 2.4 or later installed.])])
  AC_SUBST([LIBLTDL])

@@ -619,7 +625,7 @@ CAP_LIBS=''
  AC_ARG_WITH([caps],
      AS_HELP_STRING([--without-caps],[Omit support for dropping 
capabilities.]))

-if test "x${with_caps}" != "xno"; then
+if test "x${with_caps}" != "xno" -a "x$enable_client_libs_only" != "xyes"; then
      AC_SEARCH_LIBS([cap_init], [cap], [], [])

      # Only give an error on hosts that we know could support capabilities
@@ -658,7 +664,7 @@ PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.20 ])
  #### atomic-ops ####

  AC_MSG_CHECKING([whether we need libatomic_ops])
-if test "x$need_libatomic_ops" = "xyes"; then
+if test "x$need_libatomic_ops" = "xyes" -a "x$enable_client_libs_only" != 
"xyes"; then
      AC_MSG_RESULT([yes])
      AC_CHECK_HEADERS([atomic_ops.h],
          [CFLAGS="$CFLAGS -DAO_REQUIRE_CAS"],
@@ -725,7 +731,7 @@ AS_IF([test "x$with_database" = "xauto" -o "x$with_database" = 
"xsimple"],
      HAVE_SIMPLEDB=0)
  AS_IF([test "x$HAVE_SIMPLEDB" = "x1"], with_database=simple)

-AS_IF([test "x$HAVE_TDB" != x1 -a "x$HAVE_GDBM" != x1 -a "x$HAVE_SIMPLEDB" != 
x1],
+AS_IF([test "x$HAVE_TDB" != x1 -a "x$HAVE_GDBM" != x1 -a "x$HAVE_SIMPLEDB" != x1 -a 
"x$enable_client_libs_only" != "xyes"],
      AC_MSG_ERROR([*** missing database backend]))


@@ -1540,6 +1546,7 @@ AS_IF([test "x$HAVE_ESOUND" = "x1" -a 
"x$USE_PER_USER_ESOUND_SOCKET" = "x1"], EN
  AS_IF([test "x$HAVE_GCOV" = "x1"], ENABLE_GCOV=yes, ENABLE_GCOV=no)
  AS_IF([test "x$HAVE_LIBCHECK" = "x1"], ENABLE_TESTS=yes, ENABLE_TESTS=no)
  AS_IF([test "x$enable_legacy_database_entry_format" != "xno"], 
ENABLE_LEGACY_DATABASE_ENTRY_FORMAT=yes, ENABLE_LEGACY_DATABASE_ENTRY_FORMAT=no)
+AS_IF([test "x$enable_client_libs_only" = "xyes"], 
ENABLE_CLIENT_LIBS_ONLY=yes, ENABLE_CLIENT_LIBS_ONLY=no)

  echo "
   ---{ $PACKAGE_NAME $VERSION }---
@@ -1557,6 +1564,8 @@ echo "
      CPPFLAGS:                      ${CPPFLAGS}
      LIBS:                          ${LIBS}

+    Build client libs only:        ${ENABLE_CLIENT_LIBS_ONLY}
+
      Enable X11:                    ${ENABLE_X11}
      Enable OSS Output:             ${ENABLE_OSS_OUTPUT}
      Enable OSS Wrapper:            ${ENABLE_OSS_WRAPPER}

I'd prefer if the status output lines (the last three quoted lines and everything that follows) were rearranged. That's because in the client-libs-only setup the "OSS wrapper" matters, while X11 or OSS output are not applicable, so it doesn't make sense to print these server-only lines.

diff --git a/man/Makefile.am b/man/Makefile.am
index d80ba6a..f4566a9 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -63,7 +63,7 @@ CLEANFILES = \
  %: %.xml Makefile
        $(AM_V_GEN) perl $(srcdir)/xmltoman $< > $@ || rm -f $@

-endif
+endif # BUILD_MANPAGES

  EXTRA_DIST = \
        pulseaudio.1.xml.in \
diff --git a/src/Makefile.am b/src/Makefile.am
index 88a824e..5b6f0cb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -105,6 +105,8 @@ EXTRA_DIST = \
                daemon/pulseaudio-system.conf \
                modules/echo-cancel/adrian-license.txt

+if !CLIENT_LIBS_ONLY
+
  pulseconf_DATA = \
                default.pa \
                system.pa \
@@ -123,6 +125,8 @@ xdgautostart_DATA = 
$(xdgautostart_in_files:.desktop.in=.desktop)
  @INTLTOOL_DESKTOP_RULE@
  endif

+endif # !CLIENT_LIBS_ONLY
+

  ###################################
  #          Includes               #
@@ -137,6 +141,8 @@ ORC_SOURCE =
  #          Main daemon            #
  ###################################

+if !CLIENT_LIBS_ONLY
+
  bin_PROGRAMS = pulseaudio

  pulseaudio_SOURCES = \
@@ -180,6 +186,8 @@ endif
  #       Utility programs          #
  ###################################

+if !CLIENT_LIBS_ONLY
+
  bin_SCRIPTS = esdcompat

  bin_PROGRAMS += \
@@ -199,6 +207,8 @@ bin_PROGRAMS += pax11publish
  bin_SCRIPTS += start-pulseaudio-x11
  endif

+endif # !CLIENT_LIBS_ONLY
+
  pacat_SOURCES = utils/pacat.c
  pacat_LDADD = $(AM_LDADD) libpulse.la libpulsecommon-@PA_MAJORMINOR@.la 
$(LIBSNDFILE_LIBS)
  pacat_CFLAGS = $(AM_CFLAGS) $(LIBSNDFILE_CFLAGS)
@@ -224,6 +234,7 @@ pax11publish_CFLAGS = $(AM_CFLAGS) $(X11_CFLAGS)
  pax11publish_LDADD = $(AM_LDADD) libpulse.la 
libpulsecommon-@PA_MAJORMINOR@.la $(X11_LIBS)
  pax11publish_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)

+if !CLIENT_LIBS_ONLY
  if HAVE_SYSTEMD_DAEMON

  systemduserunit_DATA = \
@@ -231,6 +242,7 @@ systemduserunit_DATA = \
      daemon/systemd/user/pulseaudio.socket

  endif
+endif

  ###################################
  #         Test programs           #
@@ -620,6 +632,8 @@ lo_latency_test_LDADD = $(AM_LDADD) libpulse.la 
liblo-test-util.la
  lo_latency_test_CFLAGS = $(AM_CFLAGS) $(LIBCHECK_CFLAGS)
  lo_latency_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)

+endif # !CLIENT_LIBS_ONLY
+
  ###################################
  #         Common library          #
  ###################################
@@ -885,6 +899,8 @@ libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) 
$(VERSIONING_LDFLAGS) -version
  #         OSS emulation           #
  ###################################

+if !CLIENT_LIBS_ONLY
+
  if HAVE_OSS_WRAPPER
  padsplibdir = $(pkglibdir)
  padsplib_LTLIBRARIES = libpulsedsp.la
@@ -905,10 +921,13 @@ libpulsedsp_la_CFLAGS = $(AM_CFLAGS)
  libpulsedsp_la_LIBADD = $(AM_LIBADD) libpulse.la 
libpulsecommon-@PA_MAJORMINOR@.la
  libpulsedsp_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -disable-static

+endif # !CLIENT_LIBS_ONLY
+
  ###################################
  #      Daemon core library        #
  ###################################

+if !CLIENT_LIBS_ONLY
  lib_LTLIBRARIES += libpulsecore-@PA_MAJORMINOR@.la

  # Pure core stuff
@@ -2174,6 +2193,8 @@ module_rygel_media_server_la_LDFLAGS = $(MODULE_LDFLAGS)
  module_rygel_media_server_la_LIBADD = $(MODULE_LIBADD) $(DBUS_LIBS) 
libprotocol-http.la
  module_rygel_media_server_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

+endif # !CLIENT_LIBS_ONLY
+
  ###################################
  #        Some minor stuff         #
  ###################################
@@ -2181,6 +2202,8 @@ module_rygel_media_server_la_CFLAGS = $(AM_CFLAGS) 
$(DBUS_CFLAGS)
  CLEANFILES += daemon/pulseaudio.desktop
  DISTCLEANFILES = esdcompat client.conf default.pa system.pa daemon.conf 
start-pulseaudio-x11 pulseaudio.service

+if !CLIENT_LIBS_ONLY
+
  if OS_IS_WIN32
  SYMLINK_PROGRAM=cd $(DESTDIR)$(bindir) && cp
  else
@@ -2202,6 +2225,8 @@ uninstall-hook:
        rm -f $(DESTDIR)$(libdir)/libpulsedsp.*
        rm -f $(DESTDIR)$(modlibexecdir)/*.so

+endif # !CLIENT_LIBS_ONLY
+
  massif: pulseaudio
        libtool --mode=execute valgrind --tool=massif --depth=6  
--alloc-fn=pa_xmalloc --alloc-fn=pa_xmalloc0 --alloc-fn=pa_xrealloc 
--alloc-fn=dbus_realloc --alloc-fn=pa_xnew0_internal 
--alloc-fn=pa_xnew_internal ./pulseaudio



And running massif does not make sense if only client libs are enabled.

--
Alexander E. Patrakov
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to