diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-05-30 15:23:15 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-05-30 15:23:15 +0100 |
commit | dd771be140c2cced8984f6f9887f5aab7af9e895 (patch) | |
tree | 3ac9dc5bd01ab5b80702fca3278ff7697a041487 /autogen.sh | |
parent | 313f54da3cf8bd6271d8d14f4dd1803c42ca4d58 (diff) |
initial attempt to avoid ugly errors with missing pkgconfig etc.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh index bf5b2670430d..6c301aee07a2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -11,6 +11,38 @@ sub clean() print "cleaned the build tree\n"; } +# check we have various vital tools +sub sanity_checks($) +{ + my $system = shift; + my @path = split (':', $ENV{'PATH'}); + my %required = ( + 'pkg-config' => "pkg-config is required to be installed", + 'autoconf' => "autoconf is required", + 'aclocal' => "aclocal is required", +# 'knurdle' => 'please knurdle me test' + ); + my $exe_ext = ''; + $exe_ext = ".exe" if ($system =~ m/CYGWIN/); + + for my $elem (@path) { +# print "check $elem\n"; + for my $app (keys %required) { + if (-f "$elem/$app$exe_ext") { +# print "removing $app - found in $elem/$app\n"; + delete $required{$app}; + } + } + } + if ((keys %required) > 0) { + print ("Various low-level dependencies are missing, please install them:\n"); + for my $app (keys %required) { + print "\t $app$exe_ext: " . $required{$app} . "\n"; + } + exit (1); + } +} + # one argument per line sub read_args($) { @@ -84,6 +116,8 @@ system ("touch ChangeLog"); my $system = `uname -s`; chomp $system; +sanity_checks ($system); + my $aclocal_flags = $ENV{ACLOCAL_FLAGS}; $aclocal_flags = "-I ./m4/mac" if (($aclocal_flags eq "") && ($system eq 'Darwin')); |