Skip to content

Commit

Permalink
CC path
Browse files Browse the repository at this point in the history
  • Loading branch information
adamyg committed Nov 29, 2024
1 parent d29b24d commit f34ec22
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions makelib.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/perl
# $Id: makelib.pl,v 1.148 2024/07/13 13:11:12 cvsuser Exp $
# $Id: makelib.pl,v 1.149 2024/11/29 19:21:56 cvsuser Exp $
# Makefile generation under WIN32 (MSVC/WATCOMC/MINGW) and DJGPP.
# -*- perl; tabs: 8; indent-width: 4; -*-
# Automake emulation for non-unix environments.
Expand Down Expand Up @@ -58,6 +58,7 @@ BEGIN
use File::Spec;
use File::Copy; # copy()
use File::Basename;
use File::Which;
use POSIX 'asctime';
use Data::Dumper;
use Text::ParseWords;
Expand Down Expand Up @@ -2255,12 +2256,23 @@ BEGIN

if (!defined $$env{COMPILERPATH} || $$env{COMPILERPATH} eq '') {
if (exists $$env{COMPILERPATHS}) {
my @PATHS = split(/\|/, $$env{COMPILERPATHS});
foreach (@PATHS) {
my $path = ExpandENV($_);
if (-e $path && -d $path) {
$$env{COMPILERPATH} = realpath($path);
last;
my $compilerpath = which $$env{CC};
if ($compilerpath) { # resolved path
$$env{COMPILERPATH} = dirname($compilerpath);

} else {
my @PATHS = split(/\|/, $$env{COMPILERPATHS});
foreach (@PATHS) {
my $path = ExpandENV($_);
if (-e $path && -d $path) {
$compilerpath = realpath($path);
my $ccpath = "${compilerpath}/".$$env{CC};

if (-f $ccpath || -f "${ccpath}.exe") {
$$env{COMPILERPATH} = $compilerpath;
last;
}
}
}
}
}
Expand All @@ -2272,9 +2284,6 @@ BEGIN
if (exists $$env{COMPILERPATH});
}

$x_compiler = ExpandENV($$env{COMPILERPATH}).'/'
if (exists $$env{COMPILERPATH});

$x_compiler .= $$env{CC};
$x_compiler =~ s/\//\\/g;
$x_command = "\"$x_compiler\" ";
Expand Down

0 comments on commit f34ec22

Please sign in to comment.