aboutsummaryrefslogtreecommitdiffstats
path: root/check_needs.pl
blob: 9eba196475bbf3414edc9ab2ce204871a10783ce (plain)
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
#!/usr/bin/perl

sub findprog($)
{
	foreach(split(/:/, $ENV{PATH})) {
		return "$_/$_[0]" if(-x "$_/$_[0]");
	}
}

sub need_program
{
	my $prog = shift;
	my $pkgname = shift;

	return if findprog($prog);
	print "please install \"$prog\", otherwise, build won't work.";
	print " This program is generally found at \"$pkgname\" package." if ($pkgname);
	print "\n";

	die "need $prog";
}

need_program "git";
need_program "make";
need_program "gcc";
need_program "patch";
need_program "lsdiff", "patchutils";

Privacy Policy