Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.6 KiB

  1. dnl Check for the presence of the Sun Studio compiler.
  2. dnl If Sun Studio compiler is found, set appropriate flags.
  3. dnl Additionally, Sun Studio doesn't default to 64-bit by itself,
  4. dnl nor does it automatically look in standard Solaris places for
  5. dnl 64-bit libs, so we must add those options and paths to the search
  6. dnl paths.
  7. dnl TODO(kenton): This is pretty hacky. It sets CXXFLAGS, which the autoconf
  8. dnl docs say should never be overridden except by the user. It also isn't
  9. dnl cross-compile safe. We should fix these problems, but since I don't have
  10. dnl Sun CC at my disposal for testing, someone else will have to do it.
  11. AC_DEFUN([ACX_CHECK_SUNCC],[
  12. AC_LANG_PUSH([C++])
  13. AC_CHECK_DECL([__SUNPRO_CC], [SUNCC="yes"], [SUNCC="no"])
  14. AC_LANG_POP()
  15. AC_ARG_ENABLE([64bit-solaris],
  16. [AS_HELP_STRING([--disable-64bit-solaris],
  17. [Build 64 bit binary on Solaris @<:@default=on@:>@])],
  18. [ac_enable_64bit="$enableval"],
  19. [ac_enable_64bit="yes"])
  20. AS_IF([test "$SUNCC" = "yes" -a "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
  21. dnl Sun Studio has a crashing bug with -xO4 in some cases. Keep this
  22. dnl at -xO3 until a proper test to detect those crashes can be done.
  23. CXXFLAGS="-g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef ${CXXFLAGS}"
  24. ])
  25. case $host_os in
  26. *solaris*)
  27. AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
  28. AS_IF([test "x$ISAINFO" != "xno"],
  29. [isainfo_b=`${ISAINFO} -b`],
  30. [isainfo_b="x"])
  31. AS_IF([test "$isainfo_b" != "x"],[
  32. isainfo_k=`${ISAINFO} -k`
  33. AS_IF([test "x$ac_enable_64bit" = "xyes"],[
  34. AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
  35. dnl The user hasn't overridden the default libdir, so we'll
  36. dnl the dir suffix to match solaris 32/64-bit policy
  37. libdir="${libdir}/${isainfo_k}"
  38. ])
  39. dnl This should just be set in CPPFLAGS and in LDFLAGS, but libtool
  40. dnl does the wrong thing if you don't put it into CXXFLAGS. sigh.
  41. dnl (It also needs it in CFLAGS, or it does a different wrong thing!)
  42. AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
  43. CXXFLAGS="${CXXFLAGS} -m64"
  44. ac_cv_env_CXXFLAGS_set=set
  45. ac_cv_env_CXXFLAGS_value='-m64'
  46. ])
  47. AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
  48. CFLAGS="${CFLAGS} -m64"
  49. ac_cv_env_CFLAGS_set=set
  50. ac_cv_env_CFLAGS_value='-m64'
  51. ])
  52. AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ],[
  53. CXXFLAGS="-xmemalign=8s ${CXXFLAGS}"
  54. ])
  55. ])
  56. ])
  57. ;;
  58. esac
  59. ])