autoconf
[Top][All Lists]
Advanced

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

Re: _AC_PROG_CXX_EXIT_DECLARATION: don't `#include <stdlib.h>'


From: David Thompson
Subject: Re: _AC_PROG_CXX_EXIT_DECLARATION: don't `#include <stdlib.h>'
Date: Wed, 23 Nov 2005 16:05:43 -0700

Looking into this further. Here is the problem I'm seeing. (Autoconf 2.5.9 on cygwin).

The function is defined as:

m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
[for ac_declaration in \
   '' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration
@%:@include <stdlib.h>],
                                      [exit (42);])],
                     [],
                     [continue])
  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
                                      [exit (42);])],
                     [break])
done
rm -f conftest*
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi
])# _AC_PROG_CXX_EXIT_DECLARATION


But it appears that the #include <stdlib.h> is not used when ac_declaration is set to ''. I don't quite understand the syntax

$ac_declaration
@%:@include <stdlib.h>

Here is my output from the configure run: as you can see the include is listed for the second option just not the first. Why? Shouldn't the first option for ac_declaration produce just the #include <stdlib.h>?

David

----------------------


configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "dx"
| #define PACKAGE_TARNAME "dx"
| #define PACKAGE_VERSION "4.3.3"
| #define PACKAGE_STRING "dx 4.3.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "dx"
| #define VERSION "4.3.3"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
| exit (42);
|   ;
|   return 0;
| }


configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "dx"
| #define PACKAGE_TARNAME "dx"
| #define PACKAGE_VERSION "4.3.3"
| #define PACKAGE_STRING "dx 4.3.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "dx"
| #define VERSION "4.3.3"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| /* end confdefs.h.  */
| extern "C" void std::exit (int) throw (); using std::exit;
| #include <stdlib.h>
| int
| main ()
| {
| exit (42);
|   ;
|   return 0;
| }
--
.............................................................................
David L. Thompson                   Visualization and Imagery Solutions, Inc.
mailto:address@hidden    5515 Skyway Drive, Missoula, MT 59804
                                    Phone : (406)756-7472




reply via email to

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