More undefined behaviour in build system



>>>>> "Rupert" == Rupert Swarbrick <rswarbrick at gmail.com> writes:

    >>> Thank you for finally telling us what your toolchain is.
    >>> 
    >>> Are you saying that the build fails on NetBSD because of calling out to
    >>> "echo" or are you saying that, while the build works, the Posix
    >>> specifications say that calling echo like this invokes undefined
    >>> behaviour?
    >> 
    >> You're confused. These keywords are generated automatically, they are
    >> always $NetBSD$ for me, even when I work on FreeBSD, Solaris, or Linux.

    Rupert> Oh right, the mystery continues. Maybe you'd be willing to enlighten us
    Rupert> further?

    >>> Is it just that I can't assume that echo does what I expect? Or
    >>> something about the globbing? (But presumably then your fix wouldn't
    >>> work either) Or is it something about expanding the results of shell
    >>> functions in a Makefile?  I don't have any experience of other Make
    >>> implementations, but I'm really confused about how one could possibly
    >>> behave differently from what I expected here.
    >> 
    >> POSIX says that the value of $(<string>) where the string contains spaces
    >> is undefined, which is precisely what we observe.

    Rupert> Ah, ok. So $(shell my-command) will never work on the Make you use? When
    Rupert> you say "POSIX says", I guess I should be able to find what you describe
    Rupert> somewhere in this file?

I confess I didn't understand the stuff about NetBSD. But I do know that
traditional make doesn't have $(shell command) or any of the fancy
functions that GNU make has.

    Rupert>   http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html

    Rupert> I'm struggling, but as far as I can tell, the POSIX standard doesn't
    Rupert> include any utility functions in Make. I'm not convinced that sawing off
    Rupert> all the useful features of GNU Make is a great idea for us.

    Rupert> Frankly, I am no longer interested in thinking about an unbounded number
    Rupert> of convoluted work-arounds to make the build work with an unspecified
    Rupert> tool on an unspecified platform. If you want to convince someone else to
    Rupert> take the patches, that's fine, but I'm probably going to ignore further
    Rupert> messages from you unless you tell us more about what you're trying to
    Rupert> do. Or you could install GNU Make? I hear it's rather portable.

While I strive to be portable in my makefiles and scripts, I've pretty
much given up and install GNU make everywhere I need it. It's not
hard, even if you don't have any kind of make around.

Ray