xref: /illumos-gate/usr/src/test/util-tests/tests/ctf/precheck.ksh (revision 23c2e9a7f93c300498401f18385284ef6417fc2c)
13eca6103SJohn Levon#!/usr/bin/ksh
23eca6103SJohn Levon#
33eca6103SJohn Levon#
43eca6103SJohn Levon# This file and its contents are supplied under the terms of the
53eca6103SJohn Levon# Common Development and Distribution License ("CDDL"), version 1.0.
63eca6103SJohn Levon# You may only use this file in accordance with the terms of version
73eca6103SJohn Levon# 1.0 of the CDDL.
83eca6103SJohn Levon#
93eca6103SJohn Levon# A full copy of the text of the CDDL should have accompanied this
103eca6103SJohn Levon# source.  A copy of the CDDL is also available via the Internet at
113eca6103SJohn Levon# http://www.illumos.org/license/CDDL.
123eca6103SJohn Levon#
133eca6103SJohn Levon
143eca6103SJohn Levon#
153eca6103SJohn Levon# Copyright (c) 2019, Joyent, Inc.
163eca6103SJohn Levon#
173eca6103SJohn Levon
183eca6103SJohn Levonunalias -a
193eca6103SJohn Levon
203eca6103SJohn Levoncheck_env()
213eca6103SJohn Levon{
223eca6103SJohn Levon	if which "$1" 2>/dev/null >/dev/null; then
233eca6103SJohn Levon		return
243eca6103SJohn Levon	fi
253eca6103SJohn Levon
263eca6103SJohn Levon	[[ -f "$1" ]] || {
273eca6103SJohn Levon		echo "failed to find $1" >&2
283eca6103SJohn Levon		exit 1
293eca6103SJohn Levon	}
303eca6103SJohn Levon}
313eca6103SJohn Levon
32*23c2e9a7SRobert Mustacchicheck_env gas
333eca6103SJohn Levoncheck_env ctfconvert
343eca6103SJohn Levoncheck_env ctfmerge
353eca6103SJohn Levoncheck_env elfdump
363eca6103SJohn Levoncheck_env gcc
373eca6103SJohn Levoncheck_env g++
383eca6103SJohn Levoncheck_env ld
393eca6103SJohn Levoncheck_env make
40