Skip to contentSkip to conversation

media_build: Allow cross-environment strip command

PATCH New Vincent Fortier 1 participant 1 message Mar 13, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 media_build: Allow cross-environment strip command

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.

---

Makefile    2021-03-13 13:58:27.939468937 +0000 renamed from linuxtv.orig/v4l/Makefile    2021-02-08 10:24:43.000000000 +0000 +0 -0
diff -uprN ../linuxtv.orig/v4l/Makefile v4l/Makefile
@@ -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)

scripts/make_makefile.pl    2021-03-13 13:55:46.534414452 +0000 renamed from linuxtv.orig/v4l/scripts/make_makefile.pl    2021-02-08 10:24:43.000000000 +0000 +0 -0
diff -uprN ../linuxtv.orig/v4l/scripts/make_makefile.pl v4l/scripts/make_makefile.pl
@@ -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";