From: Mike Brady Date: Tue, 30 Oct 2018 19:49:32 +0000 (+0000) Subject: Start using libraries to be able to compile other people's or automatically generated... X-Git-Tag: 3.3RC0~189^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b91df8ec735509d40041132d8eae0a2c64d0bc0e;p=thirdparty%2Fshairport-sync.git Start using libraries to be able to compile other people's or automatically generated sources using standard compilation settings. --- diff --git a/.gitignore b/.gitignore index 09c6aa66..6f76aec5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ shairport-sync.core /org.gnome.ShairportSync.service /dbus-interface.* /mpris-interface.* +/lib_*.* # Some eclipse project files .cproject diff --git a/Makefile.am b/Makefile.am index feaf800b..9e6b4e91 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS = man +ARFLAGS = cr bin_PROGRAMS = shairport-sync @@ -9,6 +10,8 @@ shairport_sync_SOURCES = shairport.c rtsp.c mdns.c mdns_external.c common.c rtp. if BUILD_FOR_FREEBSD AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\" -O2 AM_CFLAGS = -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\" -O2 + lib_dbus_interface_a_CFLAGS = -pthread -O2 + lib_mpris_interface_a_CFLAGS = -pthread -O2 else if BUILD_FOR_OPENBSD AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" @@ -16,6 +19,7 @@ if BUILD_FOR_OPENBSD else AM_CXXFLAGS = -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" AM_CFLAGS = -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" + lib_dbus_interface_a_CFLAGS = -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -Wno-unused-parameter -pthread -DSYSCONFDIR=\"$(sysconfdir)\" endif endif @@ -96,9 +100,14 @@ endif BUILT_SOURCES = noinst_HEADERS = CLEANFILES = +shairport_sync_LDADD = +noinst_LIBRARIES = if USE_DBUS -shairport_sync_SOURCES += dbus-service.c dbus-interface.c +shairport_sync_LDADD += lib_dbus_interface.a +noinst_LIBRARIES += lib_dbus_interface.a +lib_dbus_interface_a_SOURCES = dbus-interface.c +shairport_sync_SOURCES += dbus-service.c BUILT_SOURCES += dbus-interface.h dbus-interface.c # We don't want to install this header noinst_HEADERS += $(BUILT_SOURCES) @@ -110,7 +119,10 @@ dbus-interface.h dbus-interface.c: org.gnome.ShairportSync.xml endif if USE_MPRIS -shairport_sync_SOURCES += mpris-service.c mpris-interface.c +shairport_sync_LDADD += lib_mpris_interface.a +noinst_LIBRARIES += lib_mpris_interface.a +lib_mpris_interface_a_SOURCES = mpris-interface.c +shairport_sync_SOURCES += mpris-service.c BUILT_SOURCES += mpris-interface.h mpris-interface.c # We don't want to install this header noinst_HEADERS += $(BUILT_SOURCES) @@ -126,13 +138,15 @@ noinst_PROGRAMS = if USE_DBUS_CLIENT #Make it, but don't install it anywhere noinst_PROGRAMS += shairport-sync-dbus-test-client -shairport_sync_dbus_test_client_SOURCES = dbus-interface.c dbus-interface.h shairport-sync-dbus-test-client.c +shairport_sync_dbus_test_client_SOURCES = shairport-sync-dbus-test-client.c +shairport_sync_dbus_test_client_LDADD = lib_dbus_interface.a endif if USE_MPRIS_CLIENT #Make it, but don't install it anywhere noinst_PROGRAMS += shairport-sync-mpris-test-client -shairport_sync_mpris_test_client_SOURCES = mpris-interface.c mpris-interface.h shairport-sync-mpris-test-client.c +shairport_sync_mpris_test_client_SOURCES = shairport-sync-mpris-test-client.c +shairport_sync_mpris_test_client_LDADD = lib_mpris_interface.a endif install-exec-hook: diff --git a/configure.ac b/configure.ac index 2968d410..65e362fd 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,7 @@ AC_INIT([shairport-sync], [3.3d19], [mikebrady@eircom.net]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) +AC_PROG_RANLIB # Derived from the Avahi configure.ac file # Specifying the OS type, defaulting to linux.