* [ptxdist] [PATCH v2 0/3] Update usb_modeswitch
@ 2018-09-12 8:26 Ladislav Michl
2018-09-12 8:27 ` [ptxdist] [PATCH 1/3] jimtcl: new package Ladislav Michl
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Ladislav Michl @ 2018-09-12 8:26 UTC (permalink / raw)
To: ptxdist
Hi,
this is another approach to fix usb_modeswitch, this time by adding
jimtcl package and linking against it. Now it solves all issues I
had with previous version. Please git it a try if it also work for
you :) Comments welcome and appreciated.
ladis
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH 1/3] jimtcl: new package
2018-09-12 8:26 [ptxdist] [PATCH v2 0/3] Update usb_modeswitch Ladislav Michl
@ 2018-09-12 8:27 ` 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 ` [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl Ladislav Michl
2 siblings, 0 replies; 5+ messages in thread
From: Ladislav Michl @ 2018-09-12 8:27 UTC (permalink / raw)
To: ptxdist
Jim is an opensource small-footprint implementation of the Tcl
programming language. So far only default set of features is
compiled in - lets see what users will really need.
This package is intended to replace Tcl (which is in staging
already) as it fits PTXdist more due to its small size.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
rules/host-jimtcl.in | 6 ++++
rules/host-jimtcl.make | 33 ++++++++++++++++++
rules/jimtcl.in | 24 +++++++++++++
rules/jimtcl.make | 77 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 140 insertions(+)
create mode 100644 rules/host-jimtcl.in
create mode 100644 rules/host-jimtcl.make
create mode 100644 rules/jimtcl.in
create mode 100644 rules/jimtcl.make
diff --git a/rules/host-jimtcl.in b/rules/host-jimtcl.in
new file mode 100644
index 000000000..ccd2d23bd
--- /dev/null
+++ b/rules/host-jimtcl.in
@@ -0,0 +1,6 @@
+## SECTION=hosttools_noprompt
+## SECTION=hosttools_platform
+
+config HOST_JIMTCL
+ tristate
+ default ALLYES
diff --git a/rules/host-jimtcl.make b/rules/host-jimtcl.make
new file mode 100644
index 000000000..fa7b64057
--- /dev/null
+++ b/rules/host-jimtcl.make
@@ -0,0 +1,33 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Ladislav Michl <ladis@linux-mips.org>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_JIMTCL) += host-jimtcl
+
+#
+# Paths and names
+#
+HOST_JIMTCL := $(JIMTCL)
+HOST_JIMTCL_DIR := $(HOST_BUILDDIR)/$(HOST_JIMTCL)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# Package is not using autoconf but autosetup which is enough compatible...
+#
+HOST_JIMTCL_CONF_ENV := $(HOST_ENV)
+HOST_JIMTCL_CONF_TOOL := autoconf
+HOST_JIMTCL_CONF_OPT := --prefix=/usr
+
+# vim: syntax=make
diff --git a/rules/jimtcl.in b/rules/jimtcl.in
new file mode 100644
index 000000000..8589160b9
--- /dev/null
+++ b/rules/jimtcl.in
@@ -0,0 +1,24 @@
+## SECTION=bytecode_engines
+
+config JIMTCL
+ tristate
+ prompt "jimtcl "
+ help
+ Jim provides a powerful Tcl language implemented in roughly
+ 10k lines of code making it suitable for deployment on
+ Embedded Systems.
+
+if JIMTCL
+
+config JIMTCL_SHELL
+ bool "install jimsh"
+ help
+ Install Tcl shell on the target
+
+config JIMTCL_SYMLINK
+ bool "install tclsh symlink"
+ depends on JIMTCL_SHELL
+ help
+ Make tclsh symlink to jimsh
+
+endif
diff --git a/rules/jimtcl.make b/rules/jimtcl.make
new file mode 100644
index 000000000..67d1c2e5f
--- /dev/null
+++ b/rules/jimtcl.make
@@ -0,0 +1,77 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Ladislav Michl <ladis@linux-mips.org>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_JIMTCL) += jimtcl
+
+#
+# Paths and names
+#
+JIMTCL_VERSION := 0.78
+JIMTCL_MD5 := bde9021d78a77fe28e1bbc423142ab23
+JIMTCL := jimtcl-$(JIMTCL_VERSION)
+JIMTCL_SUFFIX := tar.xz
+JIMTCL_URL := git://repo.or.cz/jimtcl.git;tag=$(JIMTCL_VERSION)
+JIMTCL_SOURCE := $(SRCDIR)/$(JIMTCL).$(JIMTCL_SUFFIX)
+JIMTCL_DIR := $(BUILDDIR)/$(JIMTCL)
+JIMTCL_LICENSE := BSD-2-Clause
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# Package is not using autoconf but autosetup which is enough compatible...
+#
+JIMTCL_CONF_ENV := $(CROSS_ENV)
+JIMTCL_CONF_TOOL := autoconf
+JIMTCL_CONF_OPT := \
+ $(CROSS_AUTOCONF_USR) \
+ --shared
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/jimtcl.install:
+ @$(call targetinfo)
+ @$(call world/install, JIMTCL)
+ @ln -sf libjim.so.$(JIMTCL_VERSION) $(JIMTCL_PKGDIR)/usr/lib/libjim.so
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/jimtcl.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, jimtcl)
+ @$(call install_fixup, jimtcl, PRIORITY, optional)
+ @$(call install_fixup, jimtcl, SECTION, base)
+ @$(call install_fixup, jimtcl, AUTHOR, "Ladislav Michl <ladis@linux-mips.org>")
+ @$(call install_fixup, jimtcl, DESCRIPTION, \
+ "A small footprint implementation of the Tcl programming language")
+
+ifdef PTXCONF_JIMTCL_SHELL
+ @$(call install_copy, jimtcl, 0, 0, 0755, -, /usr/bin/jimsh)
+ifdef PTXCONF_JIMTCL_SYMLINK
+ @$(call install_link, jimtcl, jimsh, /usr/bin/tclsh)
+endif
+endif
+ @$(call install_lib, jimtcl, 0, 0, 0644, libjim)
+
+ @$(call install_finish, jimtcl)
+
+ @$(call touch)
+
+# vim: syntax=make
--
2.19.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH v2 2/3] usb_modeswitch: version bump 2.5.1 -> 2.5.2
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 ` Ladislav Michl
2018-09-12 8:29 ` [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl Ladislav Michl
2 siblings, 0 replies; 5+ messages in thread
From: Ladislav Michl @ 2018-09-12 8:29 UTC (permalink / raw)
To: ptxdist
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
Changes:
-v2: None
rules/usb-modeswitch.make | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rules/usb-modeswitch.make b/rules/usb-modeswitch.make
index 193a6eede..0f00e9c5c 100644
--- a/rules/usb-modeswitch.make
+++ b/rules/usb-modeswitch.make
@@ -16,8 +16,8 @@ PACKAGES-$(PTXCONF_USB_MODESWITCH) += usb-modeswitch
#
# Paths and names
#
-USB_MODESWITCH_VERSION := 2.5.1
-USB_MODESWITCH_MD5 := 7e6435a2afe7aed8574fe59cf09a3503
+USB_MODESWITCH_VERSION := 2.5.2
+USB_MODESWITCH_MD5 := 16b9a8efa1bf8fbd7d5612757eae4f26
USB_MODESWITCH := usb-modeswitch-$(USB_MODESWITCH_VERSION)
USB_MODESWITCH_SUFFIX := tar.bz2
USB_MODESWITCH_URL := http://www.draisberghof.de/usb_modeswitch/$(USB_MODESWITCH).$(USB_MODESWITCH_SUFFIX)
--
2.19.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl
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
2018-09-12 13:07 ` Ladislav Michl
2 siblings, 1 reply; 5+ messages in thread
From: Ladislav Michl @ 2018-09-12 8:29 UTC (permalink / raw)
To: ptxdist
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl
2018-09-12 8:29 ` [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl Ladislav Michl
@ 2018-09-12 13:07 ` Ladislav Michl
0 siblings, 0 replies; 5+ messages in thread
From: Ladislav Michl @ 2018-09-12 13:07 UTC (permalink / raw)
To: ptxdist
On Wed, Sep 12, 2018 at 10:29:39AM +0200, Ladislav Michl wrote:
> 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
This should actually be:
select JIMTCL if USB_MODESWITCH_UDEV_HELPER || USB_MODESWITCH_SYSTEMD_UNIT
as it is compile time dependency. I'll wait for comments before v3.
> + 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
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-12 13:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ptxdist] [PATCH v2 3/3] usb_modeswitch: link dispatcher against JimTcl Ladislav Michl
2018-09-12 13:07 ` Ladislav Michl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox