Ticket #36 (new defect)
C++ bindings do not build with config scripts
| Reported by: | bjornroche | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | V19-RC1 |
| Component: | build-systems | Version: | |
| Keywords: | cpp c++ fedora mac OS X | Cc: |
Description
Mickael Magnusson submitted this:
Yan Morin wrote: Hi, is there a way to compile cpp bindings (v19) on: - Mac OS X (with a different --prefix for portaudio) - Fedora Core 6 (they removed every .la files in each library, including alsa-lib-devel and don't use libtool anymore)
Hi,
I have made a patch which use pkg-config to detect compilation and linking parameters instead of linking directly to libportaudio.la. I have added portaudio-2.0-uninstalled.pc.in which will be used when building the cpp bindings.
After applying the patch, you need to run autoconf in both the portaudio root directory and in bindings/cpp sub directory.
Mikael Index: configure.in =================================================================== --- configure.in (revision 1140) +++ configure.in (arbetskopia) @@ -308,4 +308,4 @@
AC_SUBST(ENABLE_CXX_TRUE) AC_SUBST(ENABLE_CXX_FALSE)
-AC_OUTPUT([Makefile portaudio-2.0.pc]) +AC_OUTPUT([Makefile portaudio-2.0.pc portaudio-2.0-uninstalled.pc]) Index: portaudio-2.0-uninstalled.pc.in =================================================================== --- portaudio-2.0-uninstalled.pc.in (revision 0) +++ portaudio-2.0-uninstalled.pc.in (revision 0) @@ -0,0 +1,12 @@ +abs_top_builddir=@abs_top_builddir@ +abs_top_srcdir=@abs_top_srcdir@ +libdir=${abs_top_builddir}/lib +includedir=${abs_top_srcdir}/include + +Name: PortAudio +Description: Portable audio I/O +Requires: +Version: 19 + +Libs: -L${libdir} -lportaudio @LIBS@ +Cflags: -I${includedir} @THREAD_CFLAGS@ Index: bindings/cpp/configure.ac =================================================================== --- bindings/cpp/configure.ac (revision 1140) +++ bindings/cpp/configure.ac (arbetskopia) @@ -37,6 +37,11 @@
AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL
+export PKG_CONFIG_PATH="pwd/${PORTAUDIO_ROOT}:${PKG_CONFIG_PATH}" + +PKG_CHECK_MODULES(PORTAUDIO,[portaudio-2.0]) + +
# Transfer these variables to the Makefile AC_SUBST(DEFAULT_INCLUDES) AC_SUBST(PORTAUDIO_ROOT)
Index: bindings/cpp/lib/Makefile.am =================================================================== --- bindings/cpp/lib/Makefile.am (revision 1140) +++ bindings/cpp/lib/Makefile.am (arbetskopia) @@ -2,11 +2,11 @@
lib_LTLIBRARIES = libportaudiocpp.la
+AM_CPPFLAGS = $(PORTAUDIO_CFLAGS)
LDADD = libportaudiocpp.la
libportaudiocpp_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined
- -libportaudiocpp_la_LIBADD = $(top_builddir)/$(PORTAUDIO_ROOT)/lib/libportaudio.la +libportaudiocpp_la_LIBADD = $(PORTAUDIO_LIBS)
libportaudiocpp_la_SOURCES = \
$(SRCDIR)/BlockingStream.cxx \ $(SRCDIR)/CallbackInterface.cxx \
