autoconf
[Top][All Lists]
Advanced

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

AC_C_BIGENDIAN does not work well with AX_PREFIX_CONFIG_H


From: Roberto Bagnara
Subject: AC_C_BIGENDIAN does not work well with AX_PREFIX_CONFIG_H
Date: Tue, 27 Jan 2009 21:56:51 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050929 Thunderbird/1.0.7 Fedora/1.0.7-1.1.fc4 Mnenhy/0.7.3.0


Hi there,

we have been bitten by the following problem.  Autoconf implements
AC_C_BIGENDIAN so that it defines WORDS_BIGENDIAN this way:

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
#  define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* #  undef WORDS_BIGENDIAN */
# endif
#endif

The spaces between `#' and `define' completely spoil AX_PREFIX_CONFIG_H
(which otherwise works very well on everything else).  Since 'PPL' is our
prefix, we want the symbol PPL_WORDS_BIGENDIAN to be defined (and not
WORDS_BIGENDIAN).

Now, I don't believe this is a bug of AX_PREFIX_CONFIG_H.  In fact we use
that feature: by leaving spaces between the `#' and the macro name we
"protect" some macros from renaming.  And, of course, it is not a bug of
Autoconf, since that spaces are normally immaterial.

Still we have a problem.  And no workaround because the obvious one
does not work (i.e., it does not undefine WORDS_BIGENDIAN):

AH_BOTTOM([
#ifdef WORDS_BIGENDIAN
# define PPL_WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
#endif
])

Perhaps this (commenting out all #undef's) is a limitation of 
AX_PREFIX_CONFIG_H.

Any idea how we could solve this problem?
Thanks,

   Roberto

--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:address@hidden




reply via email to

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