[vorbis-dev] Build woes at CVS head

Jeff Squyres jsquyres at lsc.nd.edu
Fri Nov 10 07:23:39 PST 2000


Greetings.

I just updated my cvs copy of everything (ao, ogg, vorbis, vorbis-plugins,
vorbis-tools), and tried to build with the Sun Solaris Forte 6 compilers
under Solaris 7.  I had a few problems.

ao
==

- None of the Makefile.am's include "no-dependencies" in the
AUTOMAKE_OPTIONS lines.  This generates not only GNU make-specific
Makefile extensions, it also uses some gcc/g++-specific options to the
compiler.  Hence, if you're not building with gmake/gcc (which I'm not --
gcc usually doesn't give nearly as good performance as native compilers),
the compile barfs.  Here's all the Makefile.am's that need
"no-dependencies":

ao/src/Makefile.am
ao/src/plugins/esd/Makefile.am
ao/src/plugins/alsa/Makefile.am
ao/src/plugins/oss/Makefile.am

---> Solution: place "no-dependencies" in the AUTOMAKE_OPTIONS lines.
For dependencies generation, I can provide a script (an icky solution, I
know, but it's portable, whereas the automake docs even acknowledge that
their solution is not) that does the Right Things for "make depend".  We
use it in the LAM/MPI project, and it seems to be portable.

- line 105 of ao/src/audio_out.c reads:

        char fullpath[NAME_MAX];

However, "grep NAME_MAX *; grep NAME_MAX */*; ...etc" fails to turn up a
definition of NAME_MAX.  It seems that this is not defined anywhere in the
ao module (nor under /usr/include or the compiler's other include paths).
I'm guessing that this is a constant that is globally defined in linux...?

--> Solution: Use FILENAME_MAX instead of NAME_MAX.  This seems to be more
    portable -- it's in <stdio.h>.

- Lines 284 and 307 of ao/src/audio_out.c contain C++ comments, which
make some compilers choke (e.g., sun Forte 6).  Although C++-style
comments are now part of the C standard, it will take a while for
vendors to catch up.  To be as portable as possible, C++ style
comments should not be used in C code for a while yet.  The same thing
also happens on ao/src/ao_wav.c lines 147, 181.

--> Solution: change (ao/src/audio_out.c:284,307) and
    (ao/src/ao_wav.c:147,181) to use C-style comments.

ogg
===

- Same issue with Makefile.am / "no-dependencies":

ogg/src/Makefile.am

--> Solution: Same as above; add "no-dependencies" to
    AUTOMAKE_OPTIONS.

- I get an error about how "conftest.c is not executable" when
checking for memory.h in configure.  This seems to be because $CPP is
not defined in configure yet -- it seems that AC_PROG_CPP was not
invoked before AC_CHECK_HEADER.

--> Solution: put AC_PROG_CPP right after AC_PROG_CC, on line 32 of
    configure.in.

vorbis
======

- I get error in configure about "test: argument expected" after the
pthread_create test.  Line 154 reads:

if test -n $with_ogg; then

--> Solution: I think we need extra quotes there:

if test -n "$with_ogg"; then

Granted, you get the error "You must have libogg to compile vorbis!!"
if you don't specify --with-ogg, but you should get that error, not
"test: argument expected".

- Same issue with Makefile.am / "no-dependencies":

vorbis/examples/Makefile.am

--> Solution: Same as above; add "no-dependencies" to
    AUTOMAKE_OPTIONS.

vorbis-tools
============

- Same issue with Makefile.am / "no-dependencies":

vorbis-tools/oggencc/Makefile.am
vorbis-tools/vorbiscomment/Makefile.am
vorbis-tools/ogg123/Makefile.am

--> Solution: Same as above; add "no-dependencies" to
    AUTOMAKE_OPTIONS.

- vorbis-tools/vorbiscomment/vorbiscomment.c line 208 has a C++ style
comment.

--> Solution change vorbis-tools/vorbiscomment/vorbiscomment.c:208 to
    be:

            /*vorbis_analysis_init(&vd,&vi);*/

- vorbis-tools/ogg123/ogg123.c line 37 includes <getopt.h>.  This
appears to be a GNU extension, and is not portable, as not all
operating systems have it.  Indeed, the usage of "struct option" (line
83 and throughout the rest of the file) does not appear to be portable
because Solaris 2.7 and Irix 6.5 (at least) do not appear to have it.
Hence, my compilation chokes not only upon not finding <getopt.h>, but
also upon trying to use "struct option", and all the other stuff later
in the file.

--> Solution: switch to the more portable getopt(3) instead of
    getopt_long(3), or manually roll the short/long option stuff (perhaps
    steal from gcc's getopt_long...?  Since all of ogg/vorbis is GPL, this
    shouldn't be a problem).

- vorbis-tools/vorbiscomment/Makefile.am adds the ogg and vorbis
libraries in the vorbiscomment_LDFLAGS macro.  This is incorrect, as
it places the various -L and -l flags *before* vorbiscomment.o on the
linker line, resulting in unsatisfied symbols at link time.

--> Solution: Instead, @OGG_LIBS@ and @VORBIS_LIBS@ should be placed
    in vorbiscomment_LDADD, which places them *after* vorbiscomment.o on
    the linker command line.

- Since vorbis uses ogg (and not the other way around), it needs to be
placed to the left of the vorbis LD flags so that it is linked first
(recall that linking is usually done on a left-to-right basis on the
command line).  They are currently listed backwards in the
vorbis-tools/vorbiscomment/Makefile.am file.

--> Solution: the vorbiscoment_LDADD line should be:

vorbiscomment_LDADD = @VORBIS_LIBS@ @OGG_LIBS@

- I might be missing something here (it's late), but when compiling
vorbis-tools/oggenc/encode.c, I get a "<vorbis/vorbisenc.h> file not
found" error.  I checked all the modules in the repository (with find) and
didn't find anything that had "vorbisenc" in the name.  Indeed, the vorbis
module's README file says that it makes "libvorbisenc", but
vorbis/*/Makefile.am don't seem to do anything about this
(vorbis/lib/Makefile.am only has stuff for libvorbis and libvorbisfile).
Perhaps this is an uncommitted change, or it's on a branch or something?
I'm using the current CVS head (Nov 10, 2000, around 9am) -- just did
another "cvs update" (my .cvsrc automatically adds -d), and nothing
appears to be new.

--> Solution: commit the vorbisenc stuff, or let me know the right
    branch to use.

-------

I hope that these are helpful.  Please let me know if there are any
questions.  I have attached a cvs diff of all my files that include
all the changes that I discuss above (and potentially any filenames
that I forgot to mention -- it has everything in it).

{+} Jeff Squyres
{+} squyres at cse.nd.edu
{+} Perpetual Obsessive Notre Dame Student Craving Utter Madness
{+} "I came to ND for 4 years and ended up staying for a decade"


<HR NOSHADE>
<UL>
<LI>TEXT/PLAIN attachment: diff.out
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.out
Type: application/octet-stream
Size: 5955 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20001110/25638341/diff-0001.obj


More information about the Vorbis-dev mailing list