Command ar not found #210

Closed
FROGGS opened this Issue Jan 1, 2012 · 13 comments

Projects

None yet

2 participants

@FROGGS
Member
FROGGS commented Jan 1, 2012

ar is found when running configure, but later is missing when running make.

Do we have to add that PATH stuff to make command too?

Configuring package 'SDL'...
(cmd: PATH="/export/home/cpantest/.cpan/build/Alien-SDL-1.428_5-yjnZIO/sharedir/1.428_5_6faa3310/bin:$PATH:/usr/ccs/bin:/usr/xpg4/bin:/usr/sfw/bin:/usr/xpg6/bin:/usr/bin" ./configure --prefix=...")
[...]
checking for ar... ar
[...]
Running make install SDL...
(cmd: make install)
[...]
./libtool: line 963: ar: command not found
´´´
@FROGGS FROGGS was assigned Jan 1, 2012
@kmx
Member
kmx commented Jan 1, 2012

I guess using:

PATH=/blex/blex:$PATH:/blex/blex/bin:/blex/bin make install

should do the trick.

@FROGGS
Member
FROGGS commented Jan 1, 2012

Hmmmm, I did this and made a dev release:

PerlGameDev/Alien-SDL@26c31bc

Because configure does find it... Google tells me that ar should be in /usr/ccs/bin.

Where do you get that blex from?

@kmx
Member
kmx commented Jan 1, 2012

"blex" was just a placeholder

Of course it sould be:

PATH=[exactly_the_same_values_as_by_configure] make install

@FROGGS
Member
FROGGS commented Jan 1, 2012

Meh, who should ever know that? ;o)

@kmx
Member
kmx commented Jan 2, 2012

The difference between calling ./configure and make install is:

1/ system('PATH=/path/to/some/dir ./configure --param=x')

2/ system('PATH=/path/to/some/dir', 'make', 'install')

(sorry for not having a look at source code before)

The case 1/ works as it is executed via shell, the second one fails as it tries "direct execution" and "PATH=..." is obviously not correct command.

Workaround might be (untested):

{
  ...
  my @cmd = ($self->_get_make, 'install');
  local $ENV{PATH};
  if ($^O eq 'solaris') {
    my $extra_PATH = "";
    for (qw[/usr/ccs/bin /usr/xpg4/bin /usr/sfw/bin /usr/xpg6/bin /usr/gnu/bin /opt/gnu/bin /usr/bin]) {
      $extra_PATH .= ":$_" if -d $_;
    }
    $ENV{PATH}="$PATH$extra_PATH";
  }
  $self->do_system(@cmd);
  ...
}
@FROGGS
Member
FROGGS commented Jan 2, 2012

Why do I have to make $ENV{PATH} local?

Shouldnt it work to set $ENV{PATH} right before calling configure? (the make call is in the same sub).

Its a pity that my solaris vm wont boot...

@kmx
Member
kmx commented Jan 2, 2012

after making $ENV{PATH} local you do not need to care about restoring the original value

You are right, you can set $ENV{PATH} before calling ./configure and it shoud do the same job (my guess) as calling "PATH=[value] ./configure --praram=[value]"

@FROGGS
Member
FROGGS commented Jan 2, 2012

Great! So I will put that before ./configure and make it local.

@FROGGS
Member
FROGGS commented Jan 2, 2012

Okay, I didnt made it local now, since when I make it local the content is gone.

I made a dev release right now btw. I guess we will see in 24h if it works or not.

Thanks so far buddy!

@kmx
Member
kmx commented Jan 2, 2012

Okay, I didnt made it local now, since when I make it local the content is gone.

This is strange - perhaps something like this is necessary:

{
  my $orig_PATH = $ENV{PATH};
  local $ENV{PATH};
  ...
  $ENV{PATH}="$orig_PATH$extra_PATH";
  ...
}
@FROGGS
Member
FROGGS commented Jan 2, 2012

Ya, that should work.

I will change it with next release.

@FROGGS FROGGS closed this Jan 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment