#!/bin/sh #___INFO__MARK_BEGIN__ ########################################################################## # # The Contents of this file are made available subject to the terms of # the Sun Industry Standards Source License Version 1.2 # # Sun Microsystems Inc., March, 2001 # # # Sun Industry Standards Source License Version 1.2 # ================================================= # The contents of this file are subject to the Sun Industry Standards # Source License Version 1.2 (the "License"); You may not use this file # except in compliance with the License. You may obtain a copy of the # License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html # # Software provided under this License is provided on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, # WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, # MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. # See the License for the specific provisions governing your rights and # obligations concerning the Software. # # The Initial Developer of the Original Code is: Sun Microsystems, Inc. # # Copyright: 2001 by Sun Microsystems, Inc. # # All Rights Reserved. # ########################################################################## #___INFO__MARK_END__ # # Credit should be given to Robert Manchek manchek@CS.UTK.EDU for creating # a similar aimk procedure for the PVM 3.x distribution, Jul 22 1991, # which inspired the Grid Engine aimk build scheme. # Make sure to avoid confusion between shell variables and environment # variables # dir=`dirname $0` basedir=`cd $dir/..; pwd` usage() { echo "" echo "usage: compilearch (-b|-t|-c) []" echo "" echo " -b print the build arch (SOLARIS64)" echo " -t print the target bits (TARGET_32BIT or TARGET_64BIT)" echo " -c print the compile arch (e.g LINUXIA64_24) or an empty" echo " string if the build arch is equal to the compile arch" echo "" echo " print the information for a specific architecture." echo " If is missing the architecture is determined" echo " by calling the dist/util/arch script" echo "" } buildarch="" option="" case $# in 0) usage; exit 1;; 1) case $1 in -b) option="-b";; -t) option="-t";; -c) option="-c";; *) usage; exit 1;; esac;; 2) option=$1; buildarch=$2;; *) usage exit 1;; esac if [ "$buildarch" = "" ]; then archscript=$basedir/dist/util/arch if [ -f $archscript ]; then buildarch=`$archscript` if [ $? -ne 0 ]; then echo "error in $archscript: $buildarch" exit 1 fi else echo script $archscript not available exit 1 fi fi COMPILE_ARCH= BUILDARCH= TARGET_BITS= # Map buildarch into uppercase BUILDARCH # case $buildarch in aix43): BUILDARCH=AIX43 TARGET_BITS=TARGET_32BIT ;; aix51) BUILDARCH=AIX51 TARGET_BITS=TARGET_32BIT ;; cray) BUILDARCH=UNICOS TARGET_BITS=TARGET_64BIT ;; crayts) BUILDARCH=UNICOS_TS TARGET_BITS=TARGET_32BIT ;; craytsieee) BUILDARCH=UNICOS_TS_IEEE TARGET_BITS=TARGET_32BIT ;; darwin-x86) BUILDARCH=DARWIN_X86 TARGET_BITS=TARGET_32BIT ;; darwin-ppc) BUILDARCH=DARWIN_PPC TARGET_BITS=TARGET_32BIT ;; fbsd-alpha) BUILDARCH=FREEBSD_ALPHA TARGET_BITS=TARGET_64BIT ;; fbsd-amd64) BUILDARCH=FREEBSD_AMD64 TARGET_BITS=TARGET_64BIT ;; fbsd-i386) BUILDARCH=FREEBSD_I386 TARGET_BITS=TARGET_32BIT ;; fbsd-ia64) BUILDARCH=FREEBSD_IA64 TARGET_BITS=TARGET_64BIT ;; fbsd-ppc) BUILDARCH=FREEBSD_PPC TARGET_BITS=TARGET_32BIT ;; fbsd-sparc64) BUILDARCH=FREEBSD_SPARC64 ;; hp10) BUILDARCH=HP10 TARGET_BITS=TARGET_32BIT ;; hp11) BUILDARCH=HP11 TARGET_BITS=TARGET_32BIT ;; hp11-64) BUILDARCH=HP1164 TARGET_BITS=TARGET_64BIT ;; irix65) BUILDARCH=IRIX65 TARGET_BITS=TARGET_64BIT ;; lx24-alpha) BUILDARCH=ALINUX COMPILE_ARCH=ALINUX_24 TARGET_BITS=TARGET_64BIT ;; lx26-alpha) BUILDARCH=ALINUX COMPILE_ARCH=ALINUX_26 TARGET_BITS=TARGET_64BIT ;; lx24-amd64) BUILDARCH=LINUXAMD64 COMPILE_ARCH=LINUXAMD64_24 TARGET_BITS=TARGET_64BIT ;; lx26-amd64) BUILDARCH=LINUXAMD64 COMPILE_ARCH=LINUXAMD64_26 TARGET_BITS=TARGET_64BIT ;; lx24-ia64) BUILDARCH=LINUXIA64 COMPILE_ARCH=LINUXIA64_24 TARGET_BITS=TARGET_64BIT ;; lx26-mips) BUILDARCH=LINUXMIPS COMPILE_ARCH=LINUXMIPS_26 TARGET_BITS=TARGET_32BIT ;; lx26-mips64) BUILDARCH=LINUXMIPS64 COMPILE_ARCH=LINUXMIPS64_26 TARGET_BITS=TARGET_64BIT ;; lx26-ppc) BUILDARCH=LINUXPPC COMPILE_ARCH=LINUXPPC_26 TARGET_BITS=TARGET_32BIT ;; lx26-ppc64) BUILDARCH=LINUXPPC64 COMPILE_ARCH=LINUXPPC64_26 TARGET_BITS=TARGET_64BIT ;; lx26-ia64) BUILDARCH=LINUXIA64 COMPILE_ARCH=LINUXIA64_26 TARGET_BITS=TARGET_64BIT ;; lx26-s390) BUILDARCH=LINUXS390 COMPILE_ARCH=LINUXS390_26 TARGET_BITS=TARGET_32BIT ;; lx26-s390x) BUILDARCH=LINUXS390X COMPILE_ARCH=LINUXS390X_26 TARGET_BITS=TARGET_64BIT ;; lx24-sparc) BUILDARCH=LINUXSPARC COMPILE_ARCH=LINUXSPARC_24 TARGET_BITS=TARGET_32BIT ;; lx24-sparc64) BUILDARCH=LINUXSPARC64 COMPILE_ARCH=LINUXSPARC64_24 TARGET_BITS=TARGET_64BIT ;; lx26-sparc) BUILDARCH=LINUXSPARC COMPILE_ARCH=LINUXSPARC_26 TARGET_BITS=TARGET_32BIT ;; lx26-sparc64) BUILDARCH=LINUXSPARC64 COMPILE_ARCH=LINUXSPARC64_26 TARGET_BITS=TARGET_64BIT ;; lx24-x86) BUILDARCH=LINUX86 COMPILE_ARCH=LINUX86_24 TARGET_BITS=TARGET_32BIT ;; lx26-x86) BUILDARCH=LINUX86 COMPILE_ARCH=LINUX86_26 TARGET_BITS=TARGET_32BIT ;; ulx24-alpha) BUILDARCH=ALINUX COMPILE_ARCH=UALINUX_24 TARGET_BITS=TARGET_64BIT ;; ulx26-alpha) BUILDARCH=ALINUX COMPILE_ARCH=UALINUX_26 TARGET_BITS=TARGET_64BIT ;; ulx24-amd64) BUILDARCH=LINUXAMD64 COMPILE_ARCH=ULINUXAMD64_24 TARGET_BITS=TARGET_64BIT ;; ulx26-amd64) BUILDARCH=LINUXAMD64 COMPILE_ARCH=ULINUXAMD64_26 TARGET_BITS=TARGET_64BIT ;; ulx24-ia64) BUILDARCH=LINUXIA64 COMPILE_ARCH=ULINUXIA64_24 TARGET_BITS=TARGET_64BIT ;; ulx26-ppc) BUILDARCH=LINUXPPC COMPILE_ARCH=ULINUXPPC_26 TARGET_BITS=TARGET_32BIT ;; ulx26-ia64) BUILDARCH=LINUXIA64 COMPILE_ARCH=ULINUXIA64_26 TARGET_BITS=TARGET_64BIT ;; ulx24-sparc) BUILDARCH=LINUXSPARC COMPILE_ARCH=ULINUXSPARC_24 TARGET_BITS=TARGET_32BIT ;; ulx24-sparc64) BUILDARCH=LINUXSPARC64 COMPILE_ARCH=ULINUXSPARC64_24 TARGET_BITS=TARGET_64BIT ;; ulx26-sparc) BUILDARCH=LINUXSPARC COMPILE_ARCH=ULINUXSPARC_26 TARGET_BITS=TARGET_32BIT ;; ulx26-sparc64) BUILDARCH=LINUXSPARC64 COMPILE_ARCH=ULINUXSPARC64_26 TARGET_BITS=TARGET_64BIT ;; ulx24-x86) BUILDARCH=LINUX86 COMPILE_ARCH=ULINUX86_24 TARGET_BITS=TARGET_32BIT ;; ulx26-x86) BUILDARCH=LINUX86 COMPILE_ARCH=ULINUX86_26 TARGET_BITS=TARGET_32BIT ;; necsx4) BUILDARCH=NECSX4 TARGET_BITS=TARGET_64BIT ;; necsx5) BUILDARCH=NECSX5 TARGET_BITS=TARGET_64BIT ;; necsx6) BUILDARCH=NECSX5 TARGET_BITS=TARGET_64BIT ;; sx) BUILDARCH=NECSX5 TARGET_BITS=TARGET_64BIT ;; nbsd-alpha) BUILDARCH=NETBSD_ALPHA TARGET_BITS=TARGET_64BIT ;; nbsd-i386) BUILDARCH=NETBSD_I386 TARGET_BITS=TARGET_32BIT ;; nbsd-powerpc) BUILDARCH=NETBSD_POWERPC TARGET_BITS=TARGET_32BIT ;; nbsd-sparc64) BUILDARCH=NETBSD_SPARC64 TARGET_BITS=TARGET_64BIT ;; nbsd-x86_64) BUILDARCH=NETBSD_X86_64 TARGET_BITS=TARGET_64BIT ;; sol-sparc) BUILDARCH=SOLARIS TARGET_BITS=TARGET_32BIT ;; sol-sparc64) BUILDARCH=SOLARIS64 TARGET_BITS=TARGET_64BIT ;; sol-x86) BUILDARCH=SOLARIS86 TARGET_BITS=TARGET_32BIT ;; sol-amd64) BUILDARCH=SOLARISAMD64 TARGET_BITS=TARGET_64BIT ;; usol-sparc) BUILDARCH=SOLARIS COMPILE_ARCH=USOLARIS TARGET_BITS=TARGET_32BIT ;; usol-sparc64) BUILDARCH=SOLARIS64 COMPILE_ARCH=USOLARIS64 TARGET_BITS=TARGET_64BIT ;; usol-x86) BUILDARCH=SOLARIS86 COMPILE_ARCH=USOLARIS86 TARGET_BITS=TARGET_32BIT ;; usol-amd64) BUILDARCH=SOLARISAMD64 COMPILE_ARCH=USOLARISAMD64 TARGET_BITS=TARGET_64BIT ;; tru64) BUILDARCH=ALPHA5 TARGET_BITS=TARGET_64BIT ;; win32-x86) BUILDARCH=WIN32_X86 TARGET_BITS=TARGET_32BIT ;; *) echo cannot compile - no mapping for architecture \"$buildarch\" defined yet exit 1 ;; esac case "$option" in -b) echo $BUILDARCH;; -t) echo $TARGET_BITS;; -c) echo $COMPILE_ARCH;; *) echo "invalid option $option" exit 1;; esac