#
# Copyright 1991-1998 by Open Software Foundation, Inc. 
#              All Rights Reserved 
#  
# Permission to use, copy, modify, and distribute this software and 
# its documentation for any purpose and without fee is hereby granted, 
# provided that the above copyright notice appears in all copies and 
# that both the copyright notice and this permission notice appear in 
# supporting documentation. 
#  
# OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
# FOR A PARTICULAR PURPOSE. 
#  
# IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
# LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 
# NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
#
# cmk1.1

on i386  target <undef> replace setenv ode_target i386
on ppc   target <undef> replace setenv ode_target powermac
on i860  target <undef> replace setenv ode_target i860
on hp_pa target <undef> replace setenv ode_target hp_pa

on i386 on_os linux target i386 setenv CARGS -D__NO_UNDERSCORES__
on_os linux setenv EXPORT_USING_TAR 1
on_os linux setenv LINUX 1

# Default target is self-hosted

on mips setenv MACHINE mips
on mips setenv TARGET_MACHINE PMAX
on mips setenv target_machine pmax 
on mmax setenv MACHINE mmax
on mmax setenv TARGET_MACHINE MMAX
on mmax setenv target_machine mmax
on alpha setenv MACHINE alpha 
on alpha setenv TARGET_MACHINE ALPHA
on alpha setenv target_machine alpha
on alpha setenv ALPHA_OBJECT_FORMAT COFF
on i386 setenv MACHINE i386
on i386 setenv TARGET_MACHINE AT386
on i386 setenv target_machine at386
on hp_pa setenv MACHINE hp_pa
on hp_pa setenv TARGET_MACHINE HP700
on hp_pa setenv target_machine hp700
on hp_pa setenv OBJECT_FORMAT SOM
on ppc setenv MACHINE ppc
on ppc setenv TARGET_MACHINE POWERMAC
on ppc setenv target_machine powermac
on ppc setenv OBJECT_FORMAT elf

# Remember the host machine, we might change our target
setenv HOST_MACHINE ${MACHINE}

#
# SQT specific
#
on i386 target sqt replace setenv TARGET_MACHINE SQT
on i386 target sqt replace setenv target_machine sqt

# For 860 builds, remove comment leader in following lines
# Also check the Buildconf.exp file
#
target i860 replace setenv MACHINE i860
target i860 replace setenv CROSS_MACHINE i860
target i860 replace setenv target_machine intel860
target i860 replace setenv TARGET_MACHINE INTEL860
target i860 replace setenv INTEL860_OBJECT_FORMAT COFF
target i860 setenv compiler_name icc

#
# PowerMac specific
#
target powermac replace setenv MACHINE ppc
target powermac replace setenv target_machine powermac
target powermac replace setenv TARGET_MACHINE POWERMAC
target powermac on i386 replace setenv CROSS_MACHINE ppc

setenv _POWERMAC_ELF_CFLAGS_ "-fsigned-char -fno-builtin"
## end of PowerMac build stuff

# use the tools from the shared sandbox by default, using target/host path

tools_base ${sandbox_base}/link/tools/${MACHINE}/${HOST_MACHINE}_osf1
on_os linux replace tools_base ${sandbox_base}/link/tools/${MACHINE}/${HOST_MACHINE}_linux

setenv GCC_LATEST 2_7_1
on_os linux replace setenv GCC_LATEST 2_7_2_1

replace setenv OBJECTDIR ../obj/${target_machine}
build_list /afs/ri/project/kernel/build_list
build_makeflags -r
setenv PROJECT_NAME OSC
setenv project_name osc
setenv RULES_MK osf.rules.mk
object_base ${sandbox_base}/obj/${target_machine}
source_base ${sandbox_base}/src
export_base ${sandbox_base}/export/${target_machine}
setenv SOURCEBASE ${source_base}
setenv EXPORTBASE ${export_base}
setenv MAKEDEFS makedefs
setenv PMKEXPORTLINK usr/mach3
setenv INCPREFIX usr/include
setenv LIBPREFIX usr/ccs/lib

# Set the availability of shared libraries for a given
# object format.
replace setenv MACHO_SHARED_LIBRARIES ""
replace setenv ELF_SHARED_LIBRARIES ""
#
replace setenv ELF_CC_EXEC_PREFIX "${tools_base}/elf/"
replace setenv MACHO_CC_EXEC_PREFIX "${tools_base}/macho/"
replace setenv COFF_CC_EXEC_PREFIX "${tools_base}/coff/"
replace setenv A_OUT_CC_EXEC_PREFIX "${tools_base}/a_out/"
replace setenv SOM_CC_EXEC_PREFIX "${tools_base}/som/"
replace setenv ARCHIVE_FORMAT OSFARCH
replace setenv TARGET_EXEC_PREFIX ${tools_base}/hostbin/
replace setenv SITE OSF
replace setenv OWNER bin
replace setenv GROUP bin
replace setenv PROJECT_NAME OSC
replace setenv project_name osc
replace setenv RULES_MK osf.rules.mk
replace setenv MAKESYSPATH ${export_base}/${PMKEXPORTLINK}/${MAKEDEFS}
replace setenv SOURCEDIR ""
replace setenv BACKED_SOURCEDIR ${source_base}
replace setenv MACH3_INCDIRS -I${export_base}/${PMKEXPORTLINK}/include
replace setenv MACH3_LIBDIRS -L${export_base}/${PMKEXPORTLINK}/lib
replace setenv INCDIRS "-I${export_base}/compiler-includes -I${export_base}/${INCPREFIX} ${MACH3_INCDIRS}"
replace setenv LIBDIRS "-L${export_base}/${LIBPREFIX} ${MACH3_LIBDIRS}"
replace setenv SHLIBDIRS -L${export_base}/usr/shlib
replace setenv MACHO_SHLIBDIRS -L${export_base}/usr/shlib
replace setenv ELF_SHLIBDIRS -L${export_base}/usr/lib
replace setenv SHLIBPATH "${export_base}/usr/lib"

replace setenv MIGCOM ${tools_base}/hostbin/migcom
replace setenv DEF_ARFLAGS cr
replace setenv LEXER ${source_base}/usr/ccs/lib/ncform
replace setenv YACCPAR ${source_base}/usr/ccs/lib/yaccpar
replace setenv FLEXSKEL ${source_base}/usr/ccs/lib/flex.skel

replace setenv MACH3_INCLUDE_IDIR       /${PMKEXPORTLINK}/include/

#
# Native builds on linux use the local compiler
#

on i386 on_os linux target i386     replace setenv ELF_CC_EXEC_PREFIX ""
on ppc  on_os linux target powermac replace setenv ELF_CC_EXEC_PREFIX ""

on_os linux unsetenv FLEXSKEL
on_os linux replace setenv MIGCC gcc
on_os linux replace setenv CPP "cc -E"
on_os linux replace setenv _ELF_PIC_ ""
