XCode 3.0 sys/types.h breaks AC_CACHE_CHECK for ac_cv_have_intxx_t

2007-11-22 Thread Brian A. Seklecki (Mobile)
Apple et all:

There is a 200+ line unified diff between sys/types.h in XCode 2.5 and
XCode 3.0, but no version information?

# diff -u /tmp/types.h  /usr/include/sys/types.h | wc -l
 217

# ident /usr/include/sys/types.h 
  /usr/include/sys/types.h:
  ident warning: no id keywords in /usr/include/sys/types.h

Anyway, it breaks basic GNU Autoconf macro checks (I found it trying to
build Bacula w/ XCode 3.0 and OS/X 10.5.1).  See the error below.

The duplicate definitions are in: sys/stat.h and sys/types.h and
sys/dirent.h:

/*
#ifndef _INO_T
typedef __darwin_ino_t  ino_t;  */ /* inode number */ /*
#define _INO_T
#endif
*/

Lines 135 and lines 100:
/* typedef  int32_t   daddr_t;/* /* disk address */

-

| #define HAVE_INTMAX_T 1
| /* end confdefs.h.  */
|  #include stdint.h
| int
| main ()
| {
|  u_intmax_t a; a = 1;
|   ;
|   return 0;
| }
configure:25826: result: no
configure:25837: checking for intXX_t types
configure:25859: gcc -c -pipe -O2 -I/usr/include -D_REENTRANT
-no-cpp-precomp -I/usr/include -D_REENTRANT conftest.c 
5
In file included from conftest.c:84:
/usr/include/sys/types.h:100: error: two or more data types in
declaration specifiers
/usr/include/sys/types.h:135: error: two or more data types in
declaration specifiers
/usr/include/sys/types.h:135: error: two or more data types in
declaration specifiers
configure:25865: $? = 1
configure: failed program was:
| /* confdefs.h.  */


1588 
1589 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1590AC_TRY_COMPILE(
1591   [ #include sys/types.h ],
1592   [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1593   [ ac_cv_have_intxx_t=yes ],
1594   [ ac_cv_have_intxx_t=no ]
1595)
1596 ])
1597 if test x$ac_cv_have_intxx_t = xyes ; then
1598AC_DEFINE(HAVE_INTXX_T)
1599have_intxx_t=1
1600 fi
1601 



___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf


Re: XCode 3.0 sys/types.h breaks AC_CACHE_CHECK for ac_cv_have_intxx_t

2007-11-22 Thread Peter O'Gorman


On 22-Nov-07, at 10:42 PM, Brian A. Seklecki (Mobile) wrote:


Apple et all:

There is a 200+ line unified diff between sys/types.h in XCode 2.5 and
XCode 3.0, but no version information?

# diff -u /tmp/types.h  /usr/include/sys/types.h | wc -l
217

# ident /usr/include/sys/types.h
 /usr/include/sys/types.h:
 ident warning: no id keywords in /usr/include/sys/types.h

Anyway, it breaks basic GNU Autoconf macro checks (I found it trying  
to

build Bacula w/ XCode 3.0 and OS/X 10.5.1).  See the error below.

The duplicate definitions are in: sys/stat.h and sys/types.h and
sys/dirent.h:


Hi Brian,

Since I am subscribed to both lists, I guess I had better reply :-)

You cut:
| #define daddr_t long

From what you pasted from config.log, this is pretty much bound to  
cause issues when including sys/types.h.


When it checks for daddr_t, it does so in a test that does:
| #if HAVE_SYS_TYPES_H
| # include sys/types.h
| #endif

But has not defined 'HAVE_SYS_TYPES_H', because the configure script  
has not yet checked for it.


This is a bug in the bacula configure script, it should do header  
checks before it does type checks, it is neither an autoconf not an  
Xcode bug. If you move the header checks to just after the compiler  
check, rerun autoconf, and configure again, you should have better  
results.


Thanks,
Peter
--
Peter O'Gorman
http://pogma.com




___
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf