#!/usr/bin/perl
#
# Build REMUSER_HOST array
#
#
#    ========== licence begin  GPL
#    Copyright (C) 2001 SAP AG
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the GNU General Public License
#    as published by the Free Software Foundation; either version 2
#    of the License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#    ========== licence end
#
use Env;

@REMUSER_HOST=();
@REMUSER_BIT64MODE=();

unless ($ENV{APOMAKE})
{
	$REMUSER_HOST{'aix32'}          = "is8802";
	$REMUSER_HOST{'aix64'}          = "is8802";
	$REMUSER_BIT64MODE{'aix64'}     = "BIT64";
	$REMUSER_ALIAS{'aix'}="aix64";

    $REMUSER_HOST{'sun32'}          = "us8802";
    $REMUSER_HOST{'sun64'}          = "us8802";
    $REMUSER_BIT64MODE{'sun64'}     = "BIT64";
    $REMUSER_ALIAS{'sun'}           = "sun64";

	$REMUSER_HOST{'hp32'}           = "hs8802";
	$REMUSER_HOST{'hp64'}           = "hs8802";
	$REMUSER_BIT64MODE{'hp64'}      = "BIT64";
	$REMUSER_ALIAS{'hp'}="hp64";


	$REMUSER_HOST{'hpia64'}           = "hs0125";
	$REMUSER_BIT64MODE{'hpia64'}      = "BIT64";

	$REMUSER_HOST{'dec'}            = "ds0124";
	$REMUSER_BIT64MODE{'dec'}       = "BIT64";
	$REMUSER_ALIAS{'alphaosf'}      = "dec";

	$REMUSER_HOST{'sni32'}          = "ss8802";
	$REMUSER_HOST{'sni64'}          = "ss8802";
	$REMUSER_BIT64MODE{'sni64'}     = "BIT64";
	$REMUSER_ALIAS{'sni'}="sni64";
	#$REMUSER_ALIAS{'nocona'}        = "linuxx86_64";

	$REMUSER_HOST{'linux'}          = "ls8800";

#	$REMUSER_HOST{'linuxia64'}      = "itanium82";
	#$REMUSER_BIT64MODE{'linuxia64'} = "BIT64";
	#$REMUSER_HOST{'linuxia64'}           = "ld0147.wdf.sap.corp";
	#$REMUSER_BIT64MODE{'linuxia64'}      = "BIT64";

	$REMUSER_ALIAS{'linuxia64'}="linuxia64_9";


	#$REMUSER_HOST{'ia64'}           = "p31821";
	#$REMUSER_BIT64MODE{'ia64'}      = "BIT64";
	$REMUSER_HOST{'ia64'}           = "pwdf2028";
	$REMUSER_BIT64MODE{'ia64'}      = "BIT64";


	$REMUSER_HOST{'nocona'}           = "nocona01";
	$REMUSER_BIT64MODE{'nocona'}      = "BIT64";

	#$REMUSER_HOST{'linuxx86_64'}           = "nocona01";
	$REMUSER_BIT64MODE{'linuxx86_64'}      = "BIT64";
	$REMUSER_HOST{'linuxx86_64'}           = "ls3105.wdf.sap.corp";


	$REMUSER_BIT64MODE{'linuxx86_64'}      = "BIT64";
	$REMUSER_HOST{'linuxia64_9'}           = "ld0405.wdf.sap.corp";
	#$REMUSER_HOST{'linuxia64_9'}           = "ld0147.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_9'}      = "BIT64";


	$REMUSER_HOST{'linuxia64_icc'}           = "ls3036.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_icc'}      = "BIT64";

	$REMUSER_HOST{'linuxia64_icc9'}           = "ls3237.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_icc9'}      = "BIT64";


	if ( $ENV{RELVER} lt "R76" )
	{
		$REMUSER_HOST{'aix52'}           = "is4002.wdf.sap.corp";
		$REMUSER_BIT64MODE{'aix52'}      = "BIT64";
	}



	$REMUSER_HOST{'s390x'}           = "ihls35.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_9'}      = "BIT64";


	$REMUSER_HOST{'ppc64'}           = "ls3663.wdf.sap.corp";
	$REMUSER_BIT64MODE{'ppc64'}      = "BIT64";

	$REMUSER_HOST{'sun_bench'}           = "us7033";
	$REMUSER_BIT64MODE{'sun_bench'}      = "BIT64";

	$REMUSER_HOST{'suse9'}           = "p132321.dhcp.ber.sap.corp/ssh";

	#-----------------------------------------
	# Release specific mappings
	#
	$REMUSER_HOST{'linux_8.0'}    = "ls8801";
	$REMUSER_HOST{'linux_7.6'}    = "ls8801";
	$REMUSER_HOST{'linux_7.7'}    = "ls8801";
	$REMUSER_HOST{'linux_7.5'}    = "ls8801";
	$REMUSER_HOST{'linux_7.4'}    = "ls8801";
	$REMUSER_HOST{'linux_7.42'}   = "ls8801";
	$REMUSER_HOST{'linux_7.41'}   = "ls8801";
	$REMUSER_HOST{'linux_7.5'}    = "ls8801";
	$REMUSER_HOST{'linux_7.6'}    = "ls8801";
	$REMUSER_HOST{'sun_8.0'}      = "us8802";
	$REMUSER_HOST{'sun32_8.0'}    = "us8802";
	$REMUSER_HOST{'sun64_8.0'}    = "us8802";
	$REMUSER_HOST{'sun64_7.6'}    = "us4149";
	$REMUSER_HOST{'sun64_7.7'}    = "us4149";
	$REMUSER_HOST{'sun_7.4'}      = "us8802";
	$REMUSER_HOST{'sun_7.5'}      = "us8802";
	$REMUSER_HOST{'sun_7.6'}      = "us8802";
	$REMUSER_HOST{'sun32_7.4'}    = "us8802";
	$REMUSER_HOST{'sun64_7.4'}    = "us8802";
	$REMUSER_HOST{'sun_7.41'}     = "us8802";
	$REMUSER_HOST{'sun32_7.41'}   = "us8802";
	$REMUSER_HOST{'sun64_7.41'}   = "us8802";
	$REMUSER_HOST{'aix64_8.0'}    = "is8801";
	$REMUSER_HOST{'aix64_7.4'}    = "is8801";
	$REMUSER_HOST{'aix64_7.42'}   = "is8801";
	$REMUSER_HOST{'aix64_7.41'}   = "is8801";
	$REMUSER_HOST{'aix64_7.5'}    = "is8801";
	$REMUSER_HOST{'aix64_7.6'}    = "is4002.wdf.sap.corp";
	$REMUSER_HOST{'aix64_7.7'}    = "is4002.wdf.sap.corp";
	$REMUSER_HOST{'hp64_7.6'}    = "hs0015p2.wdf.sap.corp";
	$REMUSER_HOST{'hp64_7.7'}    = "hs0015p2.wdf.sap.corp";


	# temp make for the broken is8801
	$REMUSER_HOST{'aix64_7.41'}   = "is0027";
	$REMUSER_HOST{'aix64_7.42'}   = "is0027";
	$REMUSER_HOST{'aix64_7.43'}   = "is0027";
	$REMUSER_HOST{'aix64_7.5'}    = "is0027";


	#
	# List of platforms contained in 'all'
	#
	if ( $ENV{RELVER} ge "R74" ) {
	    $REMUSER_ALIAS{'all'}="aix64 dec hp64 linux sun64 ia64";
	    $REMUSER_ALIAS{'32bit'}="linux";
	    $REMUSER_ALIAS{'64bit'}="aix64 dec hp64 sun64 ia64";
	    $REMUSER_ALIAS{'unix'}="aix64 dec hp64 sun64 linux";
	    $REMUSER_ALIAS{'win'} ="ia64";
	    if (( ($ENV{RELVER} eq "R74") && $ENV{'CORRECTION_LEVEL'} ne "2" ) || ( $ENV{RELVER} ge "R74"))
	    {
	    	$REMUSER_ALIAS{'all'}.=" linuxia64_9";
	    	$REMUSER_ALIAS{'unix'}.=" linuxia64_9";
	    	$REMUSER_ALIAS{'64bit'}.=" linuxia64_9";
	    }
	    if ( $ENV{RELVER} ge "R75" )
	    {
	    	$REMUSER_ALIAS{'all'}.=" hpia64 linuxx86_64 ppc64";
	    	$REMUSER_ALIAS{'unix'}.=" hpia64 linuxx86_64 ppc64";
	    	$REMUSER_ALIAS{'64bit'}.=" hpia64 linuxx86_64 ppc64";
	    }
	    if ( $ENV{RELVER} eq "R75" )
	    {
	    	$REMUSER_ALIAS{'all'}.=" s390x";
	    	$REMUSER_ALIAS{'unix'}.=" s390x";
	    	$REMUSER_ALIAS{'64bit'}.=" s390x";
	    }
	}
	else
	{
        $REMUSER_ALIAS{'all'}="aix32 aix64 dec linux hp32 hp64 sun32 sun64 sni32 sni64";
        $REMUSER_ALIAS{'32bit'}="aix32 linux hp32 sun32 sni32";
        $REMUSER_ALIAS{'64bit'}="aix64 dec hp64 sun64 sni64 ia64";
        $REMUSER_ALIAS{'unix'}="aix32 aix64 dec hp32 hp64 sun32 sun64 linux sni32 sni64";
	    $REMUSER_ALIAS{'win'}="ia64";
	}
	$REMUSER_ALIAS{'alphaosf'} = "dec";
	$REMUSER_ALIAS{'hp_64'} = "hp64";
	$REMUSER_ALIAS{'sun_64'} = "sun64";
	$REMUSER_ALIAS{'NTia64'} = "ia64";
	$REMUSER_ALIAS{'linuxintel'} = "linux";
	$REMUSER_ALIAS{'linuxppc'} = "ppc64";
	$REMUSER_ALIAS{'linuxs390x'} = "s390x";
	$REMUSER_ALIAS{'linuxs390x'} = "s390x";
	$REMUSER_ALIAS{'rs6000_52_64'} = "aix5";
	$REMUSER_ALIAS{'rs6000_51_64'} = "aix5";
	$REMUSER_ALIAS{'rs6000_64'} = "aix";




} else {

    if ($ENV{APO_COM_SHORT} ge "4000")
    { $REMUSER_ALIAS{'unix'}="aix5L64 dec hp64 sun64 linuxia64_9 hpia64";  }
    else
   	{ $REMUSER_ALIAS{'unix'}="aix64 aix5L64 dec hp64 sun64"; }

   	$REMUSER_ALIAS{'win'} ="ia64";
   	($ENV{APO_COM_SHORT} ge "5000") or $REMUSER_ALIAS{'win'} .=" win32";
    $REMUSER_ALIAS{'all'}="$REMUSER_ALIAS{'unix'} $REMUSER_ALIAS{'win'}";
    $REMUSER_ALIAS{'ntia64'} ="ia64";
    $REMUSER_ALIAS{'ntintel'} ="win32";
    $REMUSER_ALIAS{'linux'} ="linuxia64";
    $REMUSER_ALIAS{'alphaosf'}= "dec";

	if ($ENV{APO_COM_SHORT} ge "4000")
    { $REMUSER_ALIAS{'aix'}="aix5L64"; }
    else
    { $REMUSER_ALIAS{'aix'}="aix64"; }
    $REMUSER_ALIAS{'aix5'}="aix5L64";
	$REMUSER_ALIAS{'sun'}="sun64";
	$REMUSER_ALIAS{'hp'}="hp64 hpia64";

	$REMUSER_HOST{'aix64'}      = "is0028";
	$REMUSER_BIT64MODE{'aix64'} = "BIT64";

	#$REMUSER_HOST{'aix5L64'}      = "is4002";
	$REMUSER_HOST{'aix5L64'}      = "is0031";


	#$REMUSER_HOST{'aix5L64'}      = ( $ENV{APO_COM_SHORT} ge "4100" ? ) ? "is0041";
	$REMUSER_BIT64MODE{'aix5L64'} = "BIT64";
	if ( $ENV{APO_COM_SHORT} ge "50000")
	{	$REMUSER_HOST{'sun64'}      = "us0071"; }
	else
	{	$REMUSER_HOST{'sun64'}      = "us0068"; }

	$REMUSER_BIT64MODE{'sun64'} = "BIT64";

	if ( $ENV{APO_COM_SHORT} ge "50000")
	{	$REMUSER_HOST{'hp64'}      = "hs0021";  }
	elsif ( $ENV{APO_COM_SHORT} ge "40000")
	{	$REMUSER_HOST{'hp64'}      = "hs0110";  }
	else
	{	$REMUSER_HOST{'hp64'}      = "hs0004";	}
	$REMUSER_BIT64MODE{'hp64'} = "BIT64";

	$REMUSER_HOST{'hpia64'}      = "hs0121";
	$REMUSER_BIT64MODE{'hpia64'} = "BIT64";


	$REMUSER_HOST{'ia64'}           = "pwdf2028";
	$REMUSER_BIT64MODE{'ia64'}      = "BIT64";


	$REMUSER_HOST{'linuxppc64'}           = "ls3661.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxppc64'}      = "BIT64";

	$REMUSER_HOST{'linuxia64_icc'}           = "ls3036.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_icc'}      = "BIT64";

	$REMUSER_HOST{'linuxia64_icc9'}           = "ls3237.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_icc9'}      = "BIT64";

	#$REMUSER_HOST{'linuxia64'}           = "ld0147.wdf.sap.corp";
	#$REMUSER_BIT64MODE{'linuxia64'}      = "BIT64";


	$REMUSER_ALIAS{'linuxia64'}="linuxia64_9";
	$REMUSER_HOST{'linuxia64_9'}           = "ld0147.wdf.sap.corp";
	$REMUSER_BIT64MODE{'linuxia64_9'}      = "BIT64";

	$REMUSER_HOST{'win32'}           = "pwdf2028";


	if ( $ENV{APO_COM_SHORT} ge "40000")
	{	$REMUSER_HOST{'dec'}      = "ds0120"; 	}
	else
	{	$REMUSER_HOST{'dec'}      = "ds0118"; }

	$REMUSER_BIT64MODE{'dec'} = "BIT64";

	$REMUSER_BIT64MODE{'linuxx86_64'}      = "BIT64";
	$REMUSER_HOST{'linuxx86_64'}           = "ls3105.wdf.sap.corp";



}

