xref: /openbsd/usr.bin/libtool/LT/Util.pm (revision 4cfece93)
1# $OpenBSD: Util.pm,v 1.6 2014/04/16 10:31:27 zhuk Exp $
2
3# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
4# Copyright (c) 2012 Marc Espie <espie@openbsd.org>
5#
6# Permission to use, copy, modify, and distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18use strict;
19use warnings;
20package LT::Util;
21require Exporter;
22our @ISA = qw(Exporter);
23our @EXPORT = qw(abs_dir $ltdir $version shortdie);
24use File::Basename;
25use Cwd;
26
27our $ltdir = '.libs';
28our $version = '1.5.26'; # pretend to be this version of libtool
29
30sub abs_dir
31{
32	my $a = shift;
33	return dirname(Cwd::abs_path($a));
34}
35
36sub shortdie
37{
38	$SIG{__DIE__} = 'DEFAULT';
39	die @_;
40}
41
421;
43