This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Patch: rename to `insight'
>>>>> "Eli" == Eli Zaretskii <eliz@delorie.com> writes:
Eli> I would suggest to consider a short C program instead of a shell
Eli> script, for portability's sake. Shell scripts are not very
Eli> portable to non-Posix platforms.
I assume you're talking about Windows. I thought gdb required Cygwin
to run on Windows, in which case you will have a shell. Or is there a
real native gdb?
>> + $(SHELL) $(srcdir)/../mkinstalldirs $(bindir)
Eli> Shouldn't this say "-$(SHELL)", in case $(bindir) already exists?
No. mkinstalldirs exits with status 0 if the directory already
exists.
Eli> This assumes that the distribution is not moved once installed.
Eli> That might be true on a typical Unix system (even there you might
Eli> have problems with CD-ROM distributions), but it will make lots
Eli> of problems on DOS/Windows systems, where a precompiled binary is
Eli> usually installed into a directory that has nothing to do with
Eli> the original installation at "make install" time.
The program first tries to see if `gdb' exists in the same directory
as `insight'. Most shells use the full path as $0, so this has a
good chance of working.
Eli> Why not simply invoke "gdb" and let PATH do its thing? Or at
Eli> least try that before falling back on the installation directory?
The installation directory should be the first choice (after the
directory of `insight' itself).
Using PATH isn't so good because people sometimes use the full path to
run something that isn't in their PATH. This happens a lot with
developers. An earlier version of this patch didn't use bindir -- and
I ran into this problem myself (I have 3 or 4 versions of gdb around
at any given time).
I fixed the script to fall back on PATH if it can't find the file any
other way.
Eli> I'm not sure this will DTRT with all DOS/Windows ports of Unixy
Eli> shells. I suggest to use "gdb.exe" on those platfrms (better
Eli> safe than sorry).
Ok. I added $(EXEEXT) to the @gdb@ substitution.
Eli> Writing a short C program would eliminate all these problems (and
Eli> also avoid requiring users to have a ported shell on their
Eli> machines). That's why I suggested that in the first place.
I don't know that much about Windows or DOS. I don't know how I would
determine whether the program was portable there.
Tom