cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: compiling curl on AIX 5.3

From: Everett, Marty <MEverett_at_ikon.com>
Date: Thu, 28 Jun 2007 11:23:10 -0400

Thanks for the clarification.

This is what I have learned.

 

# cc -qlanglvl=extc89 test.c

# ./a.out

I am just CC

# cc test.c -o a.out2

# ./a.out2

I am just CC

# xlc test.c -o a.out3

# ./a.out3

I am STDC

 

Below is the c complier config file. xlc will get the ansi complier
option that I need it looks like.

 

# head -50 /etc/vac.cfg

*

* COMPONENT_NAME: (CC) C for AIX Compiler

*

* FUNCTIONS: C/C++ Configuration file

*

* ORIGINS: 27

*

* (C) COPYRIGHT International Business Machines Corp. 1991, 2003

* All Rights Reserved

* Licensed Materials - Property of IBM

*

* US Government Users Restricted Rights - Use, duplication or

* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

*

* ANSI C compiler, UNIX header files

xlc: use = DEFLT

        crt = /lib/crt0.o

        mcrt = /lib/mcrt0.o

        gcrt = /lib/gcrt0.o

        libraries = -L/usr/lpp/xlopt,-lxlopt,-lc

        proflibs = -L/lib/profiled,-L/usr/lib/profiled

        options = -qansialias

 

* C compiler, extended mode

cc: use = DEFLT

        crt = /lib/crt0.o

        mcrt = /lib/mcrt0.o

        gcrt = /lib/gcrt0.o

        libraries = -L/usr/lpp/xlopt,-lxlopt,-lc

        proflibs = -L/lib/profiled,-L/usr/lib/profiled

        options = -qlanglvl=extended,-qnoro,-qnoroconst

 

xlc128: use = DEFLT

        crt = /lib/crt0.o

        mcrt = /lib/mcrt0.o

        gcrt = /lib/gcrt0.o

        libraries = -L/usr/lpp/xlopt,-lxlopt,-lc128,-lc

        proflibs = -L/lib/profiled,-L/usr/lib/profiled

        options = -qansialias,-qldbl128

 

* C compiler, extended mode

cc128: use = DEFLT

        crt = /lib/crt0.o

        mcrt = /lib/mcrt0.o

        gcrt = /lib/gcrt0.o

        libraries = -L/usr/lpp/xlopt,-lxlopt,-lc128,-lc

        proflibs = -L/lib/profiled,-L/usr/lib/profiled

        options = -qlanglvl=extended,-qnoro,-qnoroconst,-qldbl128

 

* Strict ANSI compiler, ANSI headers

 

I then tried this but it did not work but not sure why at this point.

 

cc -qansialias test.c -o a.out4

# ./a.out4

I am just CC

 

 

I did a configure like below and did make and it built just fine and I
am testing now but seems to be working fine with the ssl rpms supplied
by IBM LINUX tool kit.

 

configure --with-PACKAGE=ssl --with-ssl=/opt/freeware --with-gnutls
--with-nss CC=xlc

 

Just for complete information this is the version of the IBM complier I
have installed.

 

# lslpp -l vac.C

  Fileset Level State Description

 
------------------------------------------------------------------------

----
Path: /usr/lib/objrepos
  vac.C                     6.0.0.12  COMMITTED  C for AIX Compiler
 
Path: /etc/objrepos
  vac.C                     6.0.0.12  COMMITTED  C for AIX Compiler
 
Thanks
 
________________________________
From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of Song Ma
Sent: Wednesday, June 27, 2007 10:53 PM
To: the curl tool
Subject: Re: compiling curl on AIX 5.3
 
Hi Marty,
Daniel explained well the root cause. I've encountered the same problem
on another UNIX platform which is using specialized C compiler. The
reason is because "curl.h" can not set "CURL_ISOCPP" to "defined" status
by telling the compiler type.  The fix is to define CURL_ISOCPP
explicitly before line 530. 
BTW, I am curious to say "-qlanglvl=extc89" is not the cause of your
error. Contrarily, "cc -qlanglvl=extc89" will set the macro "__STDC__"
on AIX 5.3. I guess your other compiler options may turn off this macro
setting. Here is a little testing: 
(root@) /tmp> uname -a
AIX 53JTEST2 3 5 00CEBB4A4C00
(root@) /tmp> cat test.c
#include <stdio.h>
int main(void)
{
#ifdef __STDC__
printf("I am STDC\n");
#else
printf("I am just CC\n"); 
#endif
return 0;
}
(root@) /tmp> cc -qlanglvl=extc89 test.c
(root@) /tmp> ./a.out
I am STDC
(root@) /tmp> cc test.c -o a.out2
(root@) /tmp> ./a.out2
I am just CC
attached " curl.h" code fragment:
     519 #if defined(__STDC__) || defined(_MSC_VER) ||
defined(__cplusplus) || \
     520   defined(__HP_aCC) || defined(__BORLANDC__) ||
defined(__LCC__) || \
     521   defined(__POCC__) || defined(__SALFORDC__) ||
defined(__HIGHC__) 
     522   
     523   /* This compiler is believed to have an ISO compatible
preprocessor */
     524 #define CURL_ISOCPP
     525 #else
     526   /* This compiler is believed NOT to have an ISO compatible
preprocessor */ 
     527 #undef CURL_ISOCPP
     528 #endif
     529
     530 #ifdef CURL_ISOCPP
     531 #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_
## type + number
     532 #else
"
2007/6/26, Daniel Stenberg <daniel_at_haxx.se>:
On Mon, 25 Jun 2007, Everett, Marty wrote:
>  I did not change the config options from 7.15 to 7.16. I have tried
other
> version of 7.16 with the same results but with different line numbers.
(Please don't top-post) 
The only difference (from 7.15.5 to 7.16.0) I could see that would
affect that
enum is that the latter checks for __HIGHC__ as well and consider such a
compiler to be ISO C (and that's for the Metaware's High-C compiler). 
If you define CURL_ISOCPP before the first #ifdef CURL_ISOPP line, does
that
make it compile?
BTW, I just tried a recent curl version on AIX 5.3 box, and configure
found cc
and I could build curl fine with it (no extra option for C89 or anything
required).
 
Received on 2007-06-28