On Mar 12 10:22:59, [email protected] wrote:
> CVSROOT: /cvs
> Module name: ports
> Changes by: [email protected] 2013/03/12 10:22:59
>
> Modified files:
> devel/libaudiofile: Makefile distinfo
> Added files:
> devel/libaudiofile/patches: patch-configure
>
> Log message:
> Update to libaudiofile-0.3.6 which adds FLAC support.
>
> Thanks to espie@ for the help regarding the horrible and bogus CFLAGS
> transformation... which was only seen on OpenBSD because pkgconfig files
> from our audio/flac port are patched for some reason.
The very same story happened recently on linsbdfile-devel.
libsndfile's configure does this ugly sed transformation
to resolve the between "assert.h" and FLAC's "FLAC/assert.h";
this has broken the libsndfile compilation on OpenBSD,
because with the way we path FLAC pc files,
the "-I/usr/local/include/FLAC" was no longer at end of line
(which libsndfile's ./configure expected).
Jan
On Feb 20 22:20:16, [email protected] wrote:
> I am building libsndfile from git on OpenBSD.
> There seem to be some issues with the autogen/configure/make process.
>
> autogen goes fine if supplied with the AUTO* variables:
> $ env AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.9 ./autogen.sh
>
> This produces a ./configure which mostly works;
> when run simply as './configure --prefix=$HOME'
> it finds the external FLAC/Vorbis using pkg-config.
>
> But the actual compiling then is somewhat strange:
>
> (1)
>
> $ make
> [...]
> depbase=`echo sndfile.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; if
> /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
> -I/usr/local/include/FLAC -I/usr/local/include -I/usr/local/include
> -I/usr/local/include -g -O2 -std=gnu99 -Wall -Wextra
> -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -MT sndfile.lo -MD -MP -MF "$depbase.Tpo" -c -o sndfile.lo
> sndfile.c; then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f
> "$depbase.Tpo"; exit 1; fi
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/FLAC
> -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2
> -std=gnu99 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith
> -funsigned-char -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return
> -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast
> -Wwrite-strings -Wundef -pipe -MT sndfile.lo -MD -MP -MF .deps/sndfile.Tpo -c
> sndfile.c -fPIC -DPIC -o .libs/sndfile.o
> sndfile.c: In function 'sf_open':
> sndfile.c:320: warning: implicit declaration of function 'assert'
> sndfile.c:320: warning: nested extern declaration of 'assert'
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/FLAC
> -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2
> -std=gnu99 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith
> -funsigned-char -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return
> -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast
> -Wwrite-strings -Wundef -pipe -MT sndfile.lo -MD -MP -MF .deps/sndfile.Tpo -c
> sndfile.c -o sndfile.o >/dev/null 2>&1
>
> It's a simple
>
> /* Ultimate sanity check. */
> assert (sizeof (sf_count_t) == 8) ;
>
> and the file does include <assert.h>
> - how would assert() be implicit or nested here?
>
>
> (2)
>
> The compilation eventually fails:
>
> $ make
> [...]
> Making all in examples
> if gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../src -g -O2 -std=gnu99 -Wall
> -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -MT make_sine.o -MD -MP -MF ".deps/make_sine.Tpo" -c -o
> make_sine.o make_sine.c; then mv -f ".deps/make_sine.Tpo"
> ".deps/make_sine.Po"; else rm -f ".deps/make_sine.Tpo"; exit 1; fi
> /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -std=gnu99 -Wall -Wextra
> -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -o make_sine make_sine.o ../src/libsndfile.la -lm
> libtool: link: gcc -g -O2 -std=gnu99 -Wall -Wextra
> -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -o .libs/make_sine make_sine.o -L../src/.libs -lsndfile
> -L/usr/local/lib -lFLAC -lvorbisenc -lvorbis -logg -lm
> -Wl,-rpath,/home/hans/lib -Wl,-rpath,/usr/local/lib
> /usr/local/lib/libFLAC.so.9.0: warning: strcpy() is almost always misused,
> please use strlcpy()
> /usr/local/lib/libFLAC.so.9.0: warning: strcat() is almost always misused,
> please use strlcat()
> ../src/.libs/libsndfile.so.1.26: undefined reference to `assert'
> collect2: ld returned 1 exit status
> *** Error 1 in examples (Makefile:343 'make_sine')
> *** Error 1 in /home/hans/src/libsndfile (Makefile:377 'all-recursive')
>
> Isn't assert() part of the standard library?
> Is this a libtool fsckup?
>
>
> Strangely, running ./configure with
>
> $ env CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
>
> solves this: the above lines then become
>
> Making all in examples
> if gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../src -g -O2 -std=gnu99 -Wall
> -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -MT make_sine.o -MD -MP -MF ".deps/make_sine.Tpo" -c -o
> make_sine.o make_sine.c; then mv -f ".deps/make_sine.Tpo"
> ".deps/make_sine.Po"; else rm -f ".deps/make_sine.Tpo"; exit 1; fi
> /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -std=gnu99 -Wall -Wextra
> -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -L/usr/local/lib -o make_sine make_sine.o
> ../src/libsndfile.la -lm
> libtool: link: gcc -g -O2 -std=gnu99 -Wall -Wextra
> -Wdeclaration-after-statement -Wpointer-arith -funsigned-char
> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align
> -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings
> -Wundef -pipe -o .libs/make_sine make_sine.o -L/usr/local/lib -L../src/.libs
> -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm -Wl,-rpath,/home/hans/lib
> -Wl,-rpath,/usr/local/lib
> /usr/local/lib/libFLAC.so.9.0: warning: strcpy() is almost always misused,
> please use strlcpy()
> /usr/local/lib/libFLAC.so.9.0: warning: strcat() is almost always misused,
> please use strlcat()
>
> The only difference my weary eyes can see is indeed the extra
> -L/usr/local/lib (in front of -lsndfile), but how could this
> make the difference bewteen assert() being defined or not?
>
>
> Both of (1) and (2) also happen when using gmake,
> which is GNU make.
>
> Jan
>
On Feb 21 09:10:53, [email protected] wrote:
> > > depbase=`echo sndfile.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;
> > > if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
> > > -I. -I/usr/local/include/FLAC
> > ^^^^^^^^^^^^^^^^^^^^^^^
> >
> > Where is that coming from because it should not be there.
>
> That's what pkgconfig says:
>
> $ pkg-config --cflags flac
> -I/usr/local/include/FLAC -I/usr/local/include
>
> > In libsndfile
> > (at least in git HEAD, but probably 1.0.25) as well, all the flac headers
> > are included as:
> >
> > #include <FLAC/header.h>
> >
> > instead of
> >
> > #include "header.h"
> >
> > to avoid the inclusion of FLAC/assert.h which clashes with the ISO C header
> > of the same name which causes this:
> >
> > > sndfile.c: In function 'sf_open':
> > > sndfile.c:320: warning: implicit declaration of function 'assert'
> > > sndfile.c:320: warning: nested extern declaration of 'assert'
> >
> > <snip>
> >
> > > It's a simple
> > >
> > > /* Ultimate sanity check. */
> > > assert (sizeof (sf_count_t) == 8) ;
> > >
> > > and the file does include <assert.h>
> > > - how would assert() be implicit or nested here?
> >
> > <snip>
> >
> > > Is this a libtool fsckup?
> >
> > Nope, a poor choice of header filename by the FLAC author :-).
>
> Oh dear. And it looks like the whole point is two
> #define's to work around MSVC.
>
On Feb 21 12:29:36, [email protected] wrote:
> On Feb 21 20:35:42, [email protected] wrote:
> > IOhannes m zmoelnig wrote:
> >
> > > > https://github.com/erikd/libsndfile/blob/master/configure.ac#L300
> > > >
> > >
> > > hmm, i don't see how applying "s/FLAC$//" to
> > > "-I/usr/local/include/FLAC -I/usr/local/include" will remove the
> > > offending path.
> > > maybe something like an *additional* "s/FLAC / /" will help.
> >
> > The pkg-config Jan showed combined the CFLAGS and LIBS values.
>
> No, it's just CFLAGS:
>
> $ pkg-config --cflags flac
> -I/usr/local/include/FLAC -I/usr/local/include
>
>
> > In the configure script these two are dealt with separately. Check
> > the generated Makefile yourself :-).
> >
> > Erik
> > --
> > ----------------------------------------------------------------------
> > Erik de Castro Lopo
> > http://www.mega-nerd.com/
> > ------------------------------------------------------------
> > libsndfile-devel Mailing List
> > To unsubscribe:
> > <mailto:[email protected]?Subject=unsubscribe>
> >
On Feb 21 12:55:41, [email protected] wrote:
> On Feb 21 21:07:35, [email protected] wrote:
> > Jan Stary wrote:
> >
> > > That's what pkgconfig says:
> > >
> > > $ pkg-config --cflags flac
> > > -I/usr/local/include/FLAC -I/usr/local/include
> >
> > As IOhannes m zmoelnig points out, the pkg-config output doesn't seem
> > correct. There should only be one -I value.
>
> This is how the second '-I/usr/local/include' gets there:
> my installed version of FLAC is the OpenBSD port,
> which patches FLAC's original pc file as follows:
>
> -Libs: -L${libdir} -lFLAC -lm
> -Cflags: -I${includedir}/FLAC
> +Libs: -L${libdir} -lFLAC @OGG_LIBS@ -lm
> +Cflags: -I${includedir}/FLAC @OGG_CFLAGS@
>
> That's because the port is compiled with Ogg support.
>
> sndfile uses the sed hack in its ./configure to get rid
> of the -I.../FLAC (so that it avoids the asssert.h
> conflict). Could this hack please be slightly altered
> so that it strips the "/FLAC" even if it's not at
> the end of the line?
>
> Either that, or lets try again after those years
> to convince the FLAC authors to not have a header
> file named "assert.h", which I agree is the root cause.
>
> Jan
>
On Feb 21 20:41:08, [email protected] wrote:
> On Feb 22 06:26:27, [email protected] wrote:
> > Jan Stary wrote:
> >
> > > sndfile uses the sed hack in its ./configure to get rid
> > > of the -I.../FLAC (so that it avoids the asssert.h
> > > conflict). Could this hack please be slightly altered
> > > so that it strips the "/FLAC" even if it's not at
> > > the end of the line?
> >
> > Done.
>
> Thanks.
>
> > > Either that, or lets try again after those years
> > > to convince the FLAC authors to not have a header
> > > file named "assert.h", which I agree is the root cause.
> >
> > I am the current upstream FLAC maintainer. The next release
> > will still have an assert.h, but the recommended way of
> > including FLAC headers is as:
> >
> > #include <FLAC/header.h>
> >
> > The FLAC pkg-config file will ship with the "/FLAC" component
> > in the -I variable.
>
> _with_? Doesn't it enforce the opposite then?
> (Or did you mean _without_?)
>
> If pkgconfig tells me that the right way to get
> to FLAC's include files is -I/usr/local/include/FLAC,
> and the recommended way to actually include them is
>
> #include <FLAC/header.h>
>
> isn't that contradictory?
>
> Jan