1 #!/usr/bin/ksh
   2 #
   3 #
   4 # This file and its contents are supplied under the terms of the
   5 # Common Development and Distribution License ("CDDL"), version 1.0.
   6 # You may only use this file in accordance with the terms of version
   7 # 1.0 of the CDDL.
   8 #
   9 # A full copy of the text of the CDDL should have accompanied this
  10 # source.  A copy of the CDDL is also available via the Internet at
  11 # http://www.illumos.org/license/CDDL.
  12 #
  13 
  14 #
  15 # Copyright (c) 2019, Joyent, Inc.
  16 #
  17 
  18 unalias -a
  19 
  20 check_env()
  21 {
  22         if which "$1" 2>/dev/null >/dev/null; then
  23                 return
  24         fi
  25 
  26         [[ -f "$1" ]] || {
  27                 echo "failed to find $1" >&2
  28                 exit 1
  29         }
  30 }
  31 
  32 check_env as
  33 check_env ctfconvert
  34 check_env ctfmerge
  35 check_env elfdump
  36 check_env gcc
  37 check_env g++
  38 check_env ld
  39 check_env make