Automake Conditional and ARG_VAR Question

D

David Bond

Hello,
I'm working on a project that we are converting to autotools and I
had
a question. If this is the wrong place to ask these please direct me
to the right location.
Our project has a particle feature with three posible states:
STATIC, DYNAMIC, or NONE
Ideally we would like the build to be like:
../configure STATE=STATIC ; make
What I want this to do is, depending on the configure time STATE
value
giveni, generate a Makefile that executes Make code specific for that
STATE. There should also be a default STATE in case this command line
option not be given. i.e. DYNAMIC. This is what I believe should
accomplish
this:
configure.ac
---------------------------------------
AM_CONDITIONAL([STATE_DYNAMIC],[test x$STATE = xDYNAMIC])
AM_CONDITIONAL([STATE_STATIC],[test x$STATE = xSTATIC])
AC_ARG_VAR([STATE],[The STATE STATIC DYNAMIC or NONE.])
AC_SUBST([STATE],[DYNAMIC])
Makefile.am
----------------------------------------
if STATE_DYNAMIC
... DO SOMETHING ...
else
if STATE_STATIC
... DO SOMETHING ...
endif
endif
.... Etc ...
This is not doing what I expect it to. Any ideas what my
misunderstanding is?
Thanks,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top