autoconf
[Top][All Lists]
Advanced

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

Re: Condition evaluation removed


From: Giles Anderson
Subject: Re: Condition evaluation removed
Date: Thu, 18 Sep 2008 15:20:54 +0100

Ralf

I wanted to leave it blank if the hosts were different.

So I used the basis of your last suggestion like:

REQUIRE_SCHED_VARS="ORAENV_ASK=NO;ORACLE_SID=VMD1;export ORAENV_ASK
ORACLE_SID;address@hidden@;. oraenv"

Not very pretty but I am restricted to autoconf 2.57 so had to set it up
like that.

And then dropped @REQUIRE_SCHED_VARS@ into my '.in' file

Much appreciated, thanks
Giles


2008/9/11 Ralf Wildenhues <address@hidden>

> Hello Giles,
>
> * Giles Anderson wrote on Thu, Sep 11, 2008 at 05:45:38PM CEST:
> > Is there a way to populate the file output from my '.in' file with only
> the
> > result of a condition evaluation not the condition itself?
>
> Yes.
>
> > So my dev.ini.in file looks like:
> >
> > ============
> > export address@hidden@
> >
> > if [ $(hostname|cut -d. -f1) = "$(echo ${SCHED_HOST} |cut -d. -f1)" ]
> > then
> >    export ORAENV_ASK=NO
> >    export ORACLE_SID=SID1
> >    source oraenv
> > fi
>
> > And I would like the resulting dev.ini to look like this if the above is
> > true:
> >
> > export ORAENV_ASK=NO
> > export ORACLE_SID=SID1
> > source oraenv
>
> What would you like it to contain if the above is not true?  If
> ORAENV_ASK is YES in that case, for example, you can put
>  export address@hidden@
>
> in the .in file and set $ORAENV_ASK in configure.ac, and AC_SUBST it.
> If you would like the file to be completely empty, then you can use
> something like
>  @SET_ORAENV_ASK@
>
> and use something like AC_SUBST([SET_ORAENV_ASK], [export ORAENV_ASK=NO])
> in configure.ac.  Autoconf versions 2.62 and newer also allow to
> substitute multiline values, so you can also do something like
>  SET_AND_SOURCE_ORAENV="\
>     export ORAENV_ASK=NO
>    export ORACLE_SID=SID1
>    source oraenv"
>   AC_SUBST([SET_AND_SOURCE_ORAENV])
>
> and put @SET_AND_SOURCE_ORAENV@ in your .in file.
>
> Cheers,
> Ralf
>


reply via email to

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