From 22ff0a5176ac039cc5351873e5d8a1f68cd3e212 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 11 Oct 2015 18:14:01 +1100 Subject: [PATCH] Autotool fixes * Fix usage of `AC_INIT`. * Extract JACK version numbers from `AC_INIT` version number. * Newer versions of automake insists on the `subdir-objects` option when using C files from outside the current directory. * Need to use generate `noinst_LTLIBRARIES` rather than just adding and out-of-dir C file to the `*_SOURCES`. --- .gitignore | 2 ++ Makefile.am | 2 ++ autogen.sh | 3 +- configure.ac | 40 ++++++++++++++++--------- drivers/alsa/Makefile.am | 5 ++++ drivers/netjack/Makefile.am | 5 +++- jackd/Makefile.am | 17 ++++------- libjack/Makefile.am | 58 +++++++++++++++++++++++++------------ 8 files changed, 86 insertions(+), 46 deletions(-) diff --git a/.gitignore b/.gitignore index a1955bd..9946dcc 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ jack/version.h jackd/jack_md5.h jackd/jackd jackd/jackd.1 +m4 tags tools/alsa_in tools/alsa_out @@ -66,3 +67,4 @@ tools/jack_thread_wait tools/jack_transport tools/jack_unload tools/jackrec +libjack/.dirstamp diff --git a/Makefile.am b/Makefile.am index b4c4c63..1b638b9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,8 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config.h.in \ stamp-h.in config.log config.cache config.status +ACLOCAL_AMFLAGS = -I m4 + if HAVE_DOXYGEN DOC_DIR = doc dist-check-doxygen: diff --git a/autogen.sh b/autogen.sh index 5b37cf4..457839a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -18,11 +18,12 @@ else fi fi -$LIBTOOLIZE --force 2>&1 | sed '/^You should/d' || { +$LIBTOOLIZE --force --automake 2>&1 | sed '/^You should/d' || { echo "libtool failed, exiting..." exit 1 } +ACLOCAL_FLAGS="-I m4" aclocal $ACLOCAL_FLAGS || { echo "aclocal \$ACLOCAL_FLAGS where \$ACLOCAL_FLAGS= failed, exiting..." exit 1 diff --git a/configure.ac b/configure.ac index 5cad5a7..562967b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,14 @@ dnl Process this file with autoconf to produce a configure script. dnl $Id$ -AC_INIT(jackd/jackd.c) +AC_INIT([jack-audio-connection-kit],[0.124.2], + [jack-devel@lists.jackaudio.org],[],[http://www.jackaudio.org/]) +AC_CONFIG_SRCDIR([jackd/jackd.c]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR(config) +AC_LANG([C]) dnl dnl Check for existing JACK installs @@ -28,7 +34,7 @@ for dir in /usr/lib /usr/local/lib /opt/lib ; do done if test "x$FORCE_INSTALL" != "xyes" -a $not_overwriting -gt 0 ; then - echo + AC_MSG_RESULT(yes) echo echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "You appear to have at least one existing installation of JACK." @@ -54,6 +60,7 @@ if test "x$FORCE_INSTALL" != "xyes" -a $not_overwriting -gt 0 ; then exit 1 fi fi +AC_MSG_RESULT(no) AC_CONFIG_AUX_DIR(config) AC_CANONICAL_BUILD @@ -67,9 +74,17 @@ dnl interfaces are changed dnl micro version = incremented when implementation-only dnl changes are made dnl --- -JACK_MAJOR_VERSION=0 -JACK_MINOR_VERSION=124 -JACK_MICRO_VERSION=3 + +JACK_MAJOR_VERSION=$(echo $PACKAGE_VERSION | sed "s/\..*//") +JACK_MINOR_VERSION=$(echo $PACKAGE_VERSION | sed "s/${JACK_MAJOR_VERSION}\.//;s/\..*//") +JACK_MICRO_VERSION=$(echo $PACKAGE_VERSION | sed "s/.*\.//g") + +if test "${JACK_MAJOR_VERSION}.${JACK_MINOR_VERSION}.${JACK_MICRO_VERSION}" != "${PACKAGE_VERSION}" ; then + echo "ooops" + echo "Found : ${JACK_MAJOR_VERSION}.${JACK_MINOR_VERSION}.${JACK_MICRO_VERSION}" + echo "Expected : ${PACKAGE_VERSION}" + exit 1 + fi dnl --- dnl HOWTO: updating the jack protocol version @@ -100,10 +115,6 @@ JACK_API_CURRENT=0 JACK_API_REVISION=28 JACK_API_AGE=0 -AC_SUBST(JACK_MAJOR_VERSION) -AC_SUBST(JACK_MINOR_VERSION) -AC_SUBST(JACK_MICRO_VERSION) - AC_SUBST(JACK_PROTOCOL_VERSION) AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, "$JACK_PROTOCOL_VERSION", [Protocol version]) @@ -116,11 +127,12 @@ JACK_SO_VERSION=${JACK_API_CURRENT}:${JACK_API_REVISION}:${JACK_API_AGE} JACK_VERSION=$JACK_MAJOR_VERSION.$JACK_MINOR_VERSION.${JACK_MICRO_VERSION}${BETA} JACK_RELEASE=$JACK_MAJOR_VERSION-$JACK_MINOR_VERSION-${JACK_MICRO_VERSION}${BETA} + AC_SUBST(JACK_SO_VERSION) -AC_SUBST(JACK_VERSION) AC_SUBST(JACK_RELEASE) -AM_INIT_AUTOMAKE(jack-audio-connection-kit,${JACK_VERSION}) +AM_INIT_AUTOMAKE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl dnl save any user-provided CFLAGS so we can forget @@ -360,7 +372,7 @@ if test "build_cpu" = "powerpc" -o "$build_cpu" = "powerpc64" ; then AC_MSG_CHECKING(whether we can compile Altivec code) - AC_COMPILE_IFELSE([asm ("vand %v0, %v0, %v0");], + AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm ("vand %v0, %v0, %v0");])], AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.]) AC_DEFINE(HAVE_ALTIVEC_LINUX, 1, "Is there Altivec Support ?") ALTIVEC_OPT_FLAGS="-maltivec -mabi=altivec" @@ -417,7 +429,7 @@ elif echo $build_cpu | egrep '(i.86|x86_64)' >/dev/null; then AC_MSG_CHECKING(whether we can compile SSE code) - AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");], + AC_COMPILE_IFELSE([AC_LANG_SOURCE([asm ("movntps %xmm0, 0");])], [ if test x$optimization_by_cpu = xyes ; then if test x$cpu_supports_sse = xyes ; then @@ -985,7 +997,7 @@ dnl Output summary message dnl echo -echo $PACKAGE $VERSION : +echo $PACKAGE_NAME $PACKAGE_VERSION : echo echo \| Build with ALSA support............................... : $HAVE_ALSA echo \| Build with old FireWire \(FreeBob\) support............. : $HAVE_FREEBOB diff --git a/drivers/alsa/Makefile.am b/drivers/alsa/Makefile.am index 04b6284..93c8b17 100644 --- a/drivers/alsa/Makefile.am +++ b/drivers/alsa/Makefile.am @@ -18,3 +18,8 @@ noinst_HEADERS = alsa_driver.h \ usx2y.h jack_alsa_la_LIBADD = $(ALSA_LIBS) $(top_builddir)/jackd/libjackserver.la + + +noinst_LTLIBRARIES = libmemops.la + +libmemops_la_SOURCES = memops.c diff --git a/drivers/netjack/Makefile.am b/drivers/netjack/Makefile.am index 20fdd27..ccde901 100644 --- a/drivers/netjack/Makefile.am +++ b/drivers/netjack/Makefile.am @@ -1,6 +1,6 @@ MAINTAINCLEANFILES = Makefile.in -AM_CFLAGS = $(JACK_CFLAGS) +AM_CFLAGS = $(JACK_CFLAGS) plugindir = $(ADDON_DIR) @@ -14,3 +14,6 @@ jack_net_la_LIBADD = $(top_builddir)/libjack/libjack.la $(top_builddir)/jackd/li noinst_HEADERS = netjack.h net_driver.h netjack_packet.h +noinst_LTLIBRARIES = libnetjack_packet.la + +libnetjack_packet_la_SOURCES = netjack_packet.c diff --git a/jackd/Makefile.am b/jackd/Makefile.am index 30d0ac2..eb03ca3 100644 --- a/jackd/Makefile.am +++ b/jackd/Makefile.am @@ -1,4 +1,6 @@ -MAINTAINERCLEANFILES = Makefile.in jackd.1 jack_md5.h +AUTOMAKE_OPTIONS = subdir-objects + +MAINTAINERCLEANFILES = Makefile.in jackd.1 jack_md5.h if USE_CAPABILITIES CAP_PROGS = jackstart @@ -44,19 +46,10 @@ lib_LTLIBRARIES = libjackserver.la libjackserver_la_CFLAGS = $(AM_CFLAGS) -libjackserver_la_SOURCES = engine.c clientengine.c transengine.c controlapi.c \ - ../libjack/systemtest.c ../libjack/sanitycheck.c \ - ../libjack/client.c ../libjack/driver.c ../libjack/intclient.c \ - ../libjack/messagebuffer.c ../libjack/pool.c ../libjack/port.c \ - ../libjack/midiport.c ../libjack/ringbuffer.c ../libjack/shm.c \ - ../libjack/thread.c ../libjack/time.c ../libjack/transclient.c \ - ../libjack/unlock.c ../libjack/uuid.c ../libjack/metadata.c -libjackserver_la_LIBADD = simd.lo -ldb @OS_LDFLAGS@ +libjackserver_la_SOURCES = engine.c clientengine.c transengine.c controlapi.c +libjackserver_la_LIBADD = $(top_builddir)/libjack/simd.lo $(top_builddir)/libjack/libjackcommon.la $(top_builddir)/libjack/libjackdaemon.la -ldb @OS_LDFLAGS@ libjackserver_la_LDFLAGS = -export-dynamic -version-info @JACK_SO_VERSION@ -simd.lo: $(srcdir)/../libjack/simd.c - $(LIBTOOL) --mode=compile $(CC) -I$(top_builddir) $(JACK_CORE_CFLAGS) $(SIMD_CFLAGS) -c -o simd.lo $(srcdir)/../libjack/simd.c - man_MANS = jackd.1 jackstart.1 EXTRA_DIST = $(man_MANS) diff --git a/libjack/Makefile.am b/libjack/Makefile.am index 8d248e6..cda2e9d 100644 --- a/libjack/Makefile.am +++ b/libjack/Makefile.am @@ -10,20 +10,20 @@ install-exec-hook: endif SOURCE_FILES = \ - client.c \ - intclient.c \ - messagebuffer.c \ - pool.c \ - port.c \ - metadata.c \ - midiport.c \ - ringbuffer.c \ - shm.c \ - thread.c \ - time.c \ - transclient.c \ - unlock.c \ - uuid.c + client.c \ + intclient.c \ + messagebuffer.c \ + metadata.c \ + midiport.c \ + pool.c \ + port.c \ + ringbuffer.c \ + shm.c \ + thread.c \ + time.c \ + transclient.c \ + unlock.c \ + uuid.c simd.lo: $(srcdir)/simd.c $(LIBTOOL) --mode=compile $(CC) -I$(top_builddir) $(JACK_CORE_CFLAGS) $(SIMD_CFLAGS) -c -o simd.lo $(srcdir)/simd.c @@ -35,9 +35,31 @@ noinst_HEADERS = local.h AM_CFLAGS = $(JACK_CFLAGS) -DJACK_LOCATION=\"$(bindir)\" AM_CXXFLAGS = $(JACK_CFLAGS) -libjack_la_CFLAGS = $(AM_CFLAGS) - -libjack_la_SOURCES = $(SOURCE_FILES) -libjack_la_LIBADD = simd.lo -ldb @OS_LDFLAGS@ +libjack_la_SOURCES = +libjack_la_LIBADD = libjackcommon.la simd.lo -ldb @OS_LDFLAGS@ libjack_la_LDFLAGS = -export-dynamic -version-info @JACK_SO_VERSION@ +noinst_LTLIBRARIES = libjackcommon.la libjackdaemon.la + +libjackcommon_la_CFLAGS = $(AM_CFLAGS) +libjackcommon_la_SOURCES = \ + client.c \ + intclient.c \ + messagebuffer.c \ + metadata.c \ + midiport.c \ + pool.c \ + port.c \ + ringbuffer.c \ + shm.c \ + thread.c \ + time.c \ + transclient.c \ + unlock.c \ + uuid.c + +libjackdaemon_la_CFLAGS = $(AM_CFLAGS) +libjackdaemon_la_SOURCES = \ + driver.c \ + systemtest.c \ + sanitycheck.c