comp.lang.ada
 help / color / mirror / Atom feed
From: gabriele.galeotti.xyz@gmail.com
Subject: Re: SweetAda 0.1 released
Date: Sat, 11 Jul 2020 09:18:17 -0700 (PDT)	[thread overview]
Message-ID: <89558f25-5b98-40a4-a106-d1e9f12eb6beo@googlegroups.com> (raw)
In-Reply-To: <3ad33643-08b1-4ab6-8672-f9df27d822f6o@googlegroups.com>

On Friday, July 10, 2020 at 8:44:13 AM UTC+2, Roger wrote:
> On Friday, July 10, 2020 at 10:24:41 AM UTC+10, Roger wrote:
> > On Friday, July 10, 2020 at 5:50:42 AM UTC+10, gabriele....@gmail.com wrote:
> > > Hi Roger.
> > > 
> > > Nice. However it's pretty strange, because elftool get the same PATH as other executables. I guess you are trying to execute it from the outside of SweetAda.
> > > 
> > 
> > The problem occurs when running menu.sh.
> > I decided that updating PATH was needed after finding the declaration of ELFTOOL at Makefile.tc.in which does not provide a path for either : gprbuild or elftool:
> > GPRBUILD := gprbuild$(EXEEXT)
> > ELFTOOL  := elftool$(EXEEXT)
> > GDB      := $(TOOLCHAIN_GDB)
> > 
> > There's a possibilty that the wrong gprbuild may be used as no path is declared for GPRBUILD but may be using /opt/GNAT/2020/bin/gprbuild?
> > I was thinking of adding the /opt/sweetada/bin/path to these declarations in Makefile.tc.in.
> 
> After further investigation I have removed /opt/sweetada/bin from my PATH and have modified my Makefile.tc.in to:
> 
> > GPRBUILD := $(TOOLCHAIN_PREFIX)/bin/gprbuild$(EXEEXT)
> > ELFTOOL  := $(TOOLCHAIN_PREFIX)/bin/elftool$(EXEEXT)
> > GDB      := $(TOOLCHAIN_GDB)
> 
> I think that other tools use  TOOLCHAIN_PROGRAM_PREFIX: x86_64-sweetada-elf-
> resulting in commands such as : x86_64-sweetada-elf-gcc
> which is in the same directory as elftool,  so why  ELFTOOL  := elftool$(EXEEXT) doesn't work remains a mystery to me.

Hi Roger.

I would like to investigate a little bit more. Sorry if I am writing trivial things, it's just to keep ourselves synchronized.

I assume you download 0.1c, but only minor unrelated thing changes, the same holds for 0.1.

First of all, toolchains for Windows and OSX have a GNU make as part of the toolchain. Windows does not have such thing (unless you install MSYS/Cygwin), while for OSX you have to install Xcode. I want sweetada to be as independent as possible, that's why you can find the GNU make in the package.

All begins in menu.sh.

sweetada development could be performed in a shell with a PATH wich has /opt/sweetada/bin (or whatever is the installation prefix) added in front of its current content (so to override other potential clashes). menu.sh is a shortcut and nothing else.

Please note that once you have a correct PATH, you could issues shell commands like "make all", etc etc, without calling menu.sh. In order to obey to the least surprise principle, stay in the sweetada source code directory.

So you call menu.sh. But menu.sh doesn't know where you really install the toolchain. In the case of OSX, there is a guess in the standard prefix, i.e. /opt/sweetada/bin.

The particular make in that directory is thus called.

So, the first thing is checking if menu.sh detect "darwin" as a legal os. Try to "echo $OSTYPE" inside the script. Be sure that MAKE is set to the GNU make 
which is located inside the toolchain.

Maybe I could add a read of the master configuration.in to import settings, I will think about it.

Once menu.sh calls the Makefile, everything should be handled correctly. If the configuration.in is correctly configured, Makefile will build a PATH with the sweetada toolchain as the first path to look in, so it will have no problems in calling executables. GPRBUILD or ELFTOOL are called exactly like the compiler, so there is no point in prepend anything.

