[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] gm2 cannot detect itself
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] gm2 cannot detect itself |
Date: |
Fri, 08 Oct 2010 20:36:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Manfred Hollstein <address@hidden> writes:
> On Tue, 05 Oct 2010, 17:19:56 +0200, Gaius Mulley wrote:
>> Martin Kalbfuss <address@hidden> writes:
>> > Hi,
>> >
>> > I’m working on a autoconf macro to detect gm2. The detection runs fine
>> > and returns the complete path to gm2. In my case it is /opt/gm2/bin/gm2.
>> > This works, even if it isn’t in PATH, bacaue it checks the two standard
>> > locations in /opt/gm2 and $HOME/opt. So let's compile? No. It isn’t
>> > working. Using the complete path to gm2 like
>> >
>> > address@hidden:~/Desktop/sk/schwarzerkaffee/examples
>> > $ /opt/gm2/bin/gm2 -fmakeall -o timer_callback timer_callback.mod
>> > -I../include/SK -l:../src/libsk.a -L/usr/lib -lSDL
>> >
>> > results in
>> >
>> > gm2 -c -fmakeall0 -ftarget-ranlib=/usr/bin/ranlib
>> > -ftarget-ar=/usr/bin/ar
>> > -fobject-path=../include/SK:/opt/gm2/lib/gcc/x86_64-linux-gnu/4.1.2/gm2/pim:/opt/gm2/lib/gcc/x86_64-linux-gnu/4.1.2/gm2/logitech
>> > -fmakeall
>> > -I../include/SK:/opt/gm2/lib/gcc/x86_64-linux-gnu/4.1.2/gm2/pim:/opt/gm2/lib/gcc/x86_64-linux-gnu/4.1.2/gm2/logitech
>> > timer_callback.mod
>> > make: gm2: Command not found
>> > make: *** [timer_callback.o] Error 127
>> >
>> > gm2 cannot detect itself. I asume, it's the created makefile which uses
>> > gm2 only instead of the complete path.
>> >
>> > Martin
>>
>> Hi Martin,
>>
>> thanks for the bug report - now under investigation - I presume the
>> correct behaviour, in this case, is for the -fmakeall to use argv[0] of
>> gm2. However if another gm2 is found along the PATH then which one
>> should take precedence?
>
> If argv[0] is an absolute path name for an existing file which can be
> executed, I'd trust it because it's probably the file that the caller
> has been attempting to invoke directly; this might be due to a shell
> having found it along $PATH, or, as I said, by a user specifying a
> special version. Something like the following should work from my point
> of view:
>
> if (access (argv[0], X_OK) == 0)
> {
> /* File exists, take its name and trust it... */
> }
> else
> {
> /* File name must have been found via $PATH, just use "gm2". */
> }
>
>> regards,
>> Gaius
>
> HTH, cheers.
>
> l8er
> manfred
Hi,
now fixed in the latest cvs - many thanks for the bug report and hints!
regards,
Gaius
* gm2/gm2spec.c: New function (add_B_prefix). Add
-B option to the command line if -fmakeall is present
and no -B option exists. Fixes a bug reported by
Martin KalbfuÃ\237
http://lists.gnu.org/archive/html/gm2/2010-09/msg00027.html.
* gm2/lang-specs.h: pass the -B option through to subcomponents
if -fmakeall is used.
* gm2/gm2spec.c: New function (find_executable_path).