automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Automake Conditional and ARG_VAR Question


From: David Bond
Subject: Automake Conditional and ARG_VAR Question
Date: Tue, 27 Apr 2010 13:54:02 -0400 (EDT)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

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? Also, what is the reason for appending an x in front of test varibles. I saw that in the make manual along with several examples.

Thanks,
David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]