On Jul 12 18:42:23, Marc Espie wrote: > On Thu, Jul 12, 2012 at 04:13:38PM +0200, David Coppa wrote: > > On Thu, Jul 12, 2012 at 4:07 PM, Jan Stary <h...@stare.cz> wrote: > > > > > Index: Makefile > > > =================================================================== > > > RCS file: /cvs/ports/audio/opencore-amr/Makefile,v > > > retrieving revision 1.1.1.1 > > > diff -u -p -r1.1.1.1 Makefile > > > --- Makefile 6 Jul 2012 17:21:11 -0000 1.1.1.1 > > > +++ Makefile 12 Jul 2012 13:45:06 -0000 > > > @@ -25,6 +25,6 @@ MASTER_SITES= ${MASTER_SITE_SOURCEFORGE > > > > > > SEPARATE_BUILD= yes > > > CONFIGURE_STYLE= gnu > > > -USE_LIBTOOL= gnu # oh my. > > > +USE_LIBTOOL= yes > > > > > > .include <bsd.port.mk> > > > > You're late to the party ;)
> Sorry, partly my fault. I changed my mind about this one. > If there's a clean > fix for upstream, that's cool. Otherwise, just recognizing -x c and zapping > it looked safe enough... So, to understand: our libtool now mimicks the practice of throwing out certain options (saving for instance opencore-amr from a linkage failure?) Meanwhile in Finland, this is what upstream says: On Jul 12 17:52:59, Martin Storsjö wrote: > On Thu, 12 Jul 2012, Jan Stary wrote: > > >Why do the amr[nw]b/Makefile.{am,in} pass the '-x c' option > >to the build chain? It gets propagated to the linker which > >chokes on it as described at > > > >http://marc.info/?l=openbsd-ports&m=134210244701781&w=2 > > > >The reason it builds anyway is it relies on a very > >doubtfull libtool 'feature', namely removing any > >options it does not understand, as described at > > > >http://old.nabble.com/fun-with-libtool-for-masochistic-guys-td34144492.html > > > >Is there please a chance to get the diffs below > >commited to the opencore-amr tree? > > > >Or do the '-x c' serve some real purpose needed elsewhere? > > The purpose it serves is to build the source as it were C, instead > of C++, to get rid of the useless dependencies on the libstdc++. > > One way of disabling this hack is to simply pass --disable-compile-c > to configure, then it will all be built as C++ instead. > > I'll look into if there's any way to set this as a flag only to the > compile commands and not to the link ones - I had not expected that > AM_CFLAGS was included while linking, but apparently it is. > > // Martin On Jul 12 18:10:45, Martin Storsjö wrote: > On Thu, 12 Jul 2012, Martin Storsjö wrote: > > >On Thu, 12 Jul 2012, Jan Stary wrote: > > > >>Why do the amr[nw]b/Makefile.{am,in} pass the '-x c' option > >>to the build chain. It gets propagated to the linker which > >>chokes on it as described at > >> > >>http://marc.info/?l=openbsd-ports&m=134210244701781&w=2 > >> > >>The reason it builds anyway is it relies on a very > >>doubtfull libtool 'feature', namely removing any > >>options it does not understand, as described at > >> > >>http://old.nabble.com/fun-with-libtool-for-masochistic-guys-td34144492.html > >> > >>Is there please a chance to get the diffs below > >>commited to the opencore-amr tree? > >> > >>Or do the '-x c' serve some real purpose needed elsewhere? > > > >The purpose it serves is to build the source as it were C, instead of C++, > >to get rid of the useless dependencies on the libstdc++. > > > >One way of disabling this hack is to simply pass --disable-compile-c to > >configure, then it will all be built as C++ instead. > > > >I'll look into if there's any way to set this as a flag only to the > >compile commands and not to the link ones - I had not expected that > >AM_CFLAGS was included while linking, but apparently it is. > > Does the attached work for you, or does that have the same problem > as well? This makes it build the code as C++, but avoids (at least > with gcc) any dependencines on libstdc++. > > You can try building with --enable-examples to see whether the built > library links as a pure C library - the patch you attached above > breaks this case. > > // Martin > diff --git a/amrnb/Makefile.am b/amrnb/Makefile.am > index 1b42bd5..a364d8a 100644 > --- a/amrnb/Makefile.am > +++ b/amrnb/Makefile.am > @@ -18,8 +18,10 @@ if GCC_ARMV5 > AM_CFLAGS += -DPV_CPU_ARCH_VERSION=5 -DPV_COMPILER=1 > endif > > +AM_CXXFLAGS = $(AM_CFLAGS) > + > if COMPILE_AS_C > - AM_CFLAGS += -x c -std=c99 > + AM_CXXFLAGS += -fno-exceptions -fno-rtti > libopencore_amrnb_la_LINK = $(LINK) $(libopencore_amrnb_la_LDFLAGS) > # Mention a dummy pure C file to trigger generation of the $(LINK) > variable > nodist_EXTRA_libopencore_amrnb_la_SOURCES = dummy.c > @@ -27,8 +29,6 @@ else > libopencore_amrnb_la_LINK = $(CXXLINK) $(libopencore_amrnb_la_LDFLAGS) > endif > > -AM_CXXFLAGS = $(AM_CFLAGS) > - > amrnbincludedir = $(includedir)/opencore-amrnb > amrnbinclude_HEADERS = > > diff --git a/amrwb/Makefile.am b/amrwb/Makefile.am > index a6cc33c..9c5e7b2 100644 > --- a/amrwb/Makefile.am > +++ b/amrwb/Makefile.am > @@ -14,8 +14,10 @@ if GCC_ARMV5 > AM_CFLAGS += -DPV_CPU_ARCH_VERSION=5 -DPV_COMPILER=1 > endif > > +AM_CXXFLAGS = $(AM_CFLAGS) > + > if COMPILE_AS_C > - AM_CFLAGS += -x c -std=c99 > + AM_CXXFLAGS += -fno-exceptions -fno-rtti > libopencore_amrwb_la_LINK = $(LINK) $(libopencore_amrwb_la_LDFLAGS) > # Mention a dummy pure C file to trigger generation of the $(LINK) > variable > nodist_EXTRA_libopencore_amrwb_la_SOURCES = dummy.c > @@ -23,8 +25,6 @@ else > libopencore_amrwb_la_LINK = $(CXXLINK) $(libopencore_amrwb_la_LDFLAGS) > endif > > -AM_CXXFLAGS = $(AM_CFLAGS) > - > amrwbincludedir = $(includedir)/opencore-amrwb > amrwbinclude_HEADERS = dec_if.h if_rom.h >