Skip to contentSkip to conversation

libselinux/src/Makefile: don't pass bogus -I and -L to python setup.py build_ext

PATCH Applied Thomas Petazzoni 2 participants 3 messages Oct 25, 2019 – Nov 2, 2019 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux/src/Makefile: don't pass bogus -I and -L to python setup.py build_ext

Using $(DESTDIR) during the build does not follow the normal/standard semantic of DESTDIR: it is normally only needed during the installation. Therefore, a lot of build systems/environments don't pass any DESTDIR at build time, which causes setup.py to be called with -I /usr/include -L /usr/lib, which breaks cross-compilation.

---
 libselinux/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/src/Makefile +1 -1
index 2b1696a0..3b8bad81 100644
@@ -130,7 +130,7 @@ SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
 all: $(LIBA) $(LIBSO) $(LIBPC)
 
 pywrap: all selinuxswig_python_exception.i
-	CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext -I $(DESTDIR)$(INCLUDEDIR) -L $(DESTDIR)$(LIBDIR)
+	CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext
 
 rubywrap: all $(SWIGRUBYSO)
 
Signature · 1 line
2.21.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thomas Petazzoni

Using $(DESTDIR) during the build does not follow the normal/standard semantic of DESTDIR: it is normally only needed during the installation. Therefore, a lot of build systems/environments don't pass any DESTDIR at build time, which causes setup.py to be called with -I /usr/include -L /usr/lib, which breaks cross-compilation.

This patch looks good to me. It does not seem to break the build configurations that I am using and fixes a real issue. If nobody complains, I will merge it (without the 2 other patches) tomorrow.

Thanks!

Quoted 20 lines
---
 libselinux/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/src/Makefile +1 -2
index 2b1696a0..3b8bad81 100644
@@ -130,7 +130,7 @@ SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
 all: $(LIBA) $(LIBSO) $(LIBPC)
 
 pywrap: all selinuxswig_python_exception.i
-       CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext -I $(DESTDIR)$(INCLUDEDIR) -L $(DESTDIR)$(LIBDIR)
+       CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext
 
 rubywrap: all $(SWIGRUBYSO)
 
--

2.21.0

#2 lore raw
Quoted 12 lines · Nicolas Iooss
Quoted 8 lines · Thomas Petazzoni

Using $(DESTDIR) during the build does not follow the normal/standard semantic of DESTDIR: it is normally only needed during the installation. Therefore, a lot of build systems/environments don't pass any DESTDIR at build time, which causes setup.py to be called with -I /usr/include -L /usr/lib, which breaks cross-compilation.

Quoted 7 lines

This patch looks good to me. It does not seem to break the build configurations that I am using and fixes a real issue. If nobody complains, I will merge it (without the 2 other patches) tomorrow.

Thanks!

Applied.
Nicolas

Quoted 20 lines
Quoted 20 lines
---
 libselinux/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/src/Makefile +1 -2
index 2b1696a0..3b8bad81 100644
@@ -130,7 +130,7 @@ SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
 all: $(LIBA) $(LIBSO) $(LIBPC)
 
 pywrap: all selinuxswig_python_exception.i
-       CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext -I $(DESTDIR)$(INCLUDEDIR) -L $(DESTDIR)$(LIBDIR)
+       CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext
 
 rubywrap: all $(SWIGRUBYSO)
 
--

2.21.0