diff mbox series

[2/2] media_build: Allow cross-environment strip command

Message ID 374c79c8-c56b-ec79-311f-b27aa3220432@gmail.com
State New
Headers show
Series [1/2] media_build: CROSS_COMPILE variable environment and disable rmmod.pl | expand

Commit Message

Vincent Fortier March 13, 2021, 2:51 p.m. UTC
Hi all,

The current framework assume the strip command is natively available.  
While using external toolchain to cross-compile there is a need to point 
towards such tool using a STRIP variable environment using spksrc 
SynoCommunity framework.

The following patch tries to address this.

Signed-off-by: Vincent Fortier<th0ma7@gmail.com>

---

diff -uprN ../linuxtv.orig/v4l/scripts/make_makefile.pl 
v4l/scripts/make_makefile.pl
--- ../linuxtv.orig/v4l/scripts/make_makefile.pl    2021-02-08 
10:24:43.000000000 +0000
+++ v4l/scripts/make_makefile.pl    2021-03-13 13:55:46.534414452 +0000
@@ -254,7 +254,7 @@ while (my ($dir, $files) = each %instdir
      print OUT "echo -n \"\$\$i \"; ";
      print OUT "install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; 
done; ";
      print OUT "if [  \$\$n -ne 0 ]; then echo; ";
-    print OUT "strip --strip-debug \$(DESTDIR)\$(KDIR26)/$dir/*.ko; ";
+    print OUT "\$(STRIP) --strip-debug \$(DESTDIR)\$(KDIR26)/$dir/*.ko; ";
      print OUT "fi;\n\n";
  }
  print OUT "\t@echo\n";
diff mbox series

Patch

diff -uprN ../linuxtv.orig/v4l/Makefile v4l/Makefile
--- ../linuxtv.orig/v4l/Makefile    2021-02-08 10:24:43.000000000 +0000
+++ v4l/Makefile    2021-03-13 13:58:27.939468937 +0000
@@ -44,6 +44,11 @@  endif

  endif    # TOPDIR

+# Allow passing STRIP variable to use cross-compiler toolset
+ifeq ($(strip $(STRIP)),)
+STRIP = strip
+endif
+
  #################################################
  # default compilation rule

@@ -411,7 +416,7 @@  cx88-ivtv::
  old-install:: rminstall
      @echo -e "\nInstalling new V4L modules at $(DEST)..."

-    @strip --strip-debug $(inst-m)
+    $(STRIP) --strip-debug $(inst-m)

      -install -d $(DEST)
      -install -m 644 -c $(inst-m) $(DEST)