if ( $ENV{RELVER} ge "R74" ) {
	$REMUSER_HOST{'aix32'} = "AIX_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'aix32_7.4'} = "AIX_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'aix32_7.42'} = "AIX_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'aix32_7.41'} = "AIX_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'hp32'} = "HP_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'hp32_7.4'} = "HP_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'hp32_7.42'} = "HP_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'hp32_7.41'} = "HP_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'sun32'} = "SUN_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'sun32_7.4'} = "SUN_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'sun32_7.42'} = "SUN_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'sun32_7.41'} = "SUN_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'sni32'} ="SNI_32bit_SAPDB_since_release_7.4_no_longer_supported";
	$REMUSER_HOST{'sni64'} ="SNI_32bit_SAPDB_since_release_7.4_no_longer_supported";
}


$REMUSER_HOSTMODE{"ls3036.wdf.sap.corp"}  = "WEB";
$REMUSER_HOSTMODE{'hs8802'}  = "WEB";
$REMUSER_HOSTMODE{'ld0147.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'ld0405.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'pwdf2028'}  = "WEB";
$REMUSER_HOSTMODE{'ls3105.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'is4002.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'ihls35.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'ls3663.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'hs0015p2.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'ls3663.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'ls3661.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'ls3237.wdf.sap.corp'}  = "WEB";
$REMUSER_HOSTMODE{'is4002'}  = "WEB";
$REMUSER_HOSTMODE{'pwdf2028'}  = "WEB";
$REMUSER_HOSTMODE{'hs0021'}  = "WEB";
$REMUSER_HOSTMODE{'us4149'}  = "WEB";
$REMUSER_HOSTMODE{'us7033'}  = "WEB";

if (defined $ENV{'LOCAL_REMUSER_MACH'} &&  -f $ENV{'LOCAL_REMUSER_MACH'})
{
	do "$ENV{'LOCAL_REMUSER_MACH'}";
}
