[Orca-users] orca 0.27 make error on Solaris 9

David Michaels dragon at raytheon.com
Tue Aug 31 10:01:51 PDT 2004


Blair Zajac wrote:

> I think what I'll do is something like this:
>
> if test "`echo $variable`" != ""; then
>  do stuff
> fi
>
> since the command line processing code will ignore whitespace.
>
> Can you give this a shot and see if it works?


My main concern with this is that the "do stuff" involved something like 
this:

    for file in $(BIN_TARGETS); do \
        echo $(INSTALL) $$file $(bindir); \
        $(INSTALL) $$file $(bindir); \
    done; \

so, if $(BIN_TARGETS) is only spaces (or empty), then the sh parsing of 
this rule bombs with

    sh: syntax error at line 2: `;' unexpected

Thus, ANY references to $(BIN_TARGETS), at least in conditionals, must 
be replaced with "`echo $BIN_TARGETS`".  This structure works (with or 
without the ()s around BIN_TARGETS, but for consistency's sake, I've 
included the ()'s)

    for file in "`echo $(BIN_TARGETS)`"; do
        echo $(INSTALL) $$file $(bindir);
        $(INSTALL) $$file $(bindir);
    done;

As it happens, the "for" structure doesn't mind if the list is empty 
when using the "`echo $BIN_TARGETS`" method (in which instance, the for 
loop is skipped), but it does mind  if you just use $BIN_TARGETS ('sh' 
complains).  That's surprising -- that's why I had used an EOL marker in 
my fix, which also works:

    for file in $(BIN_TARGETS) EOL; do \
        if [ "$(BIN_TARGETS)" != EOL ]; then \
            echo $(INSTALL) $$file $(bindir); \
            $(INSTALL) $$file $(bindir); \
        fi; \
    done; \

It looks like, on Solaris at least, the EOL logic structure isn't required.

--Dragon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/orca-users/attachments/20040831/47818c78/attachment.html>


More information about the Orca-users mailing list