[Flac-dev] Compile problems on OSX
Josh Coalson
xflac at yahoo.com
Sun Sep 9 11:39:52 PDT 2007
--- Erik de Castro Lopo <erikd-flac at mega-nerd.com> wrote:
> Hi all,
>
> I've got two problems compiling the current CVS FLAC sources on OSX.
>
> Firstly, the configure script can't find the OGG libraries which were
> installed from MacPorts. I have tried:
>
> ./configure --with-ogg-includes=/opt/local/include \
> --with-ogg-lib=/opt/local/lib
>
> but they are still not found. I notice that in configure.in, you use
> a macro called XIPH_PATH_OGG. Is there any reason you don't use the
> PKG_CHECK_MODULES mcaro which uses pkg-config underneath? For my
> system pkg-config does the right thing:
>
> > pkg-config --cflags --libs ogg
> -I/opt/local/include -L/opt/local/lib -logg
>
> I will put together a patch for this is you are interested.
the main reason I haven't swtiched is I'm not up on pkgconfig
and XIPTH_PATH_OGG has been working pretty well... can you tell
why it's not working for you?
I'm always hesitant to mess with things in configure.in because
is such whack-a-mole problem (fixes things for some people and
breaks for others).
> Second problem is that I get a compile error when FLAC__HAS_OGG is 0
> in src/flac/decode.c:
>
> decode.c:393: error: 'options' undeclared (first use in this
> function)
>
> The code in question is this:
>
> #if FLAC__HAS_OGG
> if(decoder_session->is_ogg) {
> /* Some code here. */
> }
> else
> #else
> (void)decode_options;
> #endif
> {
> /* More code. */
> }
yes, this is fixed in cvs. actually I'll probably be doing a
release soon and I'd be interested to know if the latest stuff
works for you.
> The problem here is that conditional compiles can hide bugs. The code
> above
> re-written to turn a conditional compile into an always compiled if
> statement
> which will trigger the error regardless of the value of
> FLAC__HAS_OGG:
>
> if(FLAC__HAS_OGG && decoder_session->is_ogg) {
> /* Some code here. */
> }
> else
> {
> (void)decode_options;
> /* More code. */
> }
interesting idea, hadn't thought of that.
____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
More information about the Flac-dev
mailing list