+ esac
+
+# remove libbsd.a from wanted libraries
+libswanted=`echo " $libswanted " | sed -e 's/ bsd / /'`
+libswanted=`echo " $libswanted " | sed -e 's/ BSD / /'`
+d_flock='undef'
+
+# remove libgdbm from wanted libraries
+# The libgdbm < 1.8.3-5 from the AIX Toolbox is not working
+# because two wrong .h are present
+if [ -f "/opt/freeware/include/gdbm/dbm.h" ] ||
+ [ -f "/opt/freeware/include/gdbm/ndbm.h" ]; then
+ echo "GDBM support disabled because your GDBM package contains extraneous headers - see README.aix."
+ libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
+ i_gdbm='undef'
+ i_gdbmndbm='undef'
+fi
+
+# Some releases (and patch levels) of AIX cannot have both
+# long doubles and infinity (infinity plus one equals ... NaNQ!)
+#
+# This deficiency, and others, is apparently a well-documented feature
+# of AIX 128-bit long doubles:
+#
+# http://www-01.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.genprogc/128bit_long_double_floating-point_datatype.htm
+#
+# The URL seems to be fragile, it has moved around over the years,
+# but searching AIX docs at ibm.com for "128-bit long double
+# floating-point data type" should surface the latest info.
+#
+# Some salient points:
+#
+# <quote>
+# * The 128-bit implementation differs from the IEEE standard for long double
+# in the following ways:
+# * Supports only round-to-nearest mode. If the application changes
+# the rounding mode, results are undefined.
+# * Does not fully support the IEEE special numbers NaN and INF.
+# * Does not support IEEE status flags for overflow, underflow,
+# and other conditions. These flags have no meaning for the 128-bit
+# long double inplementation.
+# * The 128-bit long double data type does not support the following math
+# APIs: atanhl, cbrtl, copysignl, exp2l, expm1l, fdiml, fmal, fmaxl,
+# fminl, hypotl, ilogbl, llrintl, llroundl, log1pl, log2l, logbl,
+# lrintl, lroundl, nanl, nearbyintl, nextafterl, nexttoward,
+# nexttowardf, nexttowardl, remainderl, remquol, rintl, roundl,
+# scalblnl, scalbnl, tgammal, and truncl.
+# * The representation of 128-bit long double numbers means that the
+# following macros required by standard C in the values.h file do not
+# have clear meaning:
+# * Number of bits in the mantissa (LDBL_MANT_DIG)
+# * Epsilon (LBDL_EPSILON)
+# * Maximum representable finite value (LDBL_MAX)
+# </quote>
+#
+# The missing math functions affect the POSIX extension math interfaces.
+
+case "$uselongdouble" in
+'')
+ echo "Checking if your infinity is working with long doubles..." >&4
+ cat > inf$$.c <<EOF
+#include <math.h>
+#include <stdio.h>
+int main() {
+ long double inf = INFINITY;
+ long double one = 1.0L;
+ printf("%Lg\n", inf + one);
+}
+EOF
+ $cc -qlongdouble -o inf$$ inf$$.c -lm
+ case `./inf$$` in
+ INF) echo "Your infinity is working correctly with long doubles." >&4 ;;
+ *) # NaNQ (or anything else than INF)
+ echo " "
+ echo "Your infinity is broken, I suggest disabling long doubles." >&4
+ rp="Disable long doubles?"
+ dflt="y"
+ . UU/myread
+ case "$ans" in
+ [Yy]*)
+ echo "Okay, disabling long doubles." >&4
+ uselongdouble="$undef"
+ ccflags=`echo " $ccflags " | sed -e 's/ -qlongdouble / /'`
+ libswanted=`echo " $libswanted " | sed -e 's/ c128/ /'`
+ lddlflags=`echo " $lddlflags " | sed -e 's/ -lc128 / /'`
+ ;;
+ *)
+ echo "Okay, keeping long doubles enabled." >&4
+ ;;
+ esac
+ ;;
+ esac
+ rm -f inf$$.c inf$$
+ ;;