diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-07-24 00:48:53 +0530 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-07-24 00:49:59 +0530 |
commit | bdb28a62cedc0b8beb5fae32ca30e7eb8c15e672 (patch) | |
tree | 37e4bae88a3506cad638a4c4797f1cb28a4996cb /config | |
parent | 28440a4087b40a0890f8b028ed9857f6515d7a53 (diff) | |
download | libgd-bdb28a62cedc0b8beb5fae32ca30e7eb8c15e672.tar.gz |
getver.pl: make it work regardless of cwd
If you try to run getver.pl from any dir other than the top source tree,
it won't be able to locate gd.h. Use the FindBin module to handle this.
Diffstat (limited to 'config')
-rwxr-xr-x | config/getver.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/config/getver.pl b/config/getver.pl index 3838952..52f1b58 100755 --- a/config/getver.pl +++ b/config/getver.pl @@ -8,11 +8,14 @@ use strict; +use FindBin; + my $key = shift; my @version_parts = (); +my $dir = $FindBin::Bin; -open FH, "<src/gd.h" # old-style filehandle for max. portability - or die "Unable to open 'version.h' for reading.\n"; +open FH, "<$dir/../src/gd.h" # old-style filehandle for max. portability + or die "Unable to open 'gd.h' for reading.\n"; while(<FH>) { next unless m{version605b5d1778}; |