xref: /illumos-gate/usr/src/test/util-tests/tests/ctf/precheck.ksh (revision ca783257c986cddcc674ae22916a6766b98a2d36)
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
18unalias -a
19
20check_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
32check_env gas
33check_env ctfconvert
34check_env ctfmerge
35check_env elfdump
36check_env gcc
37check_env g++
38check_env ld
39check_env make
40