autoconf
[Top][All Lists]
Advanced

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

Re: Getting srcdir in script executed using m4_esyscmd in AC_INIT


From: Bob Friesenhahn
Subject: Re: Getting srcdir in script executed using m4_esyscmd in AC_INIT
Date: Sun, 3 Jan 2021 18:55:24 -0600 (CST)
User-agent: Alpine 2.20 (GSO 67 2015-01-07)

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@gnu.org])

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@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt



reply via email to

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