[beast: 7/11] BUILD: configure.ac: combine dependencies into one LIBBSE pkg-config check
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 7/11] BUILD: configure.ac: combine dependencies into one LIBBSE pkg-config check
- Date: Thu, 3 Nov 2016 17:13:11 +0000 (UTC)
commit 763a8337d60ef9c7c4f3efb2b6a9cccd4837b06a
Author: Tim Janik <timj gnu org>
Date: Mon Oct 31 00:22:44 2016 +0100
BUILD: configure.ac: combine dependencies into one LIBBSE pkg-config check
Signed-off-by: Tim Janik <timj gnu org>
bse/Makefile.am | 23 ++++++------
bse/tests/Makefile.am | 2 +-
configure.ac | 81 ++++++++++++++++++++++++++---------------
drivers/Makefile.am | 2 +-
plugins/Makefile.am | 2 +-
plugins/freeverb/Makefile.am | 2 +-
sfi/Makefile.am | 18 +++++-----
sfi/tests/Makefile.am | 4 +-
shell/Makefile.am | 2 +-
tests/Makefile.am | 2 +-
tests/bse/Makefile.am | 4 +-
tests/latency/Makefile.am | 2 +-
tools/Makefile.am | 2 +-
13 files changed, 84 insertions(+), 62 deletions(-)
---
diff --git a/bse/Makefile.am b/bse/Makefile.am
index 994ed58..0cc504e 100644
--- a/bse/Makefile.am
+++ b/bse/Makefile.am
@@ -3,13 +3,12 @@ include $(top_srcdir)/Makefile.decl
SUBDIRS = icons res . pybse tests
+DEFS += @DEFINE__FILE_DIR__@ -DG_LOG_DOMAIN=\"BSE\" -DG_DISABLE_CONST_RETURNS -DBSE_COMPILATION
+AM_CPPFLAGS += -I$(top_srcdir)
# need -I$(top_srcdir) for <bse/bsedefs.hh>
# need -I$(top_builddir) for <sfi/sficonfig.h>
# need -I$(srcdir) for "bseserver.hh" in .genprc.cc
# need -I. (builddir) for "bsebasics.genidl.hh" in bsebasics.cc
-AM_CPPFLAGS += -I$(top_srcdir) -I$(top_builddir) -I$(srcdir) -I.
-DEFS += @DEFINE__FILE_DIR__@ $(patsubst %, -DG_LOG_DOMAIN=\"BSE\" -DBSE_COMPILATION, $(filter $(<F),
$(bse_sources) $(bse_sources)))
-AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVENIENCE -DG_DISABLE_DEPRECATED
-DG_DISABLE_CONST_RETURNS
AIDACC_VDEBUG = $(AIDACC) $(if $(findstring 1, $(V)), --aida-debug)
#
@@ -139,9 +138,10 @@ libbse_@MAJOR@includedir = $(bseincludedir)/bse
libbse_@MAJOR@include_HEADERS = $(bse_public_headers) bse.idl $(bse_idl_sources) bsehack.idl
$(idl_dummy_files)
nodist_libbse_@MAJOR@include_HEADERS = bsebasics.genidl.hh
libbse_@MAJOR@_la_SOURCES = $(bse_sources) $(bse_proc_gen_sources)
-libbse_@MAJOR@_la_LIBADD = $(top_builddir)/sfi/libsfi-@MAJOR@.la $(BSE_LIBS) $(SFI_LIBS)
$(RAPICORN_LIBS)
+libbse_@MAJOR@_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBBSE_CFLAGS) -DRAPICORN_CONVENIENCE
+libbse_@MAJOR@_la_LIBADD = $(top_builddir)/sfi/libsfi-@MAJOR@.la $(LIBBSE_LIBS)
libbse_@MAJOR@_la_LDFLAGS = $(strip \
- $(AM_LDFLAGS) -no-undefined \
+ $(AM_LDFLAGS) \
-Wl,--version-script=$(srcdir)/ldscript.map \
-version-info $(LT_VERSION_INFO) \
)
@@ -347,17 +347,18 @@ all: # TAGS
# other programs, we want to compile
#
noinst_PROGRAMS = $(ALLTESTS)
-progs_LDADD = libbse-@MAJOR@.la $(RAPICORN_LIBS) $(SFI_LIBS) -lm
-# source files
+progs_LDADD = libbse-@MAJOR@.la $(LIBBSE_LIBS)
-noinst_PROGRAMS += bseprocidl
-bseprocidl_SOURCES = bseprocidl.cc
-bseprocidl_LDADD = $(progs_LDADD)
+noinst_PROGRAMS += bseprocidl
+bseprocidl_SOURCES = bseprocidl.cc
+bseprocidl_LDADD = $(progs_LDADD)
+bseprocidl_CXXFLAGS = $(AM_CXXFLAGS) $(LIBBSE_CFLAGS)
# == bsetool ==
noinst_PROGRAMS += bsetool
bsetool_SOURCES = bsetool.cc
-bsetool_LDADD = libbse-@MAJOR@.la $(BSE_LIBS) $(RAPICORN_LIBS)
+bsetool_LDADD = $(progs_LDADD)
+bsetool_CXXFLAGS = $(AM_CXXFLAGS) $(LIBBSE_CFLAGS)
# == Tests ==
EXTRA_DIST += oldidl.idl
diff --git a/bse/tests/Makefile.am b/bse/tests/Makefile.am
index b05ba24..e28c2cf 100644
--- a/bse/tests/Makefile.am
+++ b/bse/tests/Makefile.am
@@ -10,7 +10,7 @@ AM_CXXFLAGS += $(BSE_CFLAGS) $(SFI_CPPFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVE
EXTRA_DIST += arrows.gp filter-defs.gp
noinst_PROGRAMS = $(ALLTESTS)
-progs_ldadd = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS)
+progs_ldadd = ../libbse-@MAJOR@.la $(LIBBSE_LIBS)
TAPTESTS += misctests
misctests_SOURCES = misctests.cc
diff --git a/configure.ac b/configure.ac
index 6dc0e88..6c1cfed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -246,15 +246,60 @@ AM_SILENT_RULES([yes])
AC_PROG_LN_S
AC_PROG_INSTALL
MC_ASSERT_PROG(PKG_CONFIG, pkg-config)
-
-# == Libraries ==
-# libz
-AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h, LIBZ_LIBS='-lz', LIBZ='')], LIBZ='')
+MC_ASSERT_PROG(PANDOC, pandoc)
+MC_ASSERT_PROG(DOXYGEN, doxygen)
+MC_ASSERT_PROG(DOT, dot)
+MC_ASSERT_PROG(PYTHON2, python-2.7 python2.7 python2)
+MC_ASSERT_VERSION($PYTHON --version, 2.7)
+MC_ASSERT_PROG(CYTHON, cython)
+MC_ASSERT_VERSION($CYTHON --version, 0.20.1)
+MC_ASSERT_PROG(XMLLINT, xmllint)
+MC_ASSERT_VERSION($XMLLINT --version, 20901)
+
+# == Headers ==
+AC_CHECK_HEADERS_ONCE( zlib.h mad.h alsa/asoundlib.h sys/soundcard.h soundcard.h X11/XKBlib.h
X11/extensions/XKBgeom.h guile/gh.h libguile/properties.h )
+
+# == pkg-config Libraries ==
+# librapicorn dependencies
+LIBBSE_REQUIRES="
+ glib-2.0 >= 2.32.3
+ gobject-2.0 >= 2.32.3
+ gthread-2.0 >= 2.32.3
+ gmodule-no-export-2.0 >= 2.32.3
+ rapicorn >= 16.0.1
+ ogg >= 1.2.2
+ vorbis >= 1.3.2
+ vorbisfile >= 1.3.2
+ vorbisenc >= 1.3.2
+ mad >= 0.14.2
+ flac >= 1.2.1
+ alsa >= 1.0.5
+ pangoft2 >= 1.30.0
+ gtk+-2.0 >= 2.12.12
+ libart-2.0 >= 2.3.8
+ libgnomecanvas-2.0 >= 2.4.0
+"
+LIBBSE_REQUIRES=`echo $LIBBSE_REQUIRES` # strip whitespaces
+AC_SUBST(LIBBSE_REQUIRES)
+# define LIBBSE_CFLAGS and LIBBSE_LIBS
+PKG_CHECK_MODULES(LIBBSE, [ $LIBBSE_REQUIRES ])
+# for calling pthread_ functions, '-lpthread' is needed in addition to '-pthread'
+LIBBSE_LIBS=`printf %s "$LIBBSE_LIBS" | sed 's/\(-pthread\b\)/\1 -lpthread/' `
+
+# == libz ==
+AC_CHECK_LIB(z, gzsetparams, [ LIBZ_LIBS='' ; test "$ac_cv_header_zlib_h" = yes && LIBZ_LIBS='-lz' ])
if test -z "$LIBZ_LIBS"; then
AC_MSG_ERROR([Compression library libz is missing, but required])
+else
+ LIBBSE_LIBS="$LIBBSE_LIBS $LIBZ_LIBS"
fi
AC_SUBST(LIBZ_LIBS)
+# == functions ==
+AC_CHECK_FUNCS(getpwnam_r getpwnam)
+AC_CHECK_FUNCS(timegm)
+
+
dnl #
dnl # Define package requirements.
dnl #
@@ -288,20 +333,6 @@ AC_DEFUN([MC_I18N_REQUIREMENTS],
INTLMERGE='$(top_builddir)/$(ac_aux_dir)/intltool-merge'
AC_SUBST(INTLMERGE) dnl # AC_PATH_PROG(INTLMERGE, intltool-merge, intltool-merge)
])
-AC_DEFUN([MC_SFI_REQUIREMENTS],
-[
- dnl # check for GLib libs
- PKG_CHECK_MODULES(GLIB_GOMT, glib-2.0 >= 2.32.3 gobject-2.0 gmodule-no-export-2.0 gthread-2.0)
- AC_SUBST(GLIB_GOMT_CFLAGS)
- AC_SUBST(GLIB_GOMT_LIBS)
- SFI_CPPFLAGS="$GLIB_GOMT_CFLAGS"
- SFI_LIBS="$GLIB_GOMT_LIBS"
- AC_SUBST(SFI_CPPFLAGS)
- AC_SUBST(SFI_LIBS)
-
- AC_CHECK_FUNCS(getpwnam_r getpwnam)
- AC_CHECK_FUNCS(timegm)
-])
AC_DEFUN([MC_BSE_REQUIREMENTS],
[
dnl # require Rapicorn
@@ -319,15 +350,6 @@ AC_DEFUN([MC_BSE_REQUIREMENTS],
AC_MSG_RESULT([$(test $vorbisfile_badseek = 1 && echo yes || echo no)])
AC_DEFINE_UNQUOTED(VORBISFILE_BADSEEK, [$vorbisfile_badseek], [buggy Vorbisfile pcm_seek])
- dnl # --- FLAC check ---
- PKG_CHECK_MODULES(FLAC, flac)
-
- dnl # old FLAC versions use "-I/usr/.../include/FLAC" as pkg-config --cflags
- dnl # new FLAC versions use "-I/usr/.../include" as pkg-config --cflags
- dnl #
- dnl # to support both, we strip /FLAC from FLAC_CFLAGS and use #include <FLAC/foo.h>
- FLAC_CFLAGS=`echo $FLAC_CLFAGS | $SED "s/FLAC$//"`
-
dnl # --- libmad MPEG decoder check ---
dnl # libmad doesn't come with a mad.pc file (just its debian package)
dnl # PKG_CHECK_MODULES(MAD, mad >= 0.14.2,
@@ -361,8 +383,8 @@ AC_DEFUN([MC_BSE_REQUIREMENTS],
fi
dnl # --- complete CFLAGS/LIBS setup ---
- BSE_CFLAGS="$MAD_CFLAGS $FLAC_CFLAGS $SFI_CPPFLAGS"
- BSE_LIBS="$OGGVORBIS_LIBS $MAD_LIBS $FLAC_LIBS $SFI_LIBS"
+ BSE_CFLAGS="$SFI_CPPFLAGS"
+ BSE_LIBS="$OGGVORBIS_LIBS $SFI_LIBS"
AC_SUBST(BSE_CFLAGS)
AC_SUBST(BSE_LIBS)
dnl # --- figure stuff for bse.pc ---
@@ -652,7 +674,6 @@ AM_CONDITIONAL(WITH_PERLRULE, [test "$PERLRULE" != "#"])
# Check requirement sets
MC_I18N_REQUIREMENTS
-MC_SFI_REQUIREMENTS
MC_BSE_REQUIREMENTS
MC_ASOUND_CHECK
MC_BSESCM_REQUIREMENTS
diff --git a/drivers/Makefile.am b/drivers/Makefile.am
index 00d9825..015642d 100644
--- a/drivers/Makefile.am
+++ b/drivers/Makefile.am
@@ -9,7 +9,7 @@ AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVENIENCE
driversdir = $(bselibdir)/drivers
drivers_LTLIBRARIES = bsepcmdevice-alsa.la bsemididevice-alsa.la
drivers_ldflags = -avoid-version
-drivers_libs = $(top_builddir)/bse/libbse-@MAJOR@.la $(BSE_LIBS) $(SFI_LIBS) $(RAPICORN_LIBS)
+drivers_libs = ../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
# Plugin bsepcmdevice-alsa
bsepcmdevice_alsa_la_SOURCES = bsepcmdevice-alsa.cc
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 4654813..d364bfa 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -56,7 +56,7 @@ UNPORTED = $(strip \
# === plugin build rule setup ===
plugins_ldflags = -avoid-version
-plugins_libs = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS) -lm
+plugins_libs = ../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
plugins_built_sources = # listed in Makefile.plugins
CLEANFILES += $(plugins_built_sources)
# .FPU plugins
diff --git a/plugins/freeverb/Makefile.am b/plugins/freeverb/Makefile.am
index 58a90a7..ba98f05 100644
--- a/plugins/freeverb/Makefile.am
+++ b/plugins/freeverb/Makefile.am
@@ -10,7 +10,7 @@ plugindir = $(bselibdir)/plugins
freeverb_la_SOURCES = allpass.cpp comb.cpp revmodel.cpp bsefreeverbcpp.cpp bsefreeverb.cc
freeverb_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
-freeverb_la_LIBADD = $(top_builddir)/bse/libbse-@MAJOR@.la $(BSE_LIBS) -lm
+freeverb_la_LIBADD = ../../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
plugin_LTLIBRARIES = freeverb.la
diff --git a/sfi/Makefile.am b/sfi/Makefile.am
index 6df570f..8548ace 100644
--- a/sfi/Makefile.am
+++ b/sfi/Makefile.am
@@ -1,10 +1,9 @@
# BEAST & BSE
include $(top_srcdir)/Makefile.decl
-SUBDIRS = . tests
-AM_CPPFLAGS += -I$(top_srcdir) -I$(top_builddir) $(SFI_CPPFLAGS)
+SUBDIRS = . tests
DEFS += @DEFINE__FILE_DIR__@ -DG_LOG_DOMAIN=\"SFI\" -DG_DISABLE_CONST_RETURNS
-AM_CXXFLAGS += $(SFI_CPPFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVENIENCE
+AM_CPPFLAGS += -I$(top_srcdir)
sfi_public_headers = $(strip \
sfistore.hh sficomwire.hh sfifilecrawler.hh \
@@ -33,22 +32,23 @@ sfi_built_sources = $(strip \
$(sfi_all_sources): $(sfi_built_sources)
-# SFI library
+# == libsfi-@MAJOR@.so ==
noinst_LTLIBRARIES = libsfi-@MAJOR@.la
libsfi_@MAJOR@includedir = $(bseincludedir)/sfi
libsfi_@MAJOR@include_HEADERS = $(sfi_public_headers)
libsfi_@MAJOR@_la_SOURCES = $(sfi_all_sources)
-libsfi_@MAJOR@_la_LIBADD = $(SFI_LIBS) -lm
-libsfi_@MAJOR@_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info $(LT_VERSION_INFO)
+libsfi_@MAJOR@_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBBSE_CFLAGS) -DRAPICORN_CONVENIENCE
+libsfi_@MAJOR@_la_LIBADD = $(LIBBSE_LIBS)
#
# programs to build
#
# source files
-bin_PROGRAMS = sfidl
-sfidl_SOURCES = sfidl.cc
-sfidl_LDADD = $(SFI_LIBS) $(RAPICORN_LIBS) -lm
+bin_PROGRAMS = sfidl
+sfidl_SOURCES = sfidl.cc
+sfidl_CXXFLAGS = $(AM_CXXFLAGS) $(LIBBSE_CFLAGS) -DRAPICORN_CONVENIENCE
+sfidl_LDADD = $(LIBBSE_LIBS)
# included files
EXTRA_DIST += sfidl-generator.cc sfidl-namespace.cc sfidl-options.cc sfidl-parser.cc sfidl-factory.cc
EXTRA_DIST += sfidl-typelist.cc sfidl-cbase.cc sfidl-clientc.cc sfidl-clientcxx.cc sfidl-corec.cc
diff --git a/sfi/tests/Makefile.am b/sfi/tests/Makefile.am
index 957de81..04085bd 100644
--- a/sfi/tests/Makefile.am
+++ b/sfi/tests/Makefile.am
@@ -6,8 +6,8 @@ DEFS += @DEFINE__FILE_DIR__@ -DG_LOG_DOMAIN='"$(basename $(@F))"' -DPARANOID
AM_CXXFLAGS += $(SFI_CPPFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVENIENCE
noinst_PROGRAMS = $(ALLTESTS)
-progs_nosfi_ldadd = $(RAPICORN_LIBS) $(SFI_LIBS) -lm
-progs_ldadd = $(top_builddir)/sfi/libsfi-@MAJOR@.la $(RAPICORN_LIBS) $(SFI_LIBS) -lm
+progs_nosfi_ldadd = $(LIBBSE_LIBS)
+progs_ldadd = $(top_builddir)/sfi/libsfi-@MAJOR@.la $(progs_nosfi_ldadd)
SFIDL = $(top_builddir)/sfi/sfidl
# ring
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 7aba707..0149adf 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -16,7 +16,7 @@ gen_sources = xgen-bsggc
CLEANFILES += $(gen_sources)
# libraries to link programs against
-programs_ldadd = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS)
+programs_ldadd = ../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
#
# programs to build
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 415752a..151eccb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,7 +22,7 @@ generated: clean-generated $(GENERATED)
# === test programs ===
noinst_PROGRAMS = $(ALLTESTS)
-progs_ldadd = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS)
+progs_ldadd = ../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
# testwavechunk
TAPTESTS += testwavechunk
diff --git a/tests/bse/Makefile.am b/tests/bse/Makefile.am
index 65790f5..c3d79cd 100644
--- a/tests/bse/Makefile.am
+++ b/tests/bse/Makefile.am
@@ -18,7 +18,7 @@ generated: clean-generated $(GENERATED)
# test programs
#
noinst_PROGRAMS = $(ALLTESTS)
-progs_ldadd = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS)
+progs_ldadd = ../../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
#SLOWTESTS += cxxbinding
#cxxbinding_SOURCES = cxxbinding.cc bsecxxapi.cc
@@ -38,7 +38,7 @@ SFIDL_INC = --nostdinc -I$(top_srcdir) -I$(top_builddir)
lib_LTLIBRARIES = testplugin.la
testplugin_la_SOURCES = testplugin.cc
testplugin_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
-testplugin_la_LIBADD = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS) -lm
+testplugin_la_LIBADD = $(progs_ldadd)
EXTRA_DIST += testplugin.idl
testplugin.genidl.hh: testplugin.idl $(SFIDL)
$(SFIDL) --core-cxx $(SFIDL_INC) -I$(top_builddir) $< > xgen-$(@F)
diff --git a/tests/latency/Makefile.am b/tests/latency/Makefile.am
index 59316fe..ffdb15e 100644
--- a/tests/latency/Makefile.am
+++ b/tests/latency/Makefile.am
@@ -20,7 +20,7 @@ BSESCM = $(top_builddir)/shell/bsescm-$(BIN_VERSION)
# bselatencytest:
bselatencytest_la_SOURCES = bselatencytest.cc
bselatencytest_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
-bselatencytest_la_LIBADD = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS) -lm
+bselatencytest_la_LIBADD = ../../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
EXTRA_HEADERS += bselatencytest.idl
$(srcdir)/bselatencytest.cc: bselatencytest.idl
$(srcdir)/bselatencytest.cc: bselatencytest.genidl.hh
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 7990c16..3a151c9 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -8,7 +8,7 @@ DEFS += @DEFINE__FILE_DIR__@ -DG_LOG_DOMAIN=\"BSE-TOOLS\" -DG_DISABLE_CON
AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DRAPICORN_CONVENIENCE
noinst_PROGRAMS = $(ALLTESTS)
-progs_ldadd = $(top_builddir)/bse/libbse-@MAJOR@.la $(RAPICORN_LIBS) $(BSE_LIBS)
+progs_ldadd = ../bse/libbse-@MAJOR@.la $(LIBBSE_LIBS)
#
# tools to build
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]