Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:3304] RE: load_opcodes.c

Date2003-11-06 21:18
From"gogins@pipeline.com"
Subject[CSOUND-DEV:3304] RE: load_opcodes.c
OK, I think I get it - a switch statement in the configure.ac file selects
source files (i.e. defines macros for sources) based on $host, and $host is
defined by configure, right?

The rest of this stuff I knew.

Thanks!

Original Message:
-----------------
From:  ramsdell@mitre.org (John D. Ramsdell)
Date: 06 Nov 2003 15:13:57 -0500
To: csound-dev@eartha.mills.edu
Subject: [CSOUND-DEV:3303] RE: load_opcodes.c


"Michael Gogins"  writes:

> A hint about how to handle the "heavy lifting" in the configure.ac
> would be most appreciated.

I think John ffitch has already done the "heavy lifting".  His
configure.in file contains a big case dispatch based on the value of
the variable $host.  It starts with "case $host in".  In the cases, he
sets various variable of the form: RTAUTDIO_*.  Later, he uses them to
set AUD* variables, and finally, makes them available to you with:

AC_SUBST(AUDOBJ)
AC_SUBST(AUDSRC)
AC_SUBST(AUDHDR)
AC_SUBST(AUDLIBS)

When using automake, you must remember to be sure that all the right
files are included in a distribution.  This is done by mentioning all
the source files that may be left out of a specific configuration in
the value of EXTRA_DIST, or something like that.  If you search for
EXTRA_DIST in the automake documentation, I'm sure you'll find the
section that describes what to do when some files are not used by some
configurations.

In summary you do something like:

lib_LIBRARIES = libcsound.a
noinst_PROGRAMS = makedb
pkgdata_DATA = csound.xmg

libcsound_a_SOURCES = .... $(AUDSRC) $(AUDHDR)

EXTRA_libcsound_a_SOURCES = $(ALL_AUDSRC) $(ALL_AUDHDR)

makedb_SOURCES = makedb.c text.h

EXTRA_makedb_SOURCES = all_strings english-strings french-strings

csound.xmg:	english-strings makedb
	./makedb $(srcdir)/english-strings English
	mv English.xmg csound.xmg

John


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

Date2003-11-06 22:12
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3305] RE: load_opcodes.c
"gogins@pipeline.com"  writes:

> OK, I think I get it - a switch statement in the configure.ac file
> selects source files (i.e. defines macros for sources) based on
> $host, and $host is defined by configure, right?

Yes, you get $host with AC_CONFIGURE_HOST or AC_CONFIGURE_TARGET or
something like that.  Just search for $host in the autoconf info node,
or look at the configure.in in the csound5 module.  It must have it
right.  Also, it is a good idea to rename configure.in to
configure.ac, as it is not really a .in file.  Good call.

John