[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems using relocatable on Win32

From: Bruno Haible
Subject: Re: Problems using relocatable on Win32
Date: Sat, 09 Dec 2017 20:59:57 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-101-generic; KDE/5.18.0; x86_64; ; )

Hello Reuben,

> 1. For use in a library, relocatable.c should be built with IN_LIBRARY
> defined. The documentation (relocatable-maint.texi) says to add
> -DIN_LIBRARY to the defines for the library which is being made
> relocatable. Unfortunately, I wrote that documentation, and it appears to
> be a misunderstanding. The problem is that relocatable.c is compiled as
> part of gnulib, not as part of the gnulib-using library, so it doesn't see
> this define.

You'll need two different invocations of gnulib-tool, I'd say:
  - one for the library which is being made relocatable,
    here use module 'relocatable-lib-lgpl' and define -DIN_LIBRARY in
    Makefile.am (*),
  - one for the code that makes use of this library,
    here use module 'relocatable-prog' and do not define -DIN_LIBRARY
    but do define INSTALLDIR (only needed if you also define

(*) In order to achieve this, use a hand-written Makefile.am that 'include's
    a gnulib-tool generated Makefile.gnulib (gnulib-tool option
    --makefile-name=Makefile.gnulib). For an example, see [1].

> 2. To get the correct path at which the library is installed, INSTALLDIR is
> defined. First, we have the same problem as above: where should INSTALLDIR
> be defined so that its definition is seen at compile time?

Define INSTALLDIR in the DEFS or AM_CPPFLAGS of the Makefile.am that covers
the compilation of the .c files that invoke set_program_name (after including

If you want ENABLE_COSTLY_RELOCATABLE, define INSTALLDIR also in the
Makefile.am of the directory of the second gnulib-tool invocation mentioned

> But there's a
> further problem: on Win32, DLLs are installed to bindir, not libdir, so
> INSTALLDIR needs a different definition.

In gettext, where all programs get installed in $(bindir), I use the definition

Where does $(libdir) come into play?

> Is there a suitable variable that
> points to "where the shared library will be installed"?

Ah, you have a relocatable library that depends on another relocatable library?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]