curl-library
Detecting HP native C compiler on HP-UX
Date: Tue, 19 May 2015 18:12:24 +0300
Hello,
I realise that m4/curl-compilers.m4 does not detecting properly HP native
compiler on my HP-UX Itanium machines. The key problem in C preprocessor
which has invoked there. On available for me machines I am using cpp, not
"cc -E" and it is not defines __HP_cc, but __hpux.
In HP manuals written:
NOTE: __ia64 and __HP_aCC are defined automatically for
aCC and __HP_cc for cc/c89/c99 or aCC with -Ae.
The following is the list of default -D flags:
-AP:
-D__hpux -D__ia64=1 -D_BIG_ENDIAN=1 -D__STDCPP__
-D__HP_aCC=version-string
-AA: Same as -AP, and also defines -D_HP_NAMESPACE_STD.
aCC -Ae:
-D__hpux -D__unix -D__ia64=1 -D_BIG_ENDIAN=1
-D__STDCPP__ -D__HP_cc=version-string -D__STDC_EXT__
-D_HPUX_SOURCE -D_INCLUDE_LONGLONG
aCC -Ae -Aa:
-D__hpux -D__unix -D__ia64=1 -D_BIG_ENDIAN=1
-D__STDCPP__ -D__HP_cc=version-string
aCC -Ae -Agcc: -D_HP_GNUC_COMPATIBLE
aCC -Ag++: -D_HP_GNUG_COMPATIBLE
aCC -Aarm: -D_HP_ARM_COMPATIBLE
cc -Ae:
-D__hpux -D__unix -D__ia64=1 -D_BIG_ENDIAN=1
-D__HP_cc=version-string -D__STDC_EXT__ -D_HPUX_SOURCE
-D_INCLUDE_LONGLONG
cc/c89/c99 -Aa:
-D__hpux -D__unix -D__ia64=1 -D_BIG_ENDIAN=1
-D__HP_cc=version-string
cc -Agcc: -D_HP_GNUC_COMPATIBLE
So I see here define __hpux comes in conjunction with define __HP_cc in
native C compiler.
In HP man pages for cpp:
"All HP-UX systems have the symbols PWB, hpux, unix, _PWB, __hpux, and
__unix defined." (
http://h20565.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c02254535).
Actually it is not a problem at all to build cURL on HP-UX, but for sanity
I suggest this patch. It works with define __hpux like as __HP_cc for
detecting is it native HP compiler.
Cheers, Dmitriy
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/x-patch attachment: hpux-native-preprocessor.patch