mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl
Date: Wed, 12 Sep 2018 10:29:39 +0200	[thread overview]
Message-ID: <20180912082938.GD12132@lenoch> (raw)
In-Reply-To: <20180912082645.GA12132@lenoch>

Link dispatcher script with JimTcl library to lower footprint.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 Changes:
  -v2: Link against JimTcl

 .../0001-Use-system-jimtcl.patch              | 50 +++++++++++++++++++
 patches/usb-modeswitch-2.5.2/series           |  1 +
 rules/usb-modeswitch.in                       |  5 +-
 rules/usb-modeswitch.make                     | 10 ++--
 4 files changed, 60 insertions(+), 6 deletions(-)
 create mode 100644 patches/usb-modeswitch-2.5.2/0001-Use-system-jimtcl.patch
 create mode 100644 patches/usb-modeswitch-2.5.2/series

diff --git a/patches/usb-modeswitch-2.5.2/0001-Use-system-jimtcl.patch b/patches/usb-modeswitch-2.5.2/0001-Use-system-jimtcl.patch
new file mode 100644
index 000000000..1de216e86
--- /dev/null
+++ b/patches/usb-modeswitch-2.5.2/0001-Use-system-jimtcl.patch
@@ -0,0 +1,50 @@
+From aba59dfbd135cd91802c9dccdb5e2b37c377f5ab Mon Sep 17 00:00:00 2001
+From: Ladislav Michl <ladis@linux-mips.org>
+Date: Tue, 11 Sep 2018 19:09:41 +0200
+Subject: [PATCH] Use system jimtcl
+
+---
+ Makefile | 13 +++++--------
+ 1 file changed, 5 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 463a11f..42c3de6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,6 +3,7 @@ VERS        = 2.5.2
+ CC          ?= gcc
+ CFLAGS      += -Wall
+ LIBS        = `pkg-config --libs --cflags libusb-1.0`
++JIMTCL      = `pkg-config --libs --cflags jimtcl`
+ RM          = /bin/rm -f
+ OBJS        = usb_modeswitch.c
+ PREFIX      = $(DESTDIR)/usr
+@@ -13,12 +14,8 @@ UDEVDIR     = $(DESTDIR)/lib/udev
+ SBINDIR     = $(PREFIX)/sbin
+ MANDIR      = $(PREFIX)/share/man/man1
+ VPATH       = jimtcl
+-HOST_TCL   := $(shell cd jim && ./autosetup/find-tclsh)
+-ifeq (,$(findstring jimsh0,$(HOST_TCL)))
+-TCL        ?= $(HOST_TCL)
+-else
+-TCL        ?= /usr/bin/tclsh
+-endif
++HOST_TCL    ?= /usr/bin/tclsh
++TCL         ?= /usr/bin/tclsh
+ JIM_CONFIGURE_OPTS = --disable-lineedit \
+ 	--with-out-jim-ext="stdlib posix load signal syslog" --prefix=/usr
+ 
+@@ -49,8 +46,8 @@ jim/libjim.a:
+ dispatcher-script: usb_modeswitch.tcl
+ 	sed 's_!/usr/bin/tclsh_!'"$(TCL)"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
+ 
+-dispatcher-shared: jim/libjim.so dispatcher.c usb_modeswitch.string
+-	$(CC) dispatcher.c $(LDFLAGS) -Ljim -ljim -Ijim -o usb_modeswitch_dispatcher $(CFLAGS)
++dispatcher-shared: dispatcher.c usb_modeswitch.string
++	$(CC) dispatcher.c $(LDFLAGS) $(JIMTCL) -o usb_modeswitch_dispatcher $(CFLAGS)
+ 
+ dispatcher-static: jim/libjim.a dispatcher.c usb_modeswitch.string
+ 	$(CC) dispatcher.c $(LDFLAGS) jim/libjim.a -Ijim -o usb_modeswitch_dispatcher $(CFLAGS)
+-- 
+2.19.0
+
diff --git a/patches/usb-modeswitch-2.5.2/series b/patches/usb-modeswitch-2.5.2/series
new file mode 100644
index 000000000..cb735aa0d
--- /dev/null
+++ b/patches/usb-modeswitch-2.5.2/series
@@ -0,0 +1 @@
+0001-Use-system-jimtcl.patch
diff --git a/rules/usb-modeswitch.in b/rules/usb-modeswitch.in
index 754e19304..037169150 100644
--- a/rules/usb-modeswitch.in
+++ b/rules/usb-modeswitch.in
@@ -4,7 +4,8 @@ menuconfig USB_MODESWITCH
 	tristate
 	prompt "usb-modeswitch                "
 	select LIBUSB
-	select TCL if (USB_MODESWITCH_UDEV_HELPER || USB_MODESWITCH_SYSTEMD_UNIT) && RUNTIME
+	select JIMTCL if (USB_MODESWITCH_UDEV_HELPER || USB_MODESWITCH_SYSTEMD_UNIT) && RUNTIME
+	select HOST_JIMTCL if (USB_MODESWITCH_UDEV_HELPER || USB_MODESWITCH_SYSTEMD_UNIT)
 	help
 	  USB_ModeSwitch is (surprise!) a mode switching tool
 	  for controlling 'multi-mode' USB devices.
@@ -15,13 +16,11 @@ config USB_MODESWITCH_UDEV_HELPER
 	bool "install udev helper"
 	default y
 	depends on UDEV
-	depends on STAGING
 
 config USB_MODESWITCH_SYSTEMD_UNIT
 	bool "install systemd unit file"
 	default y
 	depends on SYSTEMD
-	depends on STAGING
 
 endif
 
diff --git a/rules/usb-modeswitch.make b/rules/usb-modeswitch.make
index 0f00e9c5c..4934d72c0 100644
--- a/rules/usb-modeswitch.make
+++ b/rules/usb-modeswitch.make
@@ -33,11 +33,15 @@ USB_MODESWITCH_LICENSE	:= GPL-2.0-only
 # autoconf
 #
 USB_MODESWITCH_CONF_TOOL	:= NO
-USB_MODESWITCH_MAKE_ENV		:= $(CROSS_ENV)
-USB_MODESWITCH_MAKE_OPT		:= $(CROSS_ENV_PROGS)
+USB_MODESWITCH_MAKE_ENV		:= \
+	$(CROSS_ENV) \
+	HOST_TCL=$(PTXCONF_SYSROOT_HOST)/usr/bin/jimsh
+USB_MODESWITCH_MAKE_OPT		:= \
+	$(CROSS_ENV_PROGS) \
+	shared
 USB_MODESWITCH_INSTALL_OPT	:= \
 	UDEVDIR=$(USB_MODESWITCH_PKGDIR)/usr/lib/udev \
-	install
+	install-shared
 
 # ----------------------------------------------------------------------------
 # Install
-- 
2.19.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2018-09-12  8:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12  8:26 [ptxdist] [PATCH v2 0/3] Update usb_modeswitch Ladislav Michl
2018-09-12  8:27 ` [ptxdist] [PATCH 1/3] jimtcl: new package Ladislav Michl
2018-09-12  8:29 ` [ptxdist] [PATCH v2 2/3] usb_modeswitch: version bump 2.5.1 -> 2.5.2 Ladislav Michl
2018-09-12  8:29 ` Ladislav Michl [this message]
2018-09-12 13:07   ` [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180912082938.GD12132@lenoch \
    --to=ladis@linux-mips.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox