Hi folks,
recompiling from cvs with Solaris.Next (uname -r gives 5.10)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
$ diff -u configure configure.broken
--- configure Sun Jan 11 15:54:20 2004
+++ configure.broken Sun Jan 11 15:56:38 2004
@@ -2515,13 +2515,13 @@
}
if test "$os_release" -ge 505; then
-# { test "$extra_verbose" = "yes" && cat << \EOF
-# Defining _XOPEN_SOURCE = 500
-#EOF
-#cat >> confdefs.h <<\EOF
-##define _XOPEN_SOURCE 500
-#EOF
-#}
+ { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining _XOPEN_SOURCE = 500
+EOF
+cat >> confdefs.h <<\EOF
+#define _XOPEN_SOURCE 500
+EOF
+}
{ test "$extra_verbose" = "yes" && cat << \EOF
Defining _XOPEN_SOURCE_EXTENDED
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if you leave _XOPEN_SOURCE defined then you'll hit this error
from the preprocessor:
checking whether byte ordering is bigendian... no
checking size of short... 0
Defining SIZEOF_SHORT = 0
*** PANIC *** Configure tests are not working - compiler is broken.
*** PANIC *** Please examine config.log for compilation errors.
.......
config.log shows
configure:4649: checking size of short
configure:4663: /opt/SUNWspro/bin/cc -I/usr/sfw/include
-I/usr/local/include -xO3 -v -o conftest -v -xO4 -L/usr/sfw/lib
-L/usr/local/lib -L/usr/ccs/lib
-R/usr/sfw/lib:/opt/csw/lib:/opt/local/lib:/opt/sfw/lib:/usr/local/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib
conftest.c -lsocket -lnsl -lelf -lgen -ldl 1>&5
"/usr/include/sys/feature_tests.h", line 263: #error: "Compiler or
options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX
applications"
cc: acomp failed for conftest.c
configure: failed program was:
#line 4652 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
{
FILE *f=fopen("conftestval", "w");
if (!f) return(1);
fprintf(f, "%d\n", sizeof(short));
return(0);
}
/usr/include/sys/feature_tests.h:
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SMI */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ifndef _SYS_FEATURE_TESTS_H
#define _SYS_FEATURE_TESTS_H
#pragma ident "@(#)feature_tests.h 1.19 03/09/11 SMI"
#include <sys/isa_defs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Large file interfaces:
*
* _LARGEFILE_SOURCE
* 1 large file-related additions to POSIX
* interfaces requested (fseeko, etc.)
* _LARGEFILE64_SOURCE
* 1 transitional large-file-related interfaces
* requested (seek64, stat64, etc.)
*
* The corresponding announcement macros are respectively:
* _LFS_LARGEFILE
* _LFS64_LARGEFILE
* (These are set in <unistd.h>.)
*
* Requesting _LARGEFILE64_SOURCE implies requesting _LARGEFILE_SOURCE as
* well.
*
* The large file interfaces are made visible regardless of the initial
values
* of the feature test macros under certain circumstances:
* - If no explicit standards-conforming environment is requested
(neither
* of _POSIX_SOURCE nor _XOPEN_SOURCE is defined and the value of
* __STDC__ does not imply standards conformance).
* - Extended system interfaces are explicitly requested (__EXTENSIONS__
* is defined).
* - Access to in-kernel interfaces is requested (_KERNEL or
_KMEMUSER is
* defined). (Note that this dependency is an artifact of the current
* kernel implementation and may change in future releases.)
*/
#if ((__STDC__ - 0 == 0) && \
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_KERNEL) || defined(_KMEMUSER) || \
defined(__EXTENSIONS__)
#undef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE 1
#endif
#if _LARGEFILE64_SOURCE - 0 == 1
#undef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE 1
#endif
/*
* Large file compilation environment control:
*
* The setting of _FILE_OFFSET_BITS controls the size of various
file-related
* types and governs the mapping between file-related source function
symbol
* names and the corresponding binary entry points.
*
* In the 32-bit environment, the default value is 32; if not set, set
it to
* the default here, to simplify tests in other headers.
*
* In the 64-bit compilation environment, the only value allowed is 64.
*/
#if defined(_LP64)
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
#if _FILE_OFFSET_BITS - 0 != 64
#error "invalid _FILE_OFFSET_BITS value specified"
#endif
#else /* _LP64 */
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 32
#endif
#if _FILE_OFFSET_BITS - 0 != 32 && _FILE_OFFSET_BITS - 0 != 64
#error "invalid _FILE_OFFSET_BITS value specified"
#endif
#endif /* _LP64 */
/*
* Values of _POSIX_C_SOURCE
*
* undefined not a POSIX compilation
* 1 POSIX.1-1990 compilation
* 2 POSIX.2-1992 compilation
* 199309L POSIX.1b-1993 compilation (Real Time)
* 199506L POSIX.1c-1995 compilation (POSIX Threads)
* 200112L POSIX.1-2001 compilation (Austin Group
Revision)
*/
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 1
#endif
/*
* Use of _XOPEN_SOURCE
*
* The following X/Open specifications are supported:
*
* X/Open Portability Guide, Issue 3 (XPG3)
* X/Open CAE Specification, Issue 4 (XPG4)
* X/Open CAE Specification, Issue 4, Version 2 (XPG4v2)
* X/Open CAE Specification, Issue 5 (XPG5)
* Open Group Technical Standard, Issue 6 (XPG6), also referred to as
* IEEE Std. 1003.1-2001 and ISO/IEC 9945:2002.
*
* XPG4v2 is also referred to as UNIX 95 (SUS or SUSv1).
* XPG5 is also referred to as UNIX 98 or the Single Unix Specification,
* Version 2 (SUSv2)
* XPG6 is the result of a merge of the X/Open and POSIX specifications
* and as such is also referred to as IEEE Std. 1003.1-2001 in
* addition to UNIX 03 and SUSv3.
*
* When writing a conforming X/Open application, as per the specification
* requirements, the appropriate feature test macros must be defined at
* compile time. These are as follows. For more info, see standards(5).
*
* Feature Test Macro Specification
* ------------------------------------------------ -------------
* _XOPEN_SOURCE XPG3
* _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4
* _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2
* _XOPEN_SOURCE = 500 XPG5
* _XOPEN_SOURCE = 600 (or POSIX_C_SOURCE=200112L) XPG6
*
* In order to simplify the guards within the headers, the following
* implementation private test macros have been created. Applications
* must NOT use these private test macros as unexpected results will
* occur.
*
* Note that in general, the use of these private macros is cumulative.
* For example, the use of _XPG3 with no other restrictions on the X/Open
* namespace will make the symbols visible for XPG3 through XPG6
* compilation environments. The use of _XPG4_2 with no other X/Open
* namespace restrictions indicates that the symbols were introduced in
* XPG4v2 and are therefore visible for XPG4v2 through XPG6 compilation
* environments, but not for XPG3 or XPG4 compilation environments.
*
* _XPG3 X/Open Portability Guide, Issue 3 (XPG3)
* _XPG4 X/Open CAE Specification, Issue 4 (XPG4)
* _XPG4_2 X/Open CAE Specification, Issue 4, Version 2 (XPG4v2/UNIX
95/SUS)
* _XPG5 X/Open CAE Specification, Issue 5 (XPG5/UNIX 98/SUSv2)
* _XPG6 Open Group Technical Standard, Issue 6 (XPG6/UNIX 03/SUSv3)
*/
/* X/Open Portability Guide, Issue 3 */
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 < 500) && \
(_XOPEN_VERSION - 0 < 4) && !defined(_XOPEN_SOURCE_EXTENDED)
#define _XPG3
/* X/Open CAE Specification, Issue 4 */
#elif (defined(_XOPEN_SOURCE) && _XOPEN_VERSION - 0 == 4)
#define _XPG4
#define _XPG3
/* X/Open CAE Specification, Issue 4, Version 2 */
#elif (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 == 1)
#define _XPG4_2
#define _XPG4
#define _XPG3
/* X/Open CAE Specification, Issue 5 */
#elif (_XOPEN_SOURCE - 0 == 500)
#define _XPG5
#define _XPG4_2
#define _XPG4
#define _XPG3
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506L
#define _POSIX_PTHREAD_SEMANTICS 1
/* Open Group Technical Standard , Issue 6 */
#elif (_XOPEN_SOURCE - 0 == 600) || (_POSIX_C_SOURCE - 0 == 200112L)
#define _XPG6
#define _XPG5
#define _XPG4_2
#define _XPG4
#define _XPG3
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
/*
* _XOPEN_VERSION is defined by the X/Open specifications and is not
* normally defined by the application, except in the case of an XPG4
* application. On the implementation side, _XOPEN_VERSION defined with
* the value of 3 indicates an XPG3 application. _XOPEN_VERSION defined
* with the value of 4 indicates an XPG4 or XPG4v2 (UNIX 95) application.
* _XOPEN_VERSION defined with a value of 500 indicates an XPG5 (UNIX 98)
* application and with a value of 600 indicates an XPG6 (UNIX 03)
* application. The appropriate version is determined by the use of the
* feature test macros described earlier. The value of _XOPEN_VERSION
* defaults to 3 otherwise indicating support for XPG3 applications.
*/
#ifndef _XOPEN_VERSION
#ifdef _XPG6
#define _XOPEN_VERSION 600
#elif defined(_XPG5)
#define _XOPEN_VERSION 500
#elif defined(_XPG4_2)
#define _XOPEN_VERSION 4
#else
#define _XOPEN_VERSION 3
#endif
#endif
/*
* The feature test macros __XOPEN_OR_POSIX, _STRICT_STDC, and _STDC_C99
* are Sun implementation specific macros created in order to compress
* common standards specified feature test macros for easier reading.
* These macros should not be used by the application developer as
* unexpected results may occur.
*
* __XOPEN_OR_POSIX Used in cases where a symbol is defined by both
* X/Open or POSIX or in the negative, when neither
* X/Open or POSIX defines a symbol.
*
* _STRICT_STDC __STDC__ is specified by the C Standards and defined
* by the compiler. For Sun compilers the value of
* __STDC__ is either 1, 0, or not defined based on the
* compilation mode (see cc(1)). When the value of
* __STDC__ is 1 and in the absence of any other feature
* test macros, the namespace available to the application
* is limited to only those symbols defined by the C
* Standard. _STRICT_STDC provides a more readable means
* of identifying symbols defined by the standard, or in
* the negative, symbols that are extensions to the C
* Standard.
*
* _STDC_C99 __STDC_VERSION__ is specified by the C standards and
* defined by the compiler and indicates the version of
* the C standard. A value of 199901L indicates a
* compiler that complies with ISO/IEC 9899:1999, other-
* wise known as the C99 standard.
*/
#if defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE)
#define __XOPEN_OR_POSIX
#endif
#if (__STDC__ - 0 == 1)
#define _STRICT_STDC
#endif
#if __STDC_VERSION__ >= 199901L
#define _STDC_C99
#endif
/*
* It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application
* using c99. The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b,
* and POSIX.1c applications. Likewise, it is invalid to compile an XPG6
* or a POSIX.1-2001 application with anything other than a c99 or later
* compiler. Therefore, we force an error in both cases.
*/
#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
and pre-2001 POSIX applications"
#elif !defined(_STDC_C99) && \
(defined(__XOPEN_OR_POSIX) && defined(_XPG6))
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
require the use of c99"
#endif
/*
* The following macro defines a value for the ISO C99 restrict
* keyword so that _RESTRICT_KYWD resolves to "restrict" if
* an ISO C99 compiler is used and "" (null string) if any other
* compiler is used. This allows for the use of single prototype
* declarations regardless of compiler version.
*/
#if (defined(__STDC__) && defined(_STDC_C99))
#define _RESTRICT_KYWD restrict
#else
#define _RESTRICT_KYWD
#endif
/*
* The following macro indicates header support for the ANSI C++
* standard. The ISO/IEC designation for this is ISO/IEC FDIS 14882.
*/
#define _ISO_CPP_14882_1998
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FEATURE_TESTS_H */