File: linux.x86_64.prep.sh

package info (click to toggle)
chromium-browser 57.0.2987.98-1~deb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,637,852 kB
  • ctags: 2,544,394
  • sloc: cpp: 12,815,961; ansic: 3,676,222; python: 1,147,112; asm: 526,608; java: 523,212; xml: 286,794; perl: 92,654; sh: 86,408; objc: 73,271; makefile: 27,698; cs: 18,487; yacc: 13,031; tcl: 12,957; pascal: 4,875; ml: 4,716; lex: 3,904; sql: 3,862; ruby: 1,982; lisp: 1,508; php: 1,368; exp: 404; awk: 325; csh: 117; jsp: 39; sed: 37
file content (85 lines) | stat: -rwxr-xr-x 2,155 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

##################################################################
#  Description: tool to examine an x86_64 linux system to look for
#  missing packages needed to develop for Native Client and help the
#  user to install any that are missing.  This makes many assumptions
#  about the linux distribution (Ubuntu) and version (Trusty Tahr) and
#  might not work for other distributions/versions.
##################################################################

PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin

umask=077
d=${TMPDIR:-/tmp}/nacl64.$$
if ! mkdir "$d" > /dev/null 2>&1
then
  cat >&2 << EOF
Could not create safe temporary directory "$d".

ABORTING.
EOF
  exit 1
fi
f="$d/x.c"
fout="$d/x"
trap 'rm -fr "$d"; exit' 0 1 2 3 15

function isRunningAsRoot() {
  whoami | grep -q 'root'
}


function ensure_installed {
  if ! [ -e "$1" ]
  then
    cat >&2 << EOF
... you do not have $2.  Installing...
EOF
    if apt-get -y install "$2" > /dev/null 2>&1
    then
      echo "... done" >&2
    else
      cat >&2 <<EOF
... failed to install $2.

ABORTING
EOF
      exit 1
    fi
  fi
}

if ! isRunningAsRoot
then
  cat >&2 << \EOF
Not running as root, so cannot install libraries/links.
Note: you probably will need to copy this script to the local file system
(and off of NFS) in order to run this script as root.

ABORTING.
EOF
  exit 1
fi

ensure_installed '/usr/lib/git-core/git-svn' 'git-svn'

if [ $(uname -m) != "x86_64" ]
then
  cat << \EOF
You do not appear to be using an x86_64 system.  This rest of this script
is not required.
EOF
  exit 0
fi

# libtinfo5 is needed by gdb
ensure_installed '/lib/i386-linux-gnu/libtinfo.so.5' 'libtinfo5:i386'
# glib is needed by qemu
ensure_installed '/lib/i386-linux-gnu/libglib-2.0.so.0' 'libglib2.0-0:i386'
# 32-bit libc headers and libraries
ensure_installed '/usr/include/i386-linux-gnu/asm/errno.h' 'linux-libc-dev:i386'
ensure_installed '/usr/share/doc/g++-4.8-multilib' 'g++-4.8-multilib'