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