1AC_DEFUN([ONMS_SET_CC_ARCH_CFLAGS],
2  [
3    AS_IF([test "x$JAVA_ARCH" = "x"], [AC_MSG_ERROR([JAVA_ARCH is not set])])
4    AS_IF([test "x$HAS_SUNCC" = "x"], [AC_MSG_ERROR([HAS_SUNCC is not set])])
5
6    if test "x$GCC" = "xyes"; then
7      case $host_cpu in
8        i*86|x86_64)
9          CFLAGS="$CFLAGS -m$JAVA_ARCH"
10          ;;
11      esac
12    elif test "x$HAS_SUNCC" = "xyes"; then
13      case "${JAVA_ARCH}" in
14        32)
15          SUNCC_ARCH_FLAGS="-xarch=generic"
16        ;;
17
18        64)
19          SUNCC_ARCH_FLAGS="-xarch=generic64"
20        ;;
21
22        *)
23          SUNCC_ARCH_FLAGS=""
24          AC_MSG_NOTICE([WARNING: not sure how to tell the Sun CC compiler to generate ${JAVA_ARCH}-bit binaries with this compiler])
25        ;;
26      esac
27
28      CFLAGS="$CFLAGS $SUNCC_ARCH_FLAGS"
29    else
30      AC_MSG_NOTICE([WARNING: not sure how to make sure you're generating ${JAVA_ARCH}-bit binaries with this compiler: $CC])
31    fi
32  ]
33)
34
35AC_DEFUN([ONMS_SET_CC_WARNING_CFLAGS],
36  [
37    AS_IF([test "x$HAS_SUNCC" = "x"], [AC_MSG_ERROR([HAS_SUNCC is not set])])
38
39    if test "x$GCC" = "xyes"; then
40      CFLAGS="$CFLAGS -Wall"
41    elif test "x$HAS_SUNCC" = "xyes"; then
42      CFLAGS="$CFLAGS -errwarn=%all"
43    else
44      AC_MSG_NOTICE([WARNING: not sure how to tell the compiler to treat warnings as errors with this compiler: $CC])
45    fi
46  ]
47)
48