Re: [Flac-dev] Compile problems on OSX

2007-09-10 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote:

> I'll look into that over the next day or so. The pkg-config method
> has the advantage of being highly robust, but is a pain for MinGW
> because you need pkg-config.

I just tested this:

./configure --with-ogg=/opt/local

and so does:

./configure --with-ogg-libraries=/opt/local/lib \
   --with-ogg-includes=/opt/local/include

Not sure why it failed last time.

Erik
-- 
-
Erik de Castro Lopo
-
"I run Linux on pretty much everything except the microwave and
washing machine. Those are tempting targets but would probably
make Telsa extremely cross." -- Alan Cox
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Compile problems on OSX

2007-09-09 Thread Josh Coalson
--- Erik de Castro Lopo <[EMAIL PROTECTED]> wrote:
> Sorry, I just updated from CVS and its still broken. If FLAC__HAS_OGG
> is false it tries to compile this:
> 
>  (void)decode_options;
> 
> and there is no "decode_options" identifier.

oops, fixed.


   

Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Compile problems on OSX

2007-09-09 Thread Erik de Castro Lopo
Josh Coalson wrote:

> 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).

I'll look into that over the next day or so. The pkg-config method
has the advantage of being highly robust, but is a pain for MinGW
because you need pkg-config.

> > 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.

Sorry, I just updated from CVS and its still broken. If FLAC__HAS_OGG
is false it tries to compile this:

 (void)decode_options;

and there is no "decode_options" identifier.

Maybe this is the delay between your CVS commit and the public CVS 
being updated.

> interesting idea, hadn't thought of that.

Please take a look at this. Doing it this way means that both code
paths are checked by the semantic analysis stage of the compiler
regardless of value of FLAC__HAS_OGG. It prevents conditional compile
constructs from hiding really blatantly obvious errors like this one.

Erik
-- 
-
Erik de Castro Lopo
-
"Whenever the C++ language designers had two competing ideas as to
how they should solve some problem, they said, "OK, we'll do them
both". So the language is too baroque for my taste." -- Donald E Knuth
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Compile problems on OSX

2007-09-09 Thread Josh Coalson
--- Erik de Castro Lopo <[EMAIL PROTECTED]> 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
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev