aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2007-06-07 07:55:19 +0000
committerGlenn Morris <[email protected]>2007-06-07 07:55:19 +0000
commit42bf63da0365c3d045cc1959b43cca331626ac62 (patch)
tree6f50a3fbad7bab0f4dc6d3a7650dd8ee6eb040db /configure.in
parent5ee63e320f3a36f94912f92c649a5e6b96a50473 (diff)
(NON_GNU_CPP): On Solaris, set using a proper check for a Sun C
compiler.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in28
1 files changed, 20 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index b8aadf5954..1d725e13a8 100644
--- a/configure.in
+++ b/configure.in
@@ -1032,14 +1032,8 @@ dnl see the `changequote' comment above.
;;
*-sunos5* | *-solaris* )
opsys=sol2-6
-## FIXME: make this into a proper fix that checks the compiler type,
-## rather than relying on path. Or is /usr/ccs/lib/cpp a bad default now?
- if [ "x$CC" = x/opt/SUNWspro/bin/cc ]; then
- ## -Xs prevents spurious whitespace.
- NON_GNU_CPP="/opt/SUNWspro/bin/cc -E -Xs"
- else
- NON_GNU_CPP=/usr/ccs/lib/cpp
- fi
+ emacs_check_sunpro_c=yes
+ NON_GNU_CPP=/usr/ccs/lib/cpp
;;
* ) opsys=bsd4-2 ;;
esac
@@ -1275,6 +1269,24 @@ if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
+## If not using gcc, and on Solaris, and no CPP specified, see if
+## using a Sun compiler, which needs -Xs to prevent whitespace.
+if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
+ test x"$CPP" = x; then
+ AC_MSG_CHECKING([whether we are using a Sun C compiler])
+ AC_CACHE_VAL(emacs_cv_sunpro_c,
+ [AC_TRY_LINK([],
+[#ifndef __SUNPRO_C
+fail;
+#endif
+], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)])
+ AC_MSG_RESULT($emacs_cv_sunpro_c)
+
+ if test x"$emacs_cv_sunpro_c" = xyes; then
+ NON_GNU_CPP="$CC -E -Xs"
+ fi
+fi
+
#### Some systems specify a CPP to use unless we are using GCC.
#### Now that we know whether we are using GCC, we can decide whether
#### to use that one.