#!/bin/csh -f # getarch -- deterimine the architecture of the current platform # # Taken from WWW BUILD script: # Build all WWW Code for this platform # # Figure out what sort of unix this is # (NeXT machines don't have uname!) unalias ls mkdir rm ln set bin="no" set binlink="no" if ( "$#argv" >= 1 ) then if ( "$argv[1]" == "-bin" ) then set bin="yes" else if ( "$argv[1]" == "-link" ) then set binlink="yes" endif endif set UNAME="" if (-e /usr/bin/uname) set UNAME=`/usr/bin/uname` if (-e /bin/uname) set UNAME=`/bin/uname` if (-e /usr/apollo/bin) set UNAME=`ver sys5.3 /bin/uname` if (-e /usr/bin/ncrm) set UNAME=ncr if (-e /usr/bin/swconfig) set UNAME=sco if ( $UNAME == "" ) then if (-r /NextApps ) then hostinfo | grep I386 if ( $status == 0 ) then set UNAME=next-386 else set UNAME=next endif endif endif # setenv UNAME $UNAME # For apollo, must use bsd mode. Also, ARCH not inherited through make! if ($UNAME == next) setenv ARCH next if ($UNAME == next-386) setenv ARCH next-386 if ($UNAME == ncr) setenv ARCH ncr if ($UNAME == sco) then setenv ARCH sco setenv PATH "${PATH}:/usr/local/bin" endif if ($UNAME == "HP-UX") setenv ARCH snake if ($UNAME == "IRIX") setenv ARCH sgi if ($UNAME == "IRIX64") setenv ARCH sgi if ($UNAME == "SunOS") then set arch=`arch` set revision=`uname -r` if ($revision == 5.7 ) then setenv ARCH ${arch}-sol27 else if ($revision == 5.6 ) then setenv ARCH ${arch}-sol26 else if ($revision =~ 5.* ) then setenv ARCH ${arch}-sol2 else setenv ARCH ${arch} endif endif if ($UNAME == "ULTRIX") setenv ARCH decstation if ($UNAME == "AIX") setenv ARCH rs6000 if ($UNAME == "OSF1") setenv ARCH osf1 # if ($UNAME == "BSD/386") setenv ARCH unix if ($UNAME == "BSD/386") setenv ARCH bsdi if ($UNAME == "Linux") setenv ARCH linux if ($UNAME == "A/UX") setenv ARCH aux if ($UNAME == "SMP_DC.SOx") setenv ARCH pyramid if ($UNAME == "uts") then # differentiate between UTS 2 (SVR3/BSD) and UTS 4 (SVR4) set version=`uname -v` if ($version =~ 2.*) then setenv ARCH uts2 else setenv ARCH uts4 endif endif # FreeBDS -- contributed by Jean-Marc Zucconi # if ($UNAME == "FreeBSD") setenv ARCH freebsd # # ISC 3.0 (How can I tell I'm running on ISC 3.0 ???) # # set ARCH=isc3.0 # setenv ARCH isc3.0 # Lauren # # DELL Unix (How can I tell I'm running on DELL????) # # setenv ARCH dell # # Unisys Unix (How can I tell I'm running on Unisys????) # # setenv ARCH unisys if ($ARCH == "") then echo "ERROR: unknown architecture" exit -99 endif # if bin is no, just print the current architecture # this is used to compose a bin. (e.g., bin.`../getarch`) if ( "$bin" == "yes" ) then echo "Setting bin and lib links for architecture: $ARCH" rm -f bin ln -s bin.$ARCH bin test -d bin.$ARCH if ( $status != 0 ) then echo "Creating directory bin.$ARCH" mkdir bin.$ARCH else echo bin.$ARCH\: `ls -ld bin.$ARCH` endif rm -f lib ln -s lib.$ARCH lib test -d lib.$ARCH if ( $status != 0 ) then echo "Creating directory lib.$ARCH" mkdir lib.$ARCH else echo lib.$ARCH\: `ls -ld lib.$ARCH` endif else if ( "$binlink" == "yes" ) then # so far, we only need this capability in Solaris if ($UNAME == "SunOS") then set revision=`uname -r` if ($revision =~ 5.* ) then echo "Linking bin and lib directories for Solaris 2.5, 2.6, and 2.7" if ( -d bin.sun4-sol27 ) then ln -s bin.sun4-sol27 bin.sun4-sol2 ln -s bin.sun4-sol27 bin.sun4-sol26 ln -s lib.sun4-sol27 lib.sun4-sol2 ln -s lib.sun4-sol27 lib.sun4-sol26 else if ( -d bin.sun4-sol26 ) then ln -s bin.sun4-sol26 bin.sun4-sol2 ln -s bin.sun4-sol26 bin.sun4-sol27 ln -s lib.sun4-sol26 lib.sun4-sol2 ln -s lib.sun4-sol26 lib.sun4-sol27 else if ( -d bin.sun4-sol2 ) then ln -s bin.sun4-sol2 bin.sun4-sol26 ln -s bin.sun4-sol2 bin.sun4-sol27 ln -s lib.sun4-sol2 lib.sun4-sol26 ln -s lib.sun4-sol2 lib.sun4-sol27 else echo "No Solaris directory exists" endif endif endif else echo $ARCH endif