1AC_DEFUN([BOINC_PLATFORM],[
2  AC_ARG_WITH([boinc-platform],
3              AC_HELP_STRING([--with-boinc-platform],
4	                      [override the default boinc platform]),
5	      [boinc_platform="$withval"],
6	      [boinc_platform=])
7  AC_ARG_WITH([boinc-alt-platform],
8              AC_HELP_STRING([--with-boinc-alt-platform],
9	                      [override the boinc alternate platform]),
10	      [boinc_alt_platform="$withval"],
11	      [boinc_alt_platform=])
12  AC_MSG_CHECKING([boinc platform])
13  if test -z "${boinc_platform}" ; then
14    boinc_platform=`echo $target | $SED -e 's/amd64/x86_64/' -e 's/portbld/pc/' -e 's/redhat/pc/' -e 's/x86_64-unknown/x86_64-pc/' -e 's/[[0-9]]$//' -e 's/[[0-9]]$//' -e 's/\.$//' -e 's/[[0-9]]$//' -e 's/\.$//' -e 's/[[0-9]]$//'`
15    case "${boinc_platform}" in
16      sparc-sun-solaris)
17    	if test "$COMPILER_MODEL_BITS" = "64" ; then
18	  boinc_platform=`echo $boinc_platform | $SED 's/sparc/sparc64/'`
19	  if test -z "$boinc_alt_platform" ; then
20	    boinc_alt_platform=sparc-sun-solaris
21	  fi
22	elif test -z "$boinc_alt_platform" ; then
23	    boinc_alt_platform=sparc-sun-solaris2.7
24	fi
25        ;;
26      x86_64*linux-gnu)
27        if test "$COMPILER_MODEL_BITS" = "32" ; then
28	  boinc_platform="i686-pc-linux-gnu"
29	elif test -z "$boinc_alt_platform" ; then
30	  boinc_alt_platform="i686-pc-linux-gnu"
31	fi
32	;;
33      powerpc-apple-darwin)
34        if test "$COMPILER_MODEL_BITS" = "64" ; then
35	  boinc_platform="powerpc64-apple-darwin"
36	  if test -z "$boinc_alt_platform" ; then
37	    boinc_alt_platform="powerpc-apple-darwin"
38	  fi
39	fi
40	;;
41      hppa*-hp-hpux*)
42        if test "$COMPILER_MODEL_BITS" = "64" ; then
43	  boinc_platform="hppa64-hp-hpux"
44	  if test -z "${boinc_alt_platform}" ; then
45	    boinc_alt_platform="hppa-hp-hpux"
46	  fi
47	else
48	  boinc_platform="hppa-hp-hpux"
49	fi
50        ;;
51      ia64-hp-hpux*)
52	boinc_platform="ia64-hp-hpux"
53        ;;
54    esac
55    case "${target}" in
56      i386-pc-os2)
57        boinc_platform="i686-pc-os2"
58        ;;
59      i*86-*-mingw32)
60        boinc_platform="windows_intelx86"
61	;;
62      x86_64-*-mingw32)
63        boinc_platform="windows_x86_64"
64	boinc_alt_platform="windows_intelx86"
65	;;
66    esac
67  fi
68  AC_DEFINE_UNQUOTED([HOSTTYPE],"$boinc_platform",[Platform identification used to identify applications for this BOINC core client])
69  AC_SUBST([boinc_platform],$boinc_platform)
70  AC_MSG_RESULT([$boinc_platform])
71  AC_MSG_CHECKING([alternate boinc platform])
72  if test -n "$boinc_alt_platform" ; then
73     AC_DEFINE_UNQUOTED([HOSTTYPEALT],"$boinc_alt_platform",[Alternate identification used to identify applications for this BOINC core client])
74     AC_SUBST([boinc_alt_platform],$boinc_alt_platform)
75     AC_MSG_RESULT($boinc_alt_platform)
76  else
77     AC_MSG_RESULT(none)
78  fi
79])
80
81