Discussion:
Functions used by init before defined
jeremy
2013-04-08 23:06:10 UTC
Permalink
Hi,

I'm having a strange issue with Autoconf which involves a few built-in
functions. They are not being found. Basically, if I run autoconf on my
configure.in it complains about that as_fn_set_status and as_fn_exit are not
being defined. Looking in the generated configure script, indeed these are
used at the top but defined at the bottom. They are used very early in the
script, apparently by the call to AC_INIT. So my (very hacky) solution is
simply inserting these two functions at the top of the script, and then the
script runs fine. Now, on the other hand, I have another configure.in
script that seems to work fine with the same Autoconf version, so I am a bit
confused.

It was also somewhat confusing that copying these methods and putting them
at the top of my configure.in script did not seem to do anything as they are
apparently ignored and defined in the same place in the output regardless.

So, I guess my questions are:

What are the possible causes of this misordering?

Is it my fault or Autoconf's?

What is the best way to make sure this doesn't happen?

My Autoconf is 2.69 with m4 1.4.16 and automake 1.12.6, which I think are
all the most current versions.

Thanks.

--Jeremy




--
View this message in context: http://gnu-autoconf.7623.n7.nabble.com/Functions-used-by-init-before-defined-tp18660.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.
Eric Blake
2013-04-09 01:21:29 UTC
Permalink
Post by jeremy
Hi,
I'm having a strange issue with Autoconf which involves a few built-in
functions. They are not being found. Basically, if I run autoconf on my
configure.in it complains about that as_fn_set_status and as_fn_exit are not
The file name configure.in is deprecated; hence I'm referring to
configure.ac.
Post by jeremy
being defined. Looking in the generated configure script, indeed these are
used at the top but defined at the bottom. They are used very early in the
script, apparently by the call to AC_INIT. So my (very hacky) solution is
simply inserting these two functions at the top of the script, and then the
script runs fine. Now, on the other hand, I have another configure.in
script that seems to work fine with the same Autoconf version, so I am a bit
confused.
I'd have to see the two configure.ac scripts to compare them, before I
could say whether it is a usage error on your part or a bug in autoconf
itself. Can you post them? I suspect that you have something going on
with diversions that ends up causing things to be placed in the wrong
diversion, at which point the resulting configure file appears out of
order with a use of the function in one diversion before the definition
of the function in another diversion.
Post by jeremy
It was also somewhat confusing that copying these methods and putting them
at the top of my configure.in script did not seem to do anything as they are
apparently ignored and defined in the same place in the output regardless.
In autoconf, AC_INIT has to come first. Anything appearing before
AC_INIT is treated as going to diversion -1; so while it might affect m4
definitions, it is not carried through to the resulting configure file.
That would explain why pasting the functions in your configure.ac
earlier than AC_INIT didn't make a difference.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
jeremy
2013-04-09 17:39:08 UTC
Permalink
Hi, Eric.

I am not sure about pasting in my configure.ac as my usage of Autoconf is a
bit "wild." I do suspect that something changed within Autoconf itself, as
my scripts worked fine with 2.53 but the problems started occurring after I
upgraded to 2.69 which is the latest. I use a lot of includes via
aclocal.m4 to pull in macros that I define. Could this have anything to do
with it?

In the meantime, I'll work on trying to get the smallest possible example
that shows this problem. You really don't want to look at my full script.

--Jeremy


On Mon, Apr 8, 2013 at 6:21 PM, Eric Blake-3 [via Gnu - Autoconf] <
Post by jeremy
Post by jeremy
Hi,
I'm having a strange issue with Autoconf which involves a few built-in
functions. They are not being found. Basically, if I run autoconf on
my
Post by jeremy
configure.in it complains about that as_fn_set_status and as_fn_exit
are not
The file name configure.in is deprecated; hence I'm referring to
configure.ac.
Post by jeremy
being defined. Looking in the generated configure script, indeed these
are
Post by jeremy
used at the top but defined at the bottom. They are used very early in
the
Post by jeremy
script, apparently by the call to AC_INIT. So my (very hacky) solution
is
Post by jeremy
simply inserting these two functions at the top of the script, and then
the
Post by jeremy
script runs fine. Now, on the other hand, I have another configure.in
script that seems to work fine with the same Autoconf version, so I am a
bit
Post by jeremy
confused.
I'd have to see the two configure.ac scripts to compare them, before I
could say whether it is a usage error on your part or a bug in autoconf
itself. Can you post them? I suspect that you have something going on
with diversions that ends up causing things to be placed in the wrong
diversion, at which point the resulting configure file appears out of
order with a use of the function in one diversion before the definition
of the function in another diversion.
Post by jeremy
It was also somewhat confusing that copying these methods and putting
them
Post by jeremy
at the top of my configure.in script did not seem to do anything as
they are
Post by jeremy
apparently ignored and defined in the same place in the output
regardless.
In autoconf, AC_INIT has to come first. Anything appearing before
AC_INIT is treated as going to diversion -1; so while it might affect m4
definitions, it is not carried through to the resulting configure file.
That would explain why pasting the functions in your configure.ac
earlier than AC_INIT didn't make a difference.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
_______________________________________________
Autoconf mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=18661&i=0>
https://lists.gnu.org/mailman/listinfo/autoconf
*signature.asc* (634 bytes) Download Attachment<http://gnu-autoconf.7623.n7.nabble.com/attachment/18661/0/signature.asc>
------------------------------
If you reply to this email, your message will be added to the discussion
http://gnu-autoconf.7623.n7.nabble.com/Functions-used-by-init-before-defined-tp18660p18661.html
To unsubscribe from Functions used by init before defined, click here<http://gnu-autoconf.7623.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=18660&code=amVybWNjb3JtaWNrQGdtYWlsLmNvbXwxODY2MHwyNjU0OTcyOTQ=>
.
NAML<http://gnu-autoconf.7623.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
View this message in context: http://gnu-autoconf.7623.n7.nabble.com/Functions-used-by-init-before-defined-tp18660p18662.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.
Loading...