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 v3 3/3] usb_modeswitch: link dispatcher against JimTcl
Date: Thu, 13 Sep 2018 10:35:19 +0200	[thread overview]
Message-ID: <20180913083519.GC24773@lenoch> (raw)
In-Reply-To: <20180913083226.GA24773@lenoch>

Link dispatcher script with JimTcl library to lower footprint.

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

 .../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..28659915a 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
+	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-13  8:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13  8:32 [ptxdist] [PATCH v2 1/3] jimtcl: new package Ladislav Michl
2018-09-13  8:34 ` [ptxdist] [PATCH v3 2/3] usb_modeswitch: version bump 2.5.1 -> 2.5.2 Ladislav Michl
2018-09-13  8:35 ` Ladislav Michl [this message]
2018-09-13  9:59 ` [ptxdist] [PATCH v2 1/3] jimtcl: new package Roland Hieber
2018-09-13 10:38   ` Ladislav Michl
2018-09-17  8:21     ` Michael Olbrich
2018-09-18  7:04       ` Ladislav Michl
2018-09-18  9:07         ` Michael Olbrich

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=20180913083519.GC24773@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