[vorbis-dev] ao/
Jeff Squyres
jsquyres at lsc.nd.edu
Sat Sep 30 20:34:16 PDT 2000
On Sat, 30 Sep 2000, Ralph Giles wrote:
> Ok, here's a work around. This replaces my previous patch, but you still
> need to add the new files from the tarball.
>
> Basically, we include *all* the drivers on the _SOURCES line, and #ifdef
> their entire contents. Gross, but supported.
>
> I sent a note to the automake maintainer; will forward any info I get...
automake can be your friend (in a bully-on-the-playground sort of way, the
one who always took your lunch money). You just have to figure out all
its tricks and weird things. Try running "make tags" or "make depend" in
directories where you have no .h or .c files. Ugh!!
I ran into similar issues with automake (i.e., needing to conditionally
compile only some .o files), and figured a way to do it. You have to use
automake's conditionals. For example, in Makefile.am:
-----
if WANT_FOO_O
foo_name = foo.c
else
foo_name =
endif
# ....
foo_la_SOURCES = $(foo_name) bar.o baz.o yow.o
-----
Even though this doesn't really apply here, for your automake edification,
this also works with the conditional compilation of libraries themselves.
For example:
-----
if WANT_LIBFOO_A
library_name = libfoo.la
else
library_name =
endif
lib_LTLIBRARIES = $(libary_name)
-----
It's weird, but it works. Seems a bit more elegant that putting big #if
(or #ifdef) around an entire file, and prevents compiler warnings about
"empty translation unit" when if effectively preprocess an entire file
away.
In configure.in, you have to define the conditional WANT_FOO_O (or
WANT_LIBFOO_A), something like:
-----
# ... set shell variable $use_foo_c to "yes" or not
AM_CONDITIONAL(WANT_FOO_O, test "$use_foo_c" = "yes")
-----
Yes -- this is weird syntax. The second arg to AM_CONDITIONAL is shell
code that evaluates to true or false.
This should do what you need.
{+} 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"
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list