+*" Sun "*"C"*)
+ # Sun's C compiler, which might have a 'tag' name between
+ # 'Sun' and the 'C': Examples:
+ # cc: Sun C 5.9 Linux_i386 Patch 124871-01 2007/07/31
+ # cc: Sun Ceres C 5.10 Linux_i386 2008/07/10
+ test "$optimize" || optimize='-xO2'
+ cccdlflags='-KPIC'
+ lddlflags='-G -Bdynamic'
+ # Sun C doesn't support gcc attributes, but, in many cases, doesn't
+ # complain either. Not all cases, though.
+ d_attribute_format='undef'
+ d_attribute_malloc='undef'
+ d_attribute_nonnull='undef'
+ d_attribute_noreturn='undef'
+ d_attribute_pure='undef'
+ d_attribute_unused='undef'
+ d_attribute_warn_unused_result='undef'
+ ;;
+esac
+
+case "$optimize" in
+# use -O2 by default ; -O3 doesn't seem to bring significant benefits with gcc
+'')
+ optimize='-O2'
+ case "`uname -m`" in
+ ppc*)
+ # on ppc, it seems that gcc (at least gcc 3.3.2) isn't happy
+ # with -O2 ; so downgrade to -O1.
+ optimize='-O1'
+ ;;
+ ia64*)
+ # This architecture has had various problems with gcc's
+ # in the 3.2, 3.3, and 3.4 releases when optimized to -O2. See
+ # RT #37156 for a discussion of the problem.
+ case "`${cc:-gcc} -v 2>&1`" in
+ *"version 3.2"*|*"version 3.3"*|*"version 3.4"*)
+ ccflags="-fno-delete-null-pointer-checks $ccflags"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
+# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
+# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us
+# where to look. We don't want gcc's own libraries, however, so we
+# filter those out.
+# This could be conditional on Unbuntu, but other distributions may
+# follow suit, and this scheme seems to work even on rather old gcc's.
+# This unconditionally uses gcc because even if the user is using another
+# compiler, we still need to find the math library and friends, and I don't
+# know how other compilers will cope with that situation.
+# Morever, if the user has their own gcc earlier in $PATH than the system gcc,
+# we don't want its libraries. So we try to prefer the system gcc
+# Still, as an escape hatch, allow Configure command line overrides to
+# plibpth to bypass this check.
+if [ -x /usr/bin/gcc ] ; then
+ gcc=/usr/bin/gcc
+else
+ gcc=gcc
+fi
+
+case "$plibpth" in
+'') plibpth=`LANG=C LC_ALL=C $gcc -print-search-dirs | grep libraries |
+ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
+ set X $plibpth # Collapse all entries on one line
+ shift
+ plibpth="$*"
+ ;;