* [Buildroot] [PATCH] package/swig: also create a swig4.0 symlink
@ 2026-09-24 13:15 Yegor Yefremov via buildroot
2026-10-03 18:37 ` Thomas Petazzoni via buildroot
2026-10-10 9:23 ` Thomas Perale via buildroot
0 siblings, 2 replies; 3+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-09-24 13:15 UTC (permalink / raw)
To: buildroot
FindSWIG in CMake searches for swig4.0, swig3.0 and swig2.0 before it
tries plain swig, and it searches the whole PATH for one name before
moving on to the next. We only create swig3.0 and swig$(SWIG_VERSION_MAJOR)
(swig4.5) symlinks in $(HOST_DIR)/bin, so a swig4.0 installed on the
build machine, as Ubuntu 22.04 does with its swig4.0 package, takes
precedence over our host-swig for every CMake package that does not pass
SWIG_EXECUTABLE explicitly. With CMake 3.22.1, libftdi1 with Python
bindings ends up with
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.2", ...)
Also create a swig4.0 symlink, and update the comment accordingly.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Assisted-by: Claude:claude-opus-5
---
package/swig/swig.mk | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/package/swig/swig.mk b/package/swig/swig.mk
index e277f5049a..4dac64dadc 100644
--- a/package/swig/swig.mk
+++ b/package/swig/swig.mk
@@ -30,18 +30,19 @@ endef
HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_WRAPPER
-# CMake looks first at swig3.0, then swig2.0 and then swig. However,
-# when doing the search, it will look into the PATH for swig2.0 first,
-# and then for swig.
+# CMake looks first for swig4.0, then swig3.0 and swig2.0, and only
+# then for swig. However, it searches the whole PATH for one name before
+# trying the next one.
# While the PATH contains first our $(HOST_DIR)/bin, it also contains
# /usr/bin and other system directories. Therefore, if there is an
-# installed swig3.0 on the system, it will get the preference over the
-# swig installed in $(HOST_DIR)/bin, which isn't nice. To prevent
-# this from happening we create a symbolic link swig3.0 -> swig, so that
-# our swig always gets used.
+# installed swig4.0 or swig3.0 on the system, it will get the preference
+# over the swig installed in $(HOST_DIR)/bin, which isn't nice. To prevent
+# this from happening we create swig4.0 and swig3.0 symbolic links to
+# swig, so that our swig always gets used.
define HOST_SWIG_INSTALL_SYMLINK
ln -fs swig $(HOST_DIR)/bin/swig$(SWIG_VERSION_MAJOR)
+ ln -fs swig $(HOST_DIR)/bin/swig4.0
ln -fs swig $(HOST_DIR)/bin/swig3.0
endef
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/swig: also create a swig4.0 symlink
2026-09-24 13:15 [Buildroot] [PATCH] package/swig: also create a swig4.0 symlink Yegor Yefremov via buildroot
@ 2026-10-03 18:37 ` Thomas Petazzoni via buildroot
2026-10-10 9:23 ` Thomas Perale via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-03 18:37 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: buildroot
On Thu, Sep 24, 2026 at 03:15:33PM +0200, Yegor Yefremov via buildroot wrote:
> FindSWIG in CMake searches for swig4.0, swig3.0 and swig2.0 before it
> tries plain swig, and it searches the whole PATH for one name before
> moving on to the next. We only create swig3.0 and swig$(SWIG_VERSION_MAJOR)
> (swig4.5) symlinks in $(HOST_DIR)/bin, so a swig4.0 installed on the
> build machine, as Ubuntu 22.04 does with its swig4.0 package, takes
> precedence over our host-swig for every CMake package that does not pass
> SWIG_EXECUTABLE explicitly. With CMake 3.22.1, libftdi1 with Python
> bindings ends up with
>
> -- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.2", ...)
>
> Also create a swig4.0 symlink, and update the comment accordingly.
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> Assisted-by: Claude:claude-opus-5
Applied to master, thanks!
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/swig: also create a swig4.0 symlink
2026-09-24 13:15 [Buildroot] [PATCH] package/swig: also create a swig4.0 symlink Yegor Yefremov via buildroot
2026-10-03 18:37 ` Thomas Petazzoni via buildroot
@ 2026-10-10 9:23 ` Thomas Perale via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Perale via buildroot @ 2026-10-10 9:23 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: Thomas Perale, buildroot
In reply of:
> FindSWIG in CMake searches for swig4.0, swig3.0 and swig2.0 before it
> tries plain swig, and it searches the whole PATH for one name before
> moving on to the next. We only create swig3.0 and swig$(SWIG_VERSION_MAJOR)
> (swig4.5) symlinks in $(HOST_DIR)/bin, so a swig4.0 installed on the
> build machine, as Ubuntu 22.04 does with its swig4.0 package, takes
> precedence over our host-swig for every CMake package that does not pass
> SWIG_EXECUTABLE explicitly. With CMake 3.22.1, libftdi1 with Python
> bindings ends up with
>
> -- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.2", ...)
>
> Also create a swig4.0 symlink, and update the comment accordingly.
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> Assisted-by: Claude:claude-opus-5
Applied to 2025.02.x & 2026.08.x. Thanks
> ---
> package/swig/swig.mk | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/package/swig/swig.mk b/package/swig/swig.mk
> index e277f5049a..4dac64dadc 100644
> --- a/package/swig/swig.mk
> +++ b/package/swig/swig.mk
> @@ -30,18 +30,19 @@ endef
>
> HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_WRAPPER
>
> -# CMake looks first at swig3.0, then swig2.0 and then swig. However,
> -# when doing the search, it will look into the PATH for swig2.0 first,
> -# and then for swig.
> +# CMake looks first for swig4.0, then swig3.0 and swig2.0, and only
> +# then for swig. However, it searches the whole PATH for one name before
> +# trying the next one.
> # While the PATH contains first our $(HOST_DIR)/bin, it also contains
> # /usr/bin and other system directories. Therefore, if there is an
> -# installed swig3.0 on the system, it will get the preference over the
> -# swig installed in $(HOST_DIR)/bin, which isn't nice. To prevent
> -# this from happening we create a symbolic link swig3.0 -> swig, so that
> -# our swig always gets used.
> +# installed swig4.0 or swig3.0 on the system, it will get the preference
> +# over the swig installed in $(HOST_DIR)/bin, which isn't nice. To prevent
> +# this from happening we create swig4.0 and swig3.0 symbolic links to
> +# swig, so that our swig always gets used.
>
> define HOST_SWIG_INSTALL_SYMLINK
> ln -fs swig $(HOST_DIR)/bin/swig$(SWIG_VERSION_MAJOR)
> + ln -fs swig $(HOST_DIR)/bin/swig4.0
> ln -fs swig $(HOST_DIR)/bin/swig3.0
> endef
>
> --
> 2.34.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-10 9:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 13:15 [Buildroot] [PATCH] package/swig: also create a swig4.0 symlink Yegor Yefremov via buildroot
2026-10-03 18:37 ` Thomas Petazzoni via buildroot
2026-10-10 9:23 ` Thomas Perale via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.