#!/usr/gnu/bin/perl -w # # Name: # makeMake.pl. # # Purpose: # 1 Scan $PATH looking for the location of .../Perl/Site/Lib, # for use in perl Makefile.PL LIB=C:\Perl\Site\Lib. # 2 Run ...>perl Makefile.PL LIB=$SITE_LIB. # 3 Run ...>perl ..\patchMake.pl -package Win32 -subPackage any -verbose # # Author: # Ron Savage # http://savage.net.au/index.html # # Licence: # Australian Copyright (c) 1999-2002 Ron Savage. # # All Programs of mine are 'OSI Certified Open Source Software'; # you can redistribute them and/or modify them under the terms of # The Artistic License, a copy of which is available at: # http://www.opensource.org/licenses/index.html use strict; use Cwd; my($cwd) = cwd(); my(@path) = split(/;/, $ENV{'PATH'}); my($site) = ''; # Find Site/Lib. for (@path) { if (-e "$_/perl.exe") { $site = "$_/../Site/Lib"; if (-d $site) { chdir($site) || die("Can't chdir($site): $!"); $site = cwd(); } } } die("Can't find Site/Lib") if (! $site); # Go home. chdir($cwd) || die("Can't chdir($cwd): $!"); # Patch makefiles. `perl Makefile.PL LIB=$site`; # Success. exit(0);