From afe4f0c201dfa2bbb758e3b82b6be3bb4a5388a2 Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Thu, 8 Dec 2005 20:03:42 +0000 Subject: [PATCH] New autoconf macro "BOINC_PLATFORM" to determine the BOINC platform being targeted. This overrides the use of the autoconf target as the BOINC platform. I recommend that people developing BOINC applications use this macro as well. Some of the overrides are... *-redhat-* -> *-pc-* *-*-*[0-9].[0-9] -> *-*-* (trailing version numbers are dropped) sparc-sun-solaris* -> sparc64-sun-solaris when compiled as 64 bit binary x86_64-*-linux-gnu -> i686-pc-linux-gnu when compiled as a 32 bit binary svn path=/trunk/boinc/; revision=9052 --- m4/boinc_platform.m4 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 m4/boinc_platform.m4 diff --git a/m4/boinc_platform.m4 b/m4/boinc_platform.m4 new file mode 100644 index 0000000000..9e647114ac --- /dev/null +++ b/m4/boinc_platform.m4 @@ -0,0 +1,26 @@ +AC_DEFUN([BOINC_PLATFORM],[ + AC_ARG_WITH([boinc-platform], + AC_HELP_STRING([--with-boinc-platform], + [override the default boinc platform]), + [boinc_platform="$withval"], + [boinc_platform=]) + AC_MSG_CHECKING([boinc platform]) + if test -z "${boinc_platform}" ; then + boinc_platform=`echo $target | $SED -e 's/redhat/pc/' -e 's/[0-9]$//' -e 's/[0-9]$//' -e 's/\.$//' -e 's/[0-9]$//'` + case "${boinc_platform}" in + sparc-sun-solaris) + if test "$COMPILER_MODEL_BITS" = "64" ; then + boinc_platform=`echo $boinc_platform | $SED 's/sparc/sparc64/'` + fi + ;; + x86_64*linux-gnu) + if test "$COMPILER_MODEL_BITS" = "32" ; then + boinc_platform="i686-pc-linux-gnu" + fi + ;; + esac + fi + AC_DEFINE_UNQUOTED([HOSTTYPE],"$boinc_platform",[Platform identification used to identify applications for this BOINC core client]) + AC_MSG_RESULT($boinc_platform) +]) +