The reason why ELFTOOL != elftool is honestly rather inexplicable, because if the current OSTYPE is set to "darwin", then EXEEXT evaluates to empty, so ELFTOOL should end up in simply "elftool".

That's how things should work. Try to insert a line like
$(info $(<varname)) in the Makefiles in order to dump some variable, maybe it could help.

Let me know, I will continue to check also in my environment.

  parent reply	other threads:[~2020-07-11 16:18 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 16:34 SweetAda 0.1 released gabriele.galeotti.xyz
2020-07-01  9:32 ` Fabien Chouteau
2020-07-01 11:06   ` gabriele.galeotti.xyz
2020-07-01 12:19     ` Fabien Chouteau
2020-07-01 11:01 ` Stéphane Rivière
2020-07-01 11:24   ` gabriele.galeotti.xyz
2020-07-01 16:56     ` Stéphane Rivière
2020-07-01 18:04       ` gabriele.galeotti.xyz
2020-07-02 14:51       ` gabriele.galeotti.xyz
2020-07-03  4:12         ` Stéphane Rivière
2020-07-03 10:06           ` gabriele.galeotti.xyz
2020-07-07  8:44             ` Stéphane Rivière
2020-07-07  9:25               ` gabriele.galeotti.xyz
2020-07-07 10:47                 ` Stéphane Rivière
2020-07-07 16:28                 ` Stéphane Rivière
2020-07-07 16:50                   ` gabriele.galeotti.xyz
2020-07-07 18:25                     ` Stéphane Rivière
2020-07-01 15:00 ` Roger
2020-07-01 15:30   ` Roger
2020-07-01 15:47     ` gabriele.galeotti.xyz
2020-07-01 15:37   ` gabriele.galeotti.xyz
2020-07-02  4:21     ` Roger
2020-07-02  4:37       ` Roger
2020-07-02  4:47     ` Roger
2020-07-02 11:04       ` gabriele.galeotti.xyz
2020-07-02 13:03         ` Roger
2020-07-02 15:26           ` gabriele.galeotti.xyz
2020-07-04  0:30             ` Roger
2020-07-04 15:59               ` gabriele.galeotti.xyz
2020-07-05  2:15                 ` Roger
2020-07-05 21:41                   ` gabriele.galeotti.xyz
2020-07-06  3:03                     ` Roger
2020-07-06  8:36                       ` gabriele.galeotti.xyz
2020-07-06 11:30                         ` Roger
2020-07-06 15:04                           ` gabriele.galeotti.xyz
2020-07-06 16:13                           ` gabriele.galeotti.xyz
2020-07-07  0:53                             ` Roger
2020-07-07  7:20                               ` Roger
2020-07-07  8:13                                 ` gabriele.galeotti.xyz
2020-07-07 11:37                                   ` Roger
2020-07-09  6:54                                   ` Roger
2020-07-09 19:50                                     ` gabriele.galeotti.xyz
2020-07-10  0:24                                       ` Roger
2020-07-10  6:44                                         ` Roger
2020-07-11 10:15                                           ` gabriele.galeotti.xyz
2020-07-11 16:18                                           ` gabriele.galeotti.xyz [this message]
2020-07-12  2:45                                             ` Roger
2020-07-12  9:59                                               ` gabriele.galeotti.xyz
2020-07-13  6:29                                                 ` Roger
2020-07-13 10:07                                                   ` gabriele.galeotti.xyz
2020-07-13 12:03                                                     ` Roger
2020-07-13 12:18                                                       ` gabriele.galeotti.xyz
2020-07-14 16:53                                                       ` gabriele.galeotti.xyz
2020-07-15  7:52                                                         ` Roger
2020-07-16 11:09                                                           ` gabriele.galeotti.xyz
2020-07-16 11:35                                                             ` Roger
2020-07-16 11:58                                                               ` Roger
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox