[Top][All Lists]

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

Re: Warn: non-POSIX variable name

From: Steven Woody
Subject: Re: Warn: non-POSIX variable name
Date: Wed, 20 Aug 2008 09:01:36 +0800

> Hi Steven,
> If I remember correctly a changed value in "-D flag" will not cause
> re-compilation, so if it is important that the version information
> propagates to your binary, it is likely better to generate a header file or
> even a source file than using these CPPFLAGS. I'm doing that in one of my
> projects in which the looks something like this
> @srcdir@/
>   @$(SHELL) @top_srcdir@/build_support/move-if-change
> \
>   @srcdir@/
>   @echo '// generated from' > $@
> ;\
>   revision=`svnversion $(top_srcdir)` ;\
>   $(SED) -e 's/sub_2_svn_revision/'$$revision'/g' \
>   @srcdir@/ >> $@ ;
> endif
> Then I have a that have a string sub_2_svn_revision
> where the revision is intended to be. So when I need `', a
> `' is created from the `' using
> the handy script, svnversion, provided by the svn team. Then the script
> move-if-change replaces `' with `'
> (like mv subversion_info_cc.tmp but it does so only if
> the two files are different. I introduced that "if" in order to avoid
> re-compilation of subversion_info.o when not needed.
> Another thing is that if you plan on distributing your package, you have to
> make sure that it works also when not building from a subversion working
> copy. Either by adding this case in your script `svnrev-sh' or by checking
> it at configure time and add automake conditionals (like I do with
> HAVE_SVN_WC). In any case you probably need to add created source code
> `' to your distribution.  I used `make distcheck' to help
> me get the details right.
> I am not sure exactly what you wanna do, but I hope this will help.

Thank you Peter. I have two more questions:

1, Where and how you set the HAVE_SVN_WC?
2. What's the difference between @varname@ and $(varname) in a I noted you use many @xxxx@


reply via email to

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