autoconf
[Top][All Lists]
Advanced

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

Re: Autoreconf stops with "non-POSIX variable name"


From: Peter Johansson
Subject: Re: Autoreconf stops with "non-POSIX variable name"
Date: Sat, 30 Mar 2013 13:53:57 +1000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

On 3/30/13 7:17 AM, oborchert wrote:
Hi,
I created a Makefile.in where I read the content out of a file and pass it
to CFLAGS. Calling ./configure ... the Makefile will be generated an all
works well.

Makefile.in:
...
MY_REVISION_FILE=my-revision.txt
MY_REVISION=$(shell cat $(top_srcdir)/$(MY_REVISION_FILE))
AM_CFLAGS = -I$(EXTRAS_INCLUDE_DIR) -I$(top_srcdir)
-DMY_REVISION=$(MY_REVISION)
...
Rather than carry this information via cmdline, I store create a header file that I can include when needed. In that way dependencies become correct too. I have the following rule in my Makefile.am:

BUILT_SOURCES += $(builddir)/svn_revision.h
$(builddir)/svn_revision.h: $(srcdir)/svn_revision.h.in $(srcdir)/.revision
    $(AM_V_at)revision=$$(cat $(srcdir)/.revision) \
&& sed "s|@SVN_REVISION@|$$revision|g" < $(srcdir)/svn_revision.h.in \
> address@hidden && mv address@hidden $@

and then my svn_revision.h.in looks like

#ifndef SVN_REVISION
#define SVN_REVISION "@SVN_REVISION@"
#endif


Cheers,
Peter


--
Peter Johansson




reply via email to

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