Ok, I think my earlier problem came from not cleaning up properly between
multiple compiles. So I don't need to modify any test.
Proposed log entry:
When compiling many of the perl modules available from CPAN, an expectation
of C99 support seems implied by many authors. Unfortunately, xlC doesn't
do this by default, we have to add -qlanglvl=extc99 to the ccflags to get
this to work. And by the time we get to installing modules, this flag
is already set in Config.
So, add the flag unconditionally at the outset. Also, remove
-qlonglong and -qlanglvl=extended from the flags to silence the warning that
extc99 includes them and that xlC is going to ignore it, using extc99 instead.
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
ccflags="$ccflags -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE"
case "$cc" in
*gcc*) ;;
- *) ccflags="$ccflags -qmaxmem=-1 -qnoansialias" ;;
+ *) ccflags="$ccflags -qmaxmem=-1 -qnoansialias -qlanglvl=extc99" ;;
esac
nm_opt='-B'
cc_r)
;;
xlc_r)
- # for -qlonglong
- ccflags="$ccflags -qlanglvl=extended"
;;
# we do not need the C++ compiler
xlC_r)
- # for -qlonglong
- ccflags="$ccflags -qlanglvl=extended"
cc=xlc_r
;;
'')
*)
case "$cc" in
xlc)
- # for -qlonglong
- ccflags="$ccflags -qlanglvl=extended"
;;
# we do not need the C++ compiler
xlC)
- # for -qlonglong
- ccflags="$ccflags -qlanglvl=extended"
cc=xlc
;;
*)
$define|true|[yY]*) cc="$cc -q64" ;;
*) cc="$cc -q32" ;;
esac
+ # Some 32-bit getconfs will set ccflags to include -qlonglong
+ # but that's no longer needed with an explicit -qextc99.
+ ccflags="`echo $ccflags | sed -e 's@ -qlonglong@@`"
;;
*) # Remove xlc-specific -qflags.
ccflags="`echo $ccflags | sed -e 's@ -q[^ ]*@ @g' -e 's@^-q[^ ]* @@g'`"