From 8715121755ad1aa9c083dd70781a63ced13359c2 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 3 Aug 2008 22:46:21 +0100 Subject: [PATCH] Modularise the RAOP stuff that requires OpenSSL and make it optional at compile time --- configure.ac | 41 +++++++++++++++++++++++++++++++++ src/Makefile.am | 35 +++++++++++++++++++++------- src/modules/{rtp => raop}/base64.c | 0 src/modules/{rtp => raop}/base64.h | 0 src/modules/{rtp => raop}/raop_client.c | 0 src/modules/{rtp => raop}/raop_client.h | 0 6 files changed, 68 insertions(+), 8 deletions(-) rename src/modules/{rtp => raop}/base64.c (100%) rename src/modules/{rtp => raop}/base64.h (100%) rename src/modules/{rtp => raop}/raop_client.c (100%) rename src/modules/{rtp => raop}/raop_client.h (100%) diff --git a/configure.ac b/configure.ac index 2b91a00..2a04076 100644 --- a/configure.ac +++ b/configure.ac @@ -1000,6 +1000,41 @@ AC_SUBST(POLKIT_LIBS) AC_SUBST(HAVE_POLKIT) AM_CONDITIONAL([HAVE_POLKIT], [test "x$HAVE_POLKIT" = x1]) +#### OpenSSL support (optional) #### + +AC_ARG_ENABLE([openssl], + AC_HELP_STRING([--disable-openssl], [Disable OpenSSL support (used for Airtunes/RAOP)]), + [ + case "${enableval}" in + yes) openssl=yes ;; + no) openssl=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-openssl) ;; + esac + ], + [openssl=auto]) + +if test "x${openssl}" != xno ; then + + PKG_CHECK_MODULES(OPENSSL, [ openssl > 0.9 ], + [ + HAVE_OPENSSL=1 + AC_DEFINE([HAVE_OPENSSL], 1, [Have OpenSSL]) + ], + [ + HAVE_OPENSSL=0 + if test "x$openssl" = xyes ; then + AC_MSG_ERROR([*** OpenSSL support not found]) + fi + ]) +else + HAVE_OPENSSL=0 +fi + +AC_SUBST(OPENSSL_CFLAGS) +AC_SUBST(OPENSSL_LIBS) +AC_SUBST(HAVE_OPENSSL) +AM_CONDITIONAL([HAVE_OPENSSL], [test "x$HAVE_OPENSSL" = x1]) + ### Build and Install man pages ### AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]), @@ -1201,6 +1236,11 @@ if test "x${HAVE_POLKIT}" = "x1" ; then ENABLE_POLKIT=yes fi +ENABLE_OPENSSL=no +if test "x${HAVE_OPENSSL}" = "x1" ; then + ENABLE_OPENSSL=yes +fi + ENABLE_PER_USER_ESOUND_SOCKET=no if test "x$per_user_esound_socket" = "x1" ; then ENABLE_PER_USER_ESOUND_SOCKET=yes @@ -1232,6 +1272,7 @@ echo " Enable TCP Wrappers: ${ENABLE_TCPWRAP} Enable libsamplerate: ${ENABLE_LIBSAMPLERATE} Enable PolicyKit: ${ENABLE_POLKIT} + Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL} System User: ${PA_SYSTEM_USER} System Group: ${PA_SYSTEM_GROUP} Realtime Group: ${PA_REALTIME_GROUP} diff --git a/src/Makefile.am b/src/Makefile.am index 4ffdfd9..f216b71 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,6 +62,10 @@ AM_CFLAGS += -DPA_MACHINE_ID=\"$(localstatedir)/lib/dbus/machine-id\" # This cool debug trap works on i386/gcc only AM_CFLAGS += '-DDEBUG_TRAP=__asm__("int $$3")' +if HAVE_OPENSSL +AM_CFLAGS += -I$(top_builddir)/src/modules/raop +endif + AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS) AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS) @@ -89,6 +93,7 @@ PA_THREAD_OBJS = \ pulsecore/semaphore-posix.c pulsecore/semaphore.h endif + ################################### # Extra files # ################################### @@ -1009,11 +1014,16 @@ librtp_la_SOURCES = \ modules/rtp/sdp.c modules/rtp/sdp.h \ modules/rtp/sap.c modules/rtp/sap.h \ modules/rtp/rtsp_client.c modules/rtp/rtsp_client.h \ - modules/rtp/raop_client.c modules/rtp/raop_client.h \ - modules/rtp/headerlist.c modules/rtp/headerlist.h \ - modules/rtp/base64.c modules/rtp/base64.h + modules/rtp/headerlist.c modules/rtp/headerlist.h librtp_la_LDFLAGS = -avoid-version -librtp_la_LIBADD = $(AM_LIBADD) libsocket-util.la libiochannel.la libsocket-client.la libioline.la libpulsecore.la -lssl +librtp_la_LIBADD = $(AM_LIBADD) libsocket-util.la libiochannel.la libsocket-client.la libioline.la libpulsecore.la + +libraop_la_SOURCES = \ + modules/raop/raop_client.c modules/raop/raop_client.h \ + modules/raop/base64.c modules/raop/base64.h +libraop_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS) +libraop_la_LDFLAGS = -avoid-version +libraop_la_LIBADD = $(AM_LIBADD) $(OPENSSL_LIBS) libsocket-util.la libiochannel.la libsocket-client.la libioline.la libpulsecore.la librtp.la # X11 @@ -1060,7 +1070,6 @@ modlibexec_LTLIBRARIES += \ module-remap-sink.la \ module-ladspa-sink.la \ module-esound-sink.la \ - module-raop-sink.la \ module-tunnel-sink.la \ module-tunnel-source.la \ module-position-event-sounds.la @@ -1127,8 +1136,7 @@ endif if HAVE_AVAHI modlibexec_LTLIBRARIES += \ module-zeroconf-publish.la \ - module-zeroconf-discover.la \ - module-raop-discover.la + module-zeroconf-discover.la endif if HAVE_LIRC @@ -1186,6 +1194,17 @@ pulselibexec_PROGRAMS += \ proximity-helper endif +if HAVE_OPENSSL +modlibexec_LTLIBRARIES += \ + libraop.la \ + module-raop-sink.la +if HAVE_AVAHI +modlibexec_LTLIBRARIES += \ + module-raop-discover.la +endif +endif + + # These are generated by a M4 script SYMDEF_FILES = \ @@ -1609,7 +1628,7 @@ module_bluetooth_device_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) # Apple Airtunes/RAOP module_raop_sink_la_SOURCES = modules/module-raop-sink.c module_raop_sink_la_LDFLAGS = -module -avoid-version -module_raop_sink_la_LIBADD = $(AM_LIBADD) libpulsecore.la libiochannel.la librtp.la +module_raop_sink_la_LIBADD = $(AM_LIBADD) libpulsecore.la libiochannel.la librtp.la libraop.la module_raop_discover_la_SOURCES = modules/module-raop-discover.c module_raop_discover_la_LDFLAGS = -module -avoid-version diff --git a/src/modules/rtp/base64.c b/src/modules/raop/base64.c similarity index 100% rename from src/modules/rtp/base64.c rename to src/modules/raop/base64.c diff --git a/src/modules/rtp/base64.h b/src/modules/raop/base64.h similarity index 100% rename from src/modules/rtp/base64.h rename to src/modules/raop/base64.h diff --git a/src/modules/rtp/raop_client.c b/src/modules/raop/raop_client.c similarity index 100% rename from src/modules/rtp/raop_client.c rename to src/modules/raop/raop_client.c diff --git a/src/modules/rtp/raop_client.h b/src/modules/raop/raop_client.h similarity index 100% rename from src/modules/rtp/raop_client.h rename to src/modules/raop/raop_client.h -- 2.7.4