Re: 'relocatable' project built without --enable-relocatable

2024-04-25 Thread Reuben Thomas
On Thu, 25 Apr 2024 at 14:07, Bruno Haible wrote: > OK, I'm committing as shown below. > Great, thanks! > Is there a reason not to make a similar macro for compute_curr_prefix? > > Yes: > - For compute_curr_prefix, the need has not been demonstrated. > - Even if ENABLE_RELOCATABLE is 1,

Re: 'relocatable' project built without --enable-relocatable

2024-04-25 Thread Bruno Haible
Reuben Thomas wrote: > > Can you please try the attached patch? > > Works beautifully, thanks. OK, I'm committing as shown below. > Is there a reason not to make a similar macro for compute_curr_prefix? Yes: - For compute_curr_prefix, the need has not been demonstrated. - Even if

Re: 'relocatable' project built without --enable-relocatable

2024-04-24 Thread Reuben Thomas
On Wed, 24 Apr 2024 at 01:24, Bruno Haible wrote: > > Can you please try the attached patch? > Works beautifully, thanks. (Sorry to cause confusion: I was actually quoting code from a C-based project, not a Vala-based project, where I don't need the fix. But if you install this patch then I

Re: 'relocatable' project built without --enable-relocatable

2024-04-23 Thread Bruno Haible
Reuben Thomas wrote: > For a library. For example, from the libpaper commit referenced below, > using #ifdefs: > > /* Set the prefix directory for relocation. */ > void papersetprefixdir(const char *new_prefix) > { > #ifdef ENABLE_RELOCATABLE > set_relocation_prefix (INSTALLPREFIX,

Re: 'relocatable' project built without --enable-relocatable

2024-04-23 Thread Reuben Thomas
On Tue, 23 Apr 2024 at 21:46, Bruno Haible wrote: > How does or would the code you are talking about look like, with #ifs? > And would it be code for a library, or for a program? > For a library. For example, from the libpaper commit referenced below, using #ifdefs: /* Set the prefix directory

Re: 'relocatable' project built without --enable-relocatable

2024-04-23 Thread Bruno Haible
Reuben Thomas wrote: > Could macros be similarly added for the other relocatable.h > APIs, namely set_relocation_prefix and compute_curr_prefix? This would > allow relocate-using code to be entirely #ifdef free. How does or would the code you are talking about look like, with #ifs? And would it

'relocatable' project built without --enable-relocatable

2024-04-23 Thread Reuben Thomas
relocatable.h has partial support for building without --enable-relocatable: it #defines relocate and relocate2 to empty macros. This is great! Could macros be similarly added for the other relocatable.h APIs, namely set_relocation_prefix and compute_curr_prefix? This would allow relocate-using