[Gambas-user] How to compile Gambas to a local home?

Tobias Boege taboege at gmail.com
Wed Jun 26 08:43:25 CEST 2019


On Wed, 26 Jun 2019, Christof Thalhofer wrote:
> I answer to myself:
> 
> Am 25.06.19 um 17:45 schrieb Christof Thalhofer:
> 
> >> That will work for programs but not components (unless you can somehow 
> >> load them explicitly at runtime).
> >> or that's our experience anyway.
> > 
> > Yes.
> > 
> > ./configure -C --prefix=/home/users/xyz/.local
> > 
> > leads to:
> > 
> >> || THESE COMPONENTS ARE DISABLED:
> >> || - gb.db.odbc
> >> || - gb.db.postgresql
> >> || - gb.db.sqlite2
> ...
> 
> No, the reason for that is, that a lot of neccessary packages are not
> installed on that server.
> 

Using --prefix then hopefully gets you installed to some other directory,
but the Gambas installed there will not completely honour the prefix.
For example there is a function

 1195 const char *FILE_find_gambas(void)
 1196 {
 1197         const char *path;
 1198 
 1199         path = getenv("GB_PATH");
 1200 
 1201         if (!path || !*path)
 1202         {
 1203                 if (FILE_exist(GAMBAS_LINK_PATH))
 1204                 {
 1205                         path = FILE_readlink(GAMBAS_LINK_PATH);
 1206                         if (!path)
 1207                                 path = GAMBAS_LINK_PATH;
 1208                 }
 1209                 else
 1210                 {
 1211                         path = GAMBAS_PATH "/gbx" GAMBAS_VERSION_STRING;
 1212                 }
 1213         }
 1214 
 1215         return path;
 1216 }

which relies on

 66 #define GAMBAS_LINK_PATH  "/usr/bin/gbx" GAMBAS_VERSION_STRING

to determine the Gambas installation path which in turn determines
one of the component search directories. And you really don't want
to load components which are compiled for a different Gambas.

You have to additionally set GB_PATH to the location of gbx3 in your
local installation. Note that in the else branch above, the GAMBAS_PATH
is used instead, which is a macro set by the build process to the
configured $bindir under $prefix, which is the right thing.

Maybe GAMBAS_LINK_PATH is an oversight / bug? As it is now, it prefers
the environment variable over the system Gambas over the configuration.
I think the last two should switch around.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190626/1218ab4c/attachment.sig>


More information about the User mailing list