summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/swig/swig
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/swig/swig')
-rw-r--r--meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch65
-rw-r--r--meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch63
2 files changed, 0 insertions, 128 deletions
diff --git a/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
deleted file mode 100644
index 5e83e92725..0000000000
--- a/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
+++ /dev/null
@@ -1,65 +0,0 @@
1From b88a98348b3841f0b702e314631883d46f9f362d Mon Sep 17 00:00:00 2001
2From: "NODA, Kai" <nodakai@gmail.com>
3Date: Sun, 22 Apr 2012 17:01:02 +0900
4Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32
5 platforms.
6
7If it wasn't found, then fall back to a fixed string just as before.
8
9Upstream-Status: Submitted
10http://sourceforge.net/mailarchive/message.php?msg_id=29179733
11---
12 Source/Modules/main.cxx | 24 ++++++++++++++++++++++--
13 1 file changed, 22 insertions(+), 2 deletions(-)
14
15diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
16index 76b4f9d..de0a512 100644
17--- a/Source/Modules/main.cxx
18+++ b/Source/Modules/main.cxx
19@@ -25,6 +25,11 @@
20 #include <ctype.h>
21 #include <errno.h>
22 #include <limits.h> // for INT_MAX
23+#ifndef _WIN32
24+#include <cstddef>
25+#include <unistd.h> // for readlink
26+#include <sys/stat.h> // for stat
27+#endif
28
29 // Global variables
30
31@@ -895,9 +900,9 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) {
32
33 // Check for SWIG_LIB environment variable
34 if ((c = getenv("SWIG_LIB")) == (char *) 0) {
35+ char *p;
36 #if defined(_WIN32)
37 char buf[MAX_PATH];
38- char *p;
39 if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) {
40 *(p + 1) = '\0';
41 SwigLib = NewStringf("%sLib", buf); // Native windows installation path
42@@ -907,7 +912,22 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) {
43 if (Len(SWIG_LIB_WIN_UNIX) > 0)
44 SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw)
45 #else
46- SwigLib = NewString(SWIG_LIB);
47+ char buf[PATH_MAX];
48+ if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) &&
49+ (p = ::strstr(buf, "/bin/swig"))) {
50+ int major, minor, patch;
51+ const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch);
52+ if (3 == ret) {
53+ const ::ptrdiff_t dir_part_len = p - buf;
54+ ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch);
55+ struct ::stat stat_res;
56+ if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) {
57+ SwigLib = NewString(buf);
58+ }
59+ }
60+ }
61+ if (NULL == SwigLib)
62+ SwigLib = NewString(SWIG_LIB);
63 #endif
64 } else {
65 SwigLib = NewString(c);
diff --git a/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
deleted file mode 100644
index 9e16caecca..0000000000
--- a/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1From 57a15651b46a0f1f84a4dd15d67d104fbfbe3f6e Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Tue, 17 Jun 2014 08:18:17 +0200
4Subject: [PATCH] configure: use pkg-config for pcre detection
5
6Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
7Upstream-Status: Pending
8
9---
10 configure.ac | 39 +++++++--------------------------------
11 1 file changed, 7 insertions(+), 32 deletions(-)
12
13diff --git a/configure.ac b/configure.ac
14index c060028..a330266 100644
15--- a/configure.ac
16+++ b/configure.ac
17@@ -49,39 +49,14 @@ AC_MSG_RESULT([$with_pcre])
18
19 dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
20 if test x"${with_pcre}" = xyes ; then
21- AC_MSG_CHECKING([whether to use local PCRE2])
22- local_pcre_config=no
23- if test -z "$PCRE2_CONFIG"; then
24- if test -f `pwd`/pcre/pcre-swig-install/bin/pcre2-config; then
25- PCRE2_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre2-config
26- local_pcre_config=$PCRE2_CONFIG
27- fi
28- fi
29- AC_MSG_RESULT([$local_pcre_config])
30-fi
31-AS_IF([test "x$with_pcre" != xno],
32- [AX_PATH_GENERIC([pcre2],
33- [], dnl Minimal version of PCRE we need -- accept any
34- [], dnl custom sed script for version parsing is not needed
35- [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE2 library])
36- LIBS="$LIBS $PCRE2_LIBS"
37- CPPFLAGS="$CPPFLAGS $PCRE2_CFLAGS"
38- ],
39- [AC_MSG_FAILURE([
40- Cannot find pcre2-config script from PCRE2 (Perl Compatible Regular Expressions)
41- library package. This dependency is needed for configure to complete,
42- Either:
43- - Install the PCRE2 developer package on your system (preferred approach).
44- - Download the PCRE2 source tarball, build and install on your system
45- as you would for any package built from source distribution.
46- - Use the Tools/pcre-build.sh script to build PCRE2 just for SWIG to statically
47- link against. Run 'Tools/pcre-build.sh --help' for instructions.
48- (quite easy and does not require privileges to install PCRE2 on your system)
49- - Use configure --without-pcre to disable regular expressions support in SWIG
50- (not recommended).])
51- ],
52- [],[],[--libs8])
53+ PKG_CHECK_MODULES([PCRE], [libpcre2], [
54+ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
55+ LIBS="$LIBS $PCRE_LIBS"
56+ CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
57+ ], [
58+ AC_MSG_WARN([$PCRE_PKG_ERRORS])
59 ])
60+fi
61
62
63 dnl CCache