[Top][All Lists]

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

AC_TRY_RUN and exit status

From: Evgeny Stambulchik
Subject: AC_TRY_RUN and exit status
Date: Sun, 22 Jul 2001 13:58:26 +0300 (IDT)


In the autoconf's info page one reads:

     PROGRAM is the text of a C program, on which shell variable and
     back quote substitutions are performed.  If it compiles and links
     successfully and returns an exit status of 0 when executed, run
     shell commands ACTION-IF-TRUE.  Otherwise, run shell commands
     ACTION-IF-FALSE; the exit status of the program is available in
     the shell variable `$?'. [...]

However, in practice, the exit status in the case of a failure is NEVER
preserved, since it's overridden by auxiliary shell commands run by 'configure'
_prior_ to calling ACTION-IF-FALSE.

A patch against autoconf-2.52 is attached:

--- acgeneral.m4.orig   Sun Jul 22 12:57:45 2001
+++ acgeneral.m4        Sun Jul 22 13:14:12 2001
@@ -2814,10 +2814,10 @@
 rm -f conftest$ac_exeext
 AS_IF([AC_TRY_EVAL(ac_link) && AC_TRY_COMMAND(./conftest$ac_exeext)],
-      [echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
+      [m4_ifvaln([$3], [$3]) dnl
+echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
 echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
-cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-m4_ifvaln([$3], [$3])dnl])[]dnl
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD])[]dnl
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext m4_ifval([$1],

In general, though, I'd like to see an extra optional action,
ACTION-IF-NOT-COMPILED, to differentiate between this case and a non-zero exit
status of the program.



PS. The bug (and a patch) have been there for years (e.g. Any chance it will
be fixed in the current century?

reply via email to

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