[PATCH] Fixup compilation for gcc-aix target

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fixup compilation for gcc-aix target

alon.barlev (Bugzilla)
Version 1.0.0-beta4 and latest 1.0.0.0 snapshot.
Tested to work in Linux-2.4, Linux-2.6, Solaris-8, Solaris-10, AIX-3.5

"""
sltest.c:157:1: error: "_XOPEN_SOURCE" redefined
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/include/assert.h:64,
from ssltest.c:146:
/usr/include/standards.h:114:1: error: this is the location of the previous definition
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 1.
"""

diff -urNp openssl-1.0.0-beta4.org/ssl/ssltest.c openssl-1.0.0-beta4/ssl/ssltest.c
--- openssl-1.0.0-beta4.org/ssl/ssltest.c 2009-01-08 01:44:27.000000000 +0200
+++ openssl-1.0.0-beta4/ssl/ssltest.c 2009-11-21 09:24:46.001175088 +0200
@@ -143,6 +143,9 @@
 #define _BSD_SOURCE 1 /* Or gethostname won't be declared properly
    on Linux and GNU platforms. */
 
+#define _XOPEN_SOURCE 500 /* Or isascii won't be declared properly on
+   VMS (at least with DECompHP C).  */
+
 #include <assert.h>
 #include <errno.h>
 #include <limits.h>
@@ -154,8 +157,6 @@
 #define USE_SOCKETS
 #include "e_os.h"
 
-#define _XOPEN_SOURCE 500 /* Or isascii won't be declared properly on
-   VMS (at least with DECompHP C).  */
 #include <ctype.h>
 
 #include <openssl/bio.h>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: [PATCH] Fixup compilation for gcc-aix target

Green, Paul
Alon Bar-Lev hit a build problem and provided the following proposed
patch:

> diff -urNp openssl-1.0.0-beta4.org/ssl/ssltest.c
> openssl-1.0.0-beta4/ssl/ssltest.c
> --- openssl-1.0.0-beta4.org/ssl/ssltest.c 2009-01-08
> 01:44:27.000000000 +0200
> +++ openssl-1.0.0-beta4/ssl/ssltest.c 2009-11-21
> 09:24:46.001175088 +0200
> @@ -143,6 +143,9 @@
>  #define _BSD_SOURCE 1 /* Or gethostname won't
> be declared properly
>     on Linux and GNU platforms. */
>  
> +#define _XOPEN_SOURCE 500 /* Or isascii won't be declared
> properly on
> +   VMS (at least with DECompHP C).  */
> +
>  #include <assert.h>
>  #include <errno.h>
>  #include <limits.h>
> @@ -154,8 +157,6 @@
>  #define USE_SOCKETS
>  #include "e_os.h"
>  
> -#define _XOPEN_SOURCE 500 /* Or isascii won't be declared
> properly on
> -   VMS (at least with DECompHP C).  */
>  #include <ctype.h>
>  
>  #include <openssl/bio.h>

In general, it is better to surround the definition of the
Standards-conforming macros with a guard that tests whether the macro
has already been defined, e.g.

#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
 
because on some systems, it is highly likely that these macros are
already defined by the user's environment.

Thanks
PG
--
Paul Green, Senior Technical Consultant, Stratus Technologies.
Voice: +1 978-461-7557; FAX: +1 978-461-3610; Mobile: +1 (978) 235-2451;
AIM: PaulGreen
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]