From bc455672084a495679e399017745a1de0ac0e2bf Mon Sep 17 00:00:00 2001 From: Daniel Richard G Date: Mon, 25 Dec 2017 22:18:18 -0500 Subject: [PATCH] Various updates to the Autotools build system: Makefile.audacious.am: * Add test/ subdirectory to the Autotools build * Add version.h to EXTRA_DIST so that "make distcheck" passes audacious/Makefile.audacious.am: * Install Audacious plug-in into the appropriate directory * No need to include CXXFLAGS in AM_CXXFLAGS, as the former is already included in the compiler invocation configure.ac: * Need to link to libvorbis in order for static-library builds (--disable-shared) to link correctly * Only add GCC-specific compiler flags if GCC is detected * Tightened up the GCC warning flags * Don't set LIBS, so that different targets can link against different libraries * Generate makefile for test/ subdirectory src/Makefile.audacious.am: * Install libvgmstream into the library directory * Removed GCC-specific flag from AM_CFLAGS * No need to include CFLAGS in AM_CFLAGS, as the former is already included in the compiler invocation * Add libvgmstream dependencies via LIBADD instead of global LIBS var test/Makefile.audacious.am: * New makefile template for test/ subdirectory unbootstrap: * Also remove "compile" script from bootstrap --- Makefile.audacious.am | 4 ++-- audacious/Makefile.audacious.am | 7 ++++--- configure.ac | 11 +++++++++-- src/Makefile.audacious.am | 5 +++-- src/coding/Makefile.audacious.am | 2 +- src/layout/Makefile.audacious.am | 22 +++++++++++----------- src/meta/Makefile.audacious.am | 2 +- test/Makefile.audacious.am | 9 +++++++++ unbootstrap | 2 +- 9 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 test/Makefile.audacious.am diff --git a/Makefile.audacious.am b/Makefile.audacious.am index 2c2095bc..d42d6215 100644 --- a/Makefile.audacious.am +++ b/Makefile.audacious.am @@ -3,6 +3,6 @@ AM_MAKEFLAGS=-f Makefile.audacious -SUBDIRS = src audacious +SUBDIRS = src audacious test -#EXTRA_DIST = include +EXTRA_DIST = version.h diff --git a/audacious/Makefile.audacious.am b/audacious/Makefile.audacious.am index a815fadb..bb9cf4c0 100644 --- a/audacious/Makefile.audacious.am +++ b/audacious/Makefile.audacious.am @@ -1,11 +1,12 @@ ## audacious-vgmstream automake script -lib_LTLIBRARIES = libvgmstream.la +#inputplugindir = $(libdir)/audacious/$(INPUT_PLUGIN_DIR) +inputplugindir = $(plugindir)/$(INPUT_PLUGIN_DIR) -libdir = @plugindir@/@INPUT_PLUGIN_DIR@ +inputplugin_LTLIBRARIES = libvgmstream.la AM_MAKEFLAGS=-f Makefile.audacious -AM_CXXFLAGS = -DVERSION=\"VGMSTREAM_VERSION\" -Wall -std=c++11 -fpermissive @CXXFLAGS@ -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ @GTK_CFLAGS@ +AM_CXXFLAGS = -DVERSION=\"VGMSTREAM_VERSION\" -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS) AM_LIBS = # sources/headers are updated automatically by ./bootstrap script (not all headers are needed though) diff --git a/configure.ac b/configure.ac index 34c07abc..fbc2a6bc 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,10 @@ PKG_CHECK_MODULES(AUDACIOUS, [audacious >= 3.5.0],, [AC_MSG_ERROR([Cannot find audacious >= 3.5.0 correctly installed])] ) +PKG_CHECK_MODULES(VORBIS, [vorbis],, + [AC_MSG_ERROR([Cannot find libvorbis])] +) + PKG_CHECK_MODULES(VORBISFILE, [vorbisfile],, [AC_MSG_ERROR([Cannot find libvorbisfile])] ) @@ -33,8 +37,10 @@ PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.6.0 gtk+-2.0 >= 2.6.0 gthread-2.0 pango], , [AC_MSG_ERROR([Cannot find glib2/gtk2/pango])] ) -CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS" -LIBS="$LIBS $AUDACIOUS_LIBS $GTK_LIBS $VORBISFILE_LIBS $MPG123_LIBS" +if test "_$GCC" = _yes +then + CFLAGS="$CFLAGS -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-but-set-variable" +fi plugindir=`pkg-config audacious --variable=plugin_dir` AC_SUBST(plugindir) @@ -55,4 +61,5 @@ AC_OUTPUT([ src/layout/Makefile.audacious src/meta/Makefile.audacious audacious/Makefile.audacious + test/Makefile.audacious ]) diff --git a/src/Makefile.audacious.am b/src/Makefile.audacious.am index 59bda2b6..94000b04 100644 --- a/src/Makefile.audacious.am +++ b/src/Makefile.audacious.am @@ -1,8 +1,8 @@ ## audacious-vgmstream automake script -noinst_LTLIBRARIES = libvgmstream.la +lib_LTLIBRARIES = libvgmstream.la -AM_CFLAGS = -Wall @CFLAGS@ -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ +AM_CFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ AM_MAKEFLAGS=-f Makefile.audacious SUBDIRS = coding layout meta @@ -11,5 +11,6 @@ SUBDIRS = coding layout meta libvgmstream_la_LDFLAGS = coding/libcoding.la layout/liblayout.la meta/libmeta.la libvgmstream_la_SOURCES = (auto-updated) libvgmstream_la_SOURCES += ../ext_libs/clHCA.c +libvgmstream_la_LIBADD = $(AUDACIOUS_LIBS) $(GTK_LIBS) $(VORBISFILE_LIBS) $(VORBIS_LIBS) $(MPG123_LIBS) -lm EXTRA_DIST = (auto-updated) EXTRA_DIST += ../ext_includes/clHCA.h diff --git a/src/coding/Makefile.audacious.am b/src/coding/Makefile.audacious.am index b2167d8f..11bbf4d9 100644 --- a/src/coding/Makefile.audacious.am +++ b/src/coding/Makefile.audacious.am @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libcoding.la -AM_CFLAGS = -Wall @CFLAGS@ -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ +AM_CFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ AM_MAKEFLAGS=-f Makefile.audacious # sources/headers are updated automatically by ./bootstrap script (not all headers are needed though) diff --git a/src/layout/Makefile.audacious.am b/src/layout/Makefile.audacious.am index 0a31f444..85cc2677 100644 --- a/src/layout/Makefile.audacious.am +++ b/src/layout/Makefile.audacious.am @@ -1,11 +1,11 @@ -## audacious-vgmstream automake script - -noinst_LTLIBRARIES = liblayout.la - -AM_CFLAGS = -Wall @CFLAGS@ -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ -AM_MAKEFLAGS=-f Makefile.audacious - -# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though) -liblayout_la_LDFLAGS = -liblayout_la_SOURCES = (auto-updated) -EXTRA_DIST = (auto-updated) +## audacious-vgmstream automake script + +noinst_LTLIBRARIES = liblayout.la + +AM_CFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ +AM_MAKEFLAGS=-f Makefile.audacious + +# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though) +liblayout_la_LDFLAGS = +liblayout_la_SOURCES = (auto-updated) +EXTRA_DIST = (auto-updated) diff --git a/src/meta/Makefile.audacious.am b/src/meta/Makefile.audacious.am index cb408e10..11ee0a7b 100644 --- a/src/meta/Makefile.audacious.am +++ b/src/meta/Makefile.audacious.am @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libmeta.la -AM_CFLAGS = -Wall @CFLAGS@ -DVAR_ARRAYS -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ +AM_CFLAGS = -DVAR_ARRAYS -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ AM_MAKEFLAGS=-f Makefile.audacious # sources/headers are updated automatically by ./bootstrap script (not all headers are needed though) diff --git a/test/Makefile.audacious.am b/test/Makefile.audacious.am new file mode 100644 index 00000000..80cf8167 --- /dev/null +++ b/test/Makefile.audacious.am @@ -0,0 +1,9 @@ +## audacious-vgmstream automake script + +bin_PROGRAMS = vgmstream-cli + +AM_CFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AO_CFLAGS) +AM_MAKEFLAGS = -f Makefile.audacious + +vgmstream_cli_SOURCES = test.c +vgmstream_cli_LDADD = ../src/libvgmstream.la diff --git a/unbootstrap b/unbootstrap index 2a784e4a..83476898 100755 --- a/unbootstrap +++ b/unbootstrap @@ -1,4 +1,4 @@ #!/bin/sh # audacious-vgmstream script - reverses the actions of bootstrap -rm -rf configure AUTHORS depcomp ChangeLog config.guess ltmain.sh README config.sub autom4te.cache Makefile.audacious.in INSTALL missing NEWS aclocal.m4 install-sh audacious/config.h.in audacious/main.loT audacious/Makefile.audacious.in src/Makefile.audacious.in src/coding/Makefile.audacious.in src/meta/Makefile.audacious.in src/layout/Makefile.audacious.in +rm -rf configure AUTHORS compile depcomp ChangeLog config.guess ltmain.sh README config.sub autom4te.cache Makefile.audacious.in INSTALL missing NEWS aclocal.m4 install-sh audacious/config.h.in audacious/main.loT audacious/Makefile.audacious.in src/Makefile.audacious.in src/coding/Makefile.audacious.in src/meta/Makefile.audacious.in src/layout/Makefile.audacious.in