/[svn]/linux scripts/hlds_run
ViewVC logotype

Diff of /linux scripts/hlds_run

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 45 by cstrike, Tue Sep 23 19:35:40 2008 UTC revision 46 by cstrike, Tue Mar 24 01:09:31 2009 UTC
# Line 22  Line 22 
22          CRASH_DEBUG_MSG="email debug.log to linux@valvesoftware.com"          CRASH_DEBUG_MSG="email debug.log to linux@valvesoftware.com"
23          GDB="gdb" # the gdb binary to run          GDB="gdb" # the gdb binary to run
24          DEBUG_LOG="debug.log"          DEBUG_LOG="debug.log"
25          PID_FILE="" # only needed if DEBUG is set so init later          PID_FILE="" # only needed it DEBUG is set so init later
26          STEAM=""          STEAM=""
27          PID_FILE_SET=0          PID_FILE_SET=0
28          STEAMERR=""          STEAMERR=""
# Line 151  Line 151 
151                  quit 1                  quit 1
152          fi          fi
153    
154          #if test 1 -eq $PID_FILE_SET && test -n "$PID_FILE"; then          if test 1 -eq $PID_FILE_SET && test -n "$PID_FILE"; then
155          #       HL_CMD="$HL $PARAMS -pidfile $PID_FILE"                  HL_CMD="$HL $PARAMS -pidfile $PID_FILE"
156          #else          else
157                  HL_CMD="$HL $PARAMS"                  HL_CMD="$HL $PARAMS"
158          #fi          fi
159  }  }
160    
161  syntax () {  syntax () {
# Line 233  Line 233 
233          # Attempts to auto detect the CPU          # Attempts to auto detect the CPU
234          echo "Auto detecting CPU"          echo "Auto detecting CPU"
235    
236          if test -e /proc/cpuinfo; then          if test "FreeBSD" = `uname`; then
237                  CPU_VERSION="`grep "cpu family" /proc/cpuinfo | cut -f2 -d":" | tr -d " " | uniq`";                  PROC="/usr/compat/linux/proc"
238            else
239                    PROC="/proc"
240            fi
241    
242            if test -e $PROC/cpuinfo; then
243                    CPU_VERSION="`grep "cpu family" $PROC/cpuinfo | cut -f2 -d":" | tr -d " " | uniq`";
244                  if test $CPU_VERSION -lt 4; then                  if test $CPU_VERSION -lt 4; then
245                          echo "Error: hlds_l REQUIRES a 486 CPU or better";                          echo "Error: hlds_l REQUIRES a 486 CPU or better";
246                          quit 1                          quit 1
247          #       elif  test $CPU_VERSION -eq 15; then                  elif test $CPU_VERSION -ge 15; then
248          #               # P4 CPU version                          # Core 2 or greater
249          #               echo "Using Pentium II Optimised binary."                          echo "Using AMD Optimised binary."
250          #               HL=./hlds_i686                          HL=./hlds_amd
         #  
251                  elif test $CPU_VERSION -ge 6; then                  elif test $CPU_VERSION -ge 6; then
252                          AMD="`grep AMD /proc/cpuinfo`";                          AMD="`grep AMD $PROC/cpuinfo`";
253                          if test -n "$AMD"; then                          if test -n "$AMD"; then
                                 OPTERON="`grep Opteron /proc/cpuinfo`";  
                                 PLATFORM="`uname -m`"  
                                 if test -z "$OPTERON"; then  
                                         OPTERON="`grep "Athlon HX" /proc/cpuinfo`";  
                                         if test -z "$OPTERON"; then  
                                                 OPTERON="`grep "Athlon(tm) 64" /proc/cpuinfo`";  
                                         fi  
                                 fi  
   
                                 if test -n "$OPTERON" && test "x86_64" = "$PLATFORM"; then  
                                         echo "Using AMD-Opteron (64 bit) Optimised binary."  
                                         HL=./hlds_amd  
                                 else  
254                                          echo "Using AMD Optimised binary."                                          echo "Using AMD Optimised binary."
255                                          HL=./hlds_amd                                          HL=./hlds_amd
                                 fi  
256                          else                          else
257                                  echo "Using Pentium II Optimised binary."                                  echo "Using Pentium II Optimised binary."
258    
259                                  # there is a CPU manufactured by VIA that                                  # there is a CPU manufactured by VIA that
260                                  # doesn't support some PII instructions...                                  # doesn't support some PII instructions...
261                                  # detect this.                                  # detect this.
262                                  VIACHIP=`grep CentaurHauls /proc/cpuinfo`                                  VIACHIP=`grep CentaurHauls $PROC/cpuinfo`
263    
264                                  if test -z "$VIACHIP"; then                                  if test -z "$VIACHIP"; then
265                                          HL=./hlds_i686                                          HL=./hlds_i686
# Line 277  Line 268 
268                  else                  else
269                          echo "Using default binary."                          echo "Using default binary."
270                  fi                  fi
   
271          elif test "FreeBSD" = `uname`; then          elif test "FreeBSD" = `uname`; then
272                  CPU="`grep 'CPU:' /var/run/dmesg.boot`"                  CPU="`grep 'CPU:' /var/run/dmesg.boot`"
273                  AMD="`echo $CPU |grep AMD`"                  AMD="`echo $CPU |grep AMD`"
274                    K8="`echo $CPU |grep K8`"
275                  I686="`echo $CPU |grep 686`"                  I686="`echo $CPU |grep 686`"
276                  if test -n "$AMD"; then                  if test -n "$AMD"; then
277                          echo "Using AMD Optimised binary."                          echo "Using AMD Optimised binary."
278                          HL=./hlds_amd                          HL=./hlds_amd
279                    elif test -n "$K8" ; then
280                            echo "Using AMD Optimised binary."
281                            HL=./hlds_amd
282                  elif test -n "$I686" ; then                  elif test -n "$I686" ; then
283                          echo "Using Pentium II Optimised binary."                          echo "Using Pentium II Optimised binary."
284                          HL=./hlds_i686                          HL=./hlds_i686

Legend:
Removed from v.45  
changed lines
  Added in v.46

Contact webmaster
ViewVC Help
Powered by ViewVC RSS 2.0 feed