diff mbox

libsepol: Add INCLUDEDIR to utils/Makefile

Message ID 20170504140857.18863-1-plautrba@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Petr Lautrbach May 4, 2017, 2:08 p.m. UTC
fcb5d5c removed ../include from CFLAGS from libsepol/utils/Makefile so
that a build tool can't find sepol/sepol.h when libsepol is built on a
system without sepol.h in standard paths.

Fixes:
chkcon.c:1:10: fatal error: sepol/sepol.h: No such file or directory
 #include <sepol/sepol.h>

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 libsepol/utils/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Petr Lautrbach May 4, 2017, 2:22 p.m. UTC | #1
The patch is wrong, please disregard.

I'm not sure about the right fix in order not to break gentoo use case.
I'd just revert fcb5d5c change in libsepol/utils/Makefile for now.



On 05/04/2017 04:08 PM, Petr Lautrbach wrote:
> fcb5d5c removed ../include from CFLAGS from libsepol/utils/Makefile so
> that a build tool can't find sepol/sepol.h when libsepol is built on a
> system without sepol.h in standard paths.
> 
> Fixes:
> chkcon.c:1:10: fatal error: sepol/sepol.h: No such file or directory
>  #include <sepol/sepol.h>
> 
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
> ---
>  libsepol/utils/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libsepol/utils/Makefile b/libsepol/utils/Makefile
> index a13164e1..f5097be7 100644
> --- a/libsepol/utils/Makefile
> +++ b/libsepol/utils/Makefile
> @@ -1,6 +1,7 @@
>  # Installation directories.
>  PREFIX ?= $(DESTDIR)/usr
>  BINDIR ?= $(PREFIX)/bin
> +INCLUDEDIR ?= $(PREFIX)/include
>  
>  CFLAGS ?= -Wall -Werror
>  LDFLAGS += -L../src
>
Stephen Smalley May 4, 2017, 8:49 p.m. UTC | #2
On Thu, 2017-05-04 at 16:22 +0200, Petr Lautrbach wrote:
> The patch is wrong, please disregard.
> 
> I'm not sure about the right fix in order not to break gentoo use
> case.
> I'd just revert fcb5d5c change in libsepol/utils/Makefile for now.

Can't you just specify CFLAGS to make, similar to what is done in the
top-level Makefile for building with DESTDIR set?

> 
> 
> 
> On 05/04/2017 04:08 PM, Petr Lautrbach wrote:
> > fcb5d5c removed ../include from CFLAGS from libsepol/utils/Makefile
> > so
> > that a build tool can't find sepol/sepol.h when libsepol is built
> > on a
> > system without sepol.h in standard paths.
> > 
> > Fixes:
> > chkcon.c:1:10: fatal error: sepol/sepol.h: No such file or
> > directory
> >  #include <sepol/sepol.h>
> > 
> > Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
> > ---
> >  libsepol/utils/Makefile | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/libsepol/utils/Makefile b/libsepol/utils/Makefile
> > index a13164e1..f5097be7 100644
> > --- a/libsepol/utils/Makefile
> > +++ b/libsepol/utils/Makefile
> > @@ -1,6 +1,7 @@
> >  # Installation directories.
> >  PREFIX ?= $(DESTDIR)/usr
> >  BINDIR ?= $(PREFIX)/bin
> > +INCLUDEDIR ?= $(PREFIX)/include
> >  
> >  CFLAGS ?= -Wall -Werror
> >  LDFLAGS += -L../src
> > 
> 
>
Petr Lautrbach May 5, 2017, 10:12 a.m. UTC | #3
Dne 4.5.2017 v 22:49 Stephen Smalley napsal(a):
> On Thu, 2017-05-04 at 16:22 +0200, Petr Lautrbach wrote:
>> The patch is wrong, please disregard.
>>
>> I'm not sure about the right fix in order not to break gentoo use
>> case.
>> I'd just revert fcb5d5c change in libsepol/utils/Makefile for now.
>
> Can't you just specify CFLAGS to make, similar to what is done in the
> top-level Makefile for building with DESTDIR set?
>

I believe that ../include and ../src paths should be always added to CFLAGS
and LDFLAGS in this case to prevent cases when LDFLAGS and CFLAGS are overriden
on a command line without setting paths containing sepol.h and sepol.so.

This way it's already used in libsepol/src/Makefile

Petr
diff mbox

Patch

diff --git a/libsepol/utils/Makefile b/libsepol/utils/Makefile
index a13164e1..f5097be7 100644
--- a/libsepol/utils/Makefile
+++ b/libsepol/utils/Makefile
@@ -1,6 +1,7 @@ 
 # Installation directories.
 PREFIX ?= $(DESTDIR)/usr
 BINDIR ?= $(PREFIX)/bin
+INCLUDEDIR ?= $(PREFIX)/include
 
 CFLAGS ?= -Wall -Werror
 LDFLAGS += -L../src