All of lore.kernel.org
 help / color / mirror / Atom feed
* Rework of Makefiles
@ 2018-01-24  9:27 Marcus Folkesson
  2018-01-24  9:27 ` [PATCH v4 01/15] libsepol: build: follow standard semantics for DESTDIR and PREFIX Marcus Folkesson
                   ` (14 more replies)
  0 siblings, 15 replies; 24+ messages in thread
From: Marcus Folkesson @ 2018-01-24  9:27 UTC (permalink / raw)
  To: selinux, nicolas.iooss, sds

Hello,

I have updated the patchset.

We had a problem with overriding LIBDIR.

Please test to compile with:
make DESTDIR=/tmp/myroot PREFIX=/myusr install
or
make DESTDIR=/tmp/myroot install

Thanks to Nicolas and Petr for feedback.

Changes:
v4:
	- top Makefile: add LIBDIR to LDFLAGS if DESTDIR is specified
	- top Makefile: export LIBSEPOLA  if DESTDIR is specified
	- python: move platform from platform specific to platform shared installation directory
	- Introduce LDLIBS_LIBSEPOLA if LIBSEPOLA is not defined. 

v3:
	- python: Add missing slash 
	- Top makefile: Add default prefix
	- python, mcstrans, selinux: keep the possibility to specify LIBSEPOLA to
	  make depending component recompile on change. If not specified, fall back to
	  libsepola in LDFLAGS path.

v2:
	- Use separate directories for shared libraries as before( Comment from Stephen Smalley)
	- Rework all packages (not just selinux/sepol/semanage)

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Rework of Makefiles
@ 2018-01-12 15:11 Marcus Folkesson
  0 siblings, 0 replies; 24+ messages in thread
From: Marcus Folkesson @ 2018-01-12 15:11 UTC (permalink / raw)
  To: selinux, nicolas.iooss

I have reworked the Makefiles a bit to make it more compatible with
the standard semantics for DESTDIR and PREFIX.

What made me look at this was a package I was working on in 
Buildroot[1] that was using the pkg-config file generated
from libselinux. The pkg-config file generated has bogus paths 
which results in that my package did not compile.

When looking further in our packages for libselinux/libsepol/libsemanage,
we allready do "tricks" to make it compile.
For example, we set DESTDIR during compilation to compute library and header paths.

DESTDIR should be supported only in the install* and uninstall* targets,
as those are the only targets where it is useful. [2]

PREFIX should be used to set a prefix for the installation.
This could be provided both in compile and install stages.


For example, consider the following line:
#make DESTDIR=/tmp/selinux install

It will generate a libselinux.pc file that looks like this:

prefix=/tmp/selinux/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=/tmp/selinux/usr/include

The DESTDIR should not be part of the prefix. The correct output should be:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=/usr/include

The following example do not compile at all:
#make DESTDIR=/tmp/myroot PREFIX=/selinux install

In this case, everything should be installed under /tmp/myroot/selinux.
The prefix in all generated pkg-files should have the path /selinux/xxxxx ( not /tmp/myroot/selinux/xxxx).

This patchsets tries to solve the following issues:
- The pkg-config files generates odd paths when using DESTDIR without PREFIX
- DESTDIR is needed during compile time to compute library and header paths which it should not.
- Installing with both DESTDIR and PREFIX set gives us odd paths
- Make usage of DESTDIR and PREFIX more standard

However, DESTDIR is still needed in the "root" Makefile to make libsemanage to compile.
But all components (libselinux, libsepol and libsemanage) can be compiled separatly with
standard usage of DESTDIR and PREFIX.

Thanks,

Best regards
Marcus Folkesson

[1] https://buildroot.org/
[2] https://www.gnu.org/prep/standards/html_node/DESTDIR.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-01-31 11:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24  9:27 Rework of Makefiles Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 01/15] libsepol: build: follow standard semantics for DESTDIR and PREFIX Marcus Folkesson
2018-01-24 21:29   ` Nicolas Iooss
2018-01-31 11:40     ` Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 02/15] libselinux: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 03/15] libsemanage: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 04/15] checkpolicy: " Marcus Folkesson
2018-01-24 22:04   ` Nicolas Iooss
2018-01-31 11:58     ` Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 05/15] gui: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 06/15] mcstrans: " Marcus Folkesson
2018-01-24 21:48   ` Nicolas Iooss
2018-01-31 11:43     ` Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 07/15] policycoreutils: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 08/15] python: " Marcus Folkesson
2018-01-24 22:06   ` Nicolas Iooss
2018-01-24  9:27 ` [PATCH v4 09/15] python: build: move modules from platform-specific to platform-shared Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 10/15] restorecond: build: follow standard semantics for DESTDIR and PREFIX Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 11/15] sandbox: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 12/15] secilc: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 13/15] semodule-utils: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 14/15] dbus: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 15/15] build: setup buildpaths if DESTDIR is specified Marcus Folkesson
  -- strict thread matches above, loose matches on Subject: below --
2018-01-12 15:11 Rework of Makefiles Marcus Folkesson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.