autoconfig 2.62, config.h, and __EXTENSIONS__
David Reiser
dbreiser at earthlink.net
Tue Jun 10 16:46:00 EDT 2008
autoconfig 2.62 creates a configure file containing a section of about
300 lines that does not appear using autoconfig 2.60. This new section
contains:
{ $as_echo "$as_me:$LINENO: checking whether it is safe to define
__EXTENSIONS__" >&5
$as_echo_n "checking whether it is safe to define __EXTENSIONS__... "
>&6; }
if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
# define __EXTENSIONS__ 1
$ac_includes_default
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_safe_to_define___extensions__=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_safe_to_define___extensions__=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result:
$ac_cv_safe_to_define___extensions__" >&5
$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
test $ac_cv_safe_to_define___extensions__ = yes &&
cat >>confdefs.h <<\_ACEOF
#define __EXTENSIONS__ 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _ALL_SOURCE 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _GNU_SOURCE 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _POSIX_PTHREAD_SEMANTICS 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define _TANDEM_SOURCE 1
_ACEOF
I think this new section is the source of some extra lines in config.h:
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
The definition of __EXTENSIONS__ as 1 instead of blank conflicts with
the #define __EXTENSIONS__ in src/backend/file/sixtp-dom-generators.c
If I'm running with --enable-error-on-warning, the build stops because
__EXTENSIONS__ is being redefined in sixtp-dom-generators.
Shouldn't there be a test or an undef before the #defines in
lib/libqof/qof/gnc-date.c
macros/legacy_macros.m4
src/backend/file/sixtp-dom-generators.c
src/backend/file/sixtp-utils.c
?
The actual error I get is:
gcc -DHAVE_CONFIG_H -I. -I../../.. -DG_LOG_DOMAIN=\"gnc.backend.xml
\" -I/sw/include -I.. -I../.. -DLOCALE_DIR=\"/opt/gnucash-gda/share/
locale\" -I../../../src/backend -I../../../src/engine -I../../../src/
core-utils -I../../../lib/libc -I/sw/include/libxml2 -I../../../lib/
libqof/qof -I../../../lib/libqof/qof -I/sw/include/glib-2.0 -I/sw/lib/
glib-2.0/include -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/
sw/include/orbit-2.0 -I/sw/include/gconf/2 -DORBIT2=1 -Werror -
Wdeclaration-after-statement -Wno-pointer-sign -D_FORTIFY_SOURCE=2 -g -
Wno-unused -MT sixtp-dom-generators.lo -MD -MP -MF .deps/sixtp-dom-
generators.Tpo -c sixtp-dom-generators.c -fno-common -DPIC -o .libs/
sixtp-dom-generators.o
sixtp-dom-generators.c:26:1: error: "__EXTENSIONS__" redefined
In file included from sixtp-dom-generators.c:24:
../../../config.h:337:1: error: this is the location of the previous
definition
make[5]: *** [sixtp-dom-generators.lo] Error 1
Mac OS X 10.5.3, ppc machine
gcc 4.0.1, autoconfig 2.62, m4 1.4.11, automake 1.9.6 or 1.10.1
Dave
--
David Reiser
dbreiser at earthlink.net
More information about the gnucash-devel
mailing list