Re: Getting srcdir in script executed using m4_esyscmd in AC_INIT

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

 



On Sun, 3 Jan 2021, Zack Weinberg wrote:

The trick here is that these shell commands will be executed when you
run autoconf, *not* when you run configure.  And you have to run
autoconf with the current working directory equal to the top of the
source tree *anyway*.  So the answer is ". will be the top of the
source tree."  This is why automake's rule for regenerating configure
from configure.ac does `cd $(top_srcdir) && $(AUTOCONF)`.

Yes, it seemed like that should be the case. Just before you read your email I realized that the problem was that my script was executed in two different ways, and the older way was executing it (while executing configure) in the current directory.

Autoconf itself does something similar and it works reliably:
(quoting https://git.savannah.gnu.org/cgit/autoconf.git/tree/configure.ac#n22)

AC_INIT([GNU Autoconf],
   m4_esyscmd([build-aux/git-version-gen .tarball-version]),
   [bug-autoconf@xxxxxxx])

I presume this is *not* working reliably for you or you wouldn't have
asked the question, so could you go into a little more detail about
how you invoked autoconf and/or configure and what went wrong?

The above is what I was using as an example. :-)

GraphicsMagick needs to substitute quite a lot more version info so I was also doing this in the body of configure.ac:

# Source file containing package/library versioning information.
. ${srcdir}/version.sh

What I did was to make the same script accept arguments. Sourcing the script is ok but not if it does not compute the same values.

Thank you for your help.

Bob
--
Bob Friesenhahn
bfriesen@xxxxxxxxxxxxxxxxxxx, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux