package/guile: New package
v2 cover package/guile: New package
This patch should fix all the suggestions made by Yann Morin. It adds the following:
- libatomic_ops: Add host-autotools-package
- libunistring: Add host-autotools-package
- bdwgc: A garbage collector library for C/C++
- Guile: A progamming language similar to Lisp.
Thanks!
Pedro Aguilar (4):
libatomic_ops: Add host-autotools-package
bdwgc: new package
libunistring: Add host-autotools-package
guile: new package
package/Config.in | 2 ++ package/bdwgc/Config.in | 11 ++++++++ package/bdwgc/bdwgc.mk | 19 +++++++++++++ package/guile/Config.in | 17 ++++++++++++ package/guile/guile-01-fix_arm_endianness.patch | 19 +++++++++++++ .../guile/guile-02-calculate-csqrt_manually.patch | 17 ++++++++++++ .../guile-03-undef_use_gnu_local_locale_api.patch | 16 +++++++++++ package/guile/guile.mk | 32 ++++++++++++++++++++++ package/libatomic_ops/libatomic_ops.mk | 1 + package/libunistring/libunistring.mk | 1 + 10 files changed, 135 insertions(+) create mode 100644 package/bdwgc/Config.in create mode 100644 package/bdwgc/bdwgc.mk create mode 100644 package/guile/Config.in create mode 100644 package/guile/guile-01-fix_arm_endianness.patch create mode 100644 package/guile/guile-02-calculate-csqrt_manually.patch create mode 100644 package/guile/guile-03-undef_use_gnu_local_locale_api.patch create mode 100644 package/guile/guile.mk
Signature · 1 line
1.9.1
PATCH v2 1/4 libatomic_ops: Add host-autotools-package
The host-libatomic_ops is needed by host-bdwgc that is needed in turn by guile.
bdwgc bundles its own version of libatomic_ops, but it's prefered to use the external one that is the default.
---
Changes v1 -> v2:
- Add host-libatomic_ops (suggested by Yann Morin)
--- package/libatomic_ops/libatomic_ops.mk | 1 + 1 file changed, 1 insertion(+)
package/libatomic_ops/libatomic_ops.mk +1 -0
@@ -20,3 +20,4 @@ LIBATOMIC_OPS_LICENSE_FILES = doc/LICENSING.txt COPYING LIBATOMIC_OPS_INSTALL_STAGING = YES $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
1.9.1
PATCH v2 2/4 bdwgc: new package
In reply to Pedro Aguilarbdwgc is a garbage collector for C and C++. The Boehm-Demers-Weiser conservative garbage collector can be used as a garbage collecting replacement for C 'malloc' or C++ 'new'.
---
Changes v1 -> v2
- Add external default dependency on libatomic_ops
- Fix several formatting issues
(All changes suggested by Yann Morin)
--- package/Config.in | 1 + package/bdwgc/Config.in | 11 +++++++++++ package/bdwgc/bdwgc.mk | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 package/bdwgc/Config.in create mode 100644 package/bdwgc/bdwgc.mk
package/Config.in +1 -0
@@ -942,6 +942,7 @@ endmenu menu "Miscellaneous" source "package/aespipe/Config.in" source "package/bc/Config.in" + source "package/bdwgc/Config.in" source "package/clamav/Config.in" source "package/collectd/Config.in" source "package/empty/Config.in"
package/bdwgc/Config.in new file +11 -0
@@ -0,0 +1,11 @@ +config BR2_PACKAGE_BDWGC + bool "bdwgc" + depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS + select BR2_PACKAGE_LIBATOMIC_OPS + help + The Boehm-Demers-Weiser conservative garbage collector can + be used as a garbage collecting replacement for C 'malloc' + or C++ 'new'. + + http://www.hboehm.info/gc/ +
package/bdwgc/bdwgc.mk new file +19 -0
@@ -0,0 +1,19 @@ +################################################################################ +# +# bdwgc +# +################################################################################ + +BDWGC_VERSION = 7.2f +BDWGC_SOURCE = gc-$(BDWGC_VERSION).tar.gz +BDWGC_SITE = http://www.hboehm.info/gc/gc_source +BDWGC_INSTALL_STAGING = YES +BDWGC_LICENSE = bdwgc license +BDWGC_LICENSE_FILES = README +BDWGC_LIBTOOL_PATCH = NO + +BDWGC_DEPENDENCIES = host-bdwgc libatomic_ops + +$(eval $(autotools-package)) +$(eval $(host-autotools-package)) +
Signature · 1 line
1.9.1
PATCH v2 2/4 bdwgc: new package
Quoted 26 lines · Pedro Aguilar
bdwgc is a garbage collector for C and C++. The Boehm-Demers-Weiser conservative garbage collector can be used as a garbage collecting replacement for C 'malloc' or C++ 'new'.
Signed-off-by Pedro Aguilar <[email protected]>---
Changes v1 -> v2
- Add external default dependency onlibatomic_ops
- Fix several formatting issues
(All changes suggested by Yann Morin)Signed-off-by Pedro Aguilar <[email protected]>--- package/Config.in | 1 + package/bdwgc/Config.in | 11 +++++++++++ package/bdwgc/bdwgc.mk | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 package/bdwgc/Config.in create mode 100644 package/bdwgc/bdwgc.mkpackage/Config.in +0
-0
package/Config.in endmenu · line 945
Quoted 4 lines
package/Config.in +1
-0@@ -942,6 +942,7 @@ endmenu menu "Miscellaneous" source "package/aespipe/Config.in" source "package/bc/Config.in" + source "package/bdwgc/Config.in"
This is a library, right? So doesn't it belong under Libraries/Other rather
than here?
Quoted 28 lines
package/Config.in +0
-0source "package/clamav/Config.in" source "package/collectd/Config.in" source "package/empty/Config.in"package/bdwgc/Config.in new file +11
-0@@ -0,0 +1,11 @@ +config BR2_PACKAGE_BDWGC + bool "bdwgc" + depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS + select BR2_PACKAGE_LIBATOMIC_OPS + help + The Boehm-Demers-Weiser conservative garbage collector can + be used as a garbage collecting replacement for C 'malloc' + or C++ 'new'. + + http://www.hboehm.info/gc/ +package/bdwgc/bdwgc.mk new file +2
-0@@ -0,0 +1,19 @@ +################################################################################ +#
package/bdwgc/bdwgc.mk line 12
Quoted 10 lines
package/bdwgc/bdwgc.mk new file +10
-0+# bdwgc +# +################################################################################ + +BDWGC_VERSION = 7.2f +BDWGC_SOURCE = gc-$(BDWGC_VERSION).tar.gz +BDWGC_SITE = http://www.hboehm.info/gc/gc_source +BDWGC_INSTALL_STAGING = YES +BDWGC_LICENSE = bdwgc license +BDWGC_LICENSE_FILES = README
Does the readme contain all the information of that license mess or are there
additional files?
package/bdwgc/bdwgc.mk line 13
Quoted 1 line
package/bdwgc/bdwgc.mk new file +1
-0+BDWGC_LIBTOOL_PATCH = NO
There should be a comment explaining why this is necessary.
Regards,
Arnout
Quoted 7 lines
package/bdwgc/bdwgc.mk new file +6
-0+ +BDWGC_DEPENDENCIES = host-bdwgc libatomic_ops + +$(eval $(autotools-package)) +$(eval $(host-autotools-package)) +
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v2 2/4 bdwgc: new package
Hi Arnout,
Quoted 22 lines · Arnout Vandecappelle
Quoted 21 lines · Pedro Aguilar
bdwgc is a garbage collector for C and C++. The Boehm-Demers-Weiser conservative garbage collector can be used as a garbage collecting replacement for C 'malloc' or C++ 'new'.
Signed-off-by Pedro Aguilar <[email protected]>---
Changes v1 -> v2
- Add external default dependency onlibatomic_ops
- Fix several formatting issues
(All changes suggested by Yann Morin)Signed-off-by Pedro Aguilar <[email protected]>--- package/Config.in | 1 + package/bdwgc/Config.in | 11 +++++++++++ package/bdwgc/bdwgc.mk | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+)create mode 100644 package/bdwgc/Config.in
create mode 100644package/bdwgc/bdwgc.mk
Quoted 12 lines
package/Config.in endmenu · line 945
Quoted 9 lines
package/Config.in +1
-0@@ -942,6 +942,7 @@ endmenu menu "Miscellaneous" source "package/aespipe/Config.in" source "package/bc/Config.in" + source "package/bdwgc/Config.in"This is a library, right? So doesn't it belong under Libraries/Other rather
than here?
Right, I'll change it.
Quoted 33 lines
Quoted 33 lines
package/Config.in +0
-0source "package/clamav/Config.in" source "package/collectd/Config.in" source "package/empty/Config.in"package/bdwgc/Config.in new file +11
-0@@ -0,0 +1,11 @@ +config BR2_PACKAGE_BDWGC + bool "bdwgc" + depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS + select BR2_PACKAGE_LIBATOMIC_OPS + help + The Boehm-Demers-Weiser conservative garbage collector can + be used as a garbage collecting replacement for C 'malloc' + or C++ 'new'. + + http://www.hboehm.info/gc/ +package/bdwgc/bdwgc.mk new file +7
-0@@ -0,0 +1,19 @@ +################################################################################ +# +# bdwgc +# +################################################################################ + +BDWGC_VERSION = 7.2f
Quoted 8 lines
package/bdwgc/bdwgc.mk line 12
Quoted 5 lines
package/bdwgc/bdwgc.mk new file +5
-0+BDWGC_SOURCE = gc-$(BDWGC_VERSION).tar.gz +BDWGC_SITE = http://www.hboehm.info/gc/gc_source +BDWGC_INSTALL_STAGING = YES +BDWGC_LICENSE = bdwgc license +BDWGC_LICENSE_FILES = READMEDoes the readme contain all the information of that license mess or are there
additional files?
No, it's only this file.
Quoted 3 lines
package/bdwgc/bdwgc.mk line 13
Quoted 1 line
package/bdwgc/bdwgc.mk new file +1
-0+BDWGC_LIBTOOL_PATCH = NOThere should be a comment explaining why this is necessary.
I had a building issue. I'll comment it in the following patch set.
Thanks for the feedback.
Signature · 2 lines
Pedro Aguilar http://paguilar.org
PATCH v2 3/4 libunistring: Add host-autotools-package
In reply to Pedro AguilarThe host-libunistring is needed by guile
---
Changes v1 -> v2:
- Add host-libunistring (suggested by Yann Morin)
--- package/libunistring/libunistring.mk | 1 + 1 file changed, 1 insertion(+)
package/libunistring/libunistring.mk +1 -0
@@ -17,3 +17,4 @@ LIBUNISTRING_CONF_OPTS += --disable-threads endif $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
1.9.1
PATCH v2 4/4 guile: new package
In reply to Pedro AguilarGuile is an interpreter and compiler for the Scheme programming language, a clean and elegant dialect of Lisp.
---
Changes v1 -> v2:
- Add all needed dependencies
- Explain GUILE_CONF_ENV arguments
- Remove PKG_CONFIG_HOST_BINARY
- Fix patches formatting
- Add thread comments in Config.in
(All changes suggested by Yann Morin)
--- package/Config.in | 1 + package/guile/Config.in | 17 ++++++++++++ package/guile/guile-01-fix_arm_endianness.patch | 19 +++++++++++++ .../guile/guile-02-calculate-csqrt_manually.patch | 17 ++++++++++++ .../guile-03-undef_use_gnu_local_locale_api.patch | 16 +++++++++++ package/guile/guile.mk | 32 ++++++++++++++++++++++ 6 files changed, 102 insertions(+) create mode 100644 package/guile/Config.in create mode 100644 package/guile/guile-01-fix_arm_endianness.patch create mode 100644 package/guile/guile-02-calculate-csqrt_manually.patch create mode 100644 package/guile/guile-03-undef_use_gnu_local_locale_api.patch create mode 100644 package/guile/guile.mk
package/Config.in +1 -0
@@ -393,6 +393,7 @@ endmenu menu "Interpreter languages and scripting" source "package/enscript/Config.in" source "package/erlang/Config.in" + source "package/guile/Config.in" source "package/haserl/Config.in" source "package/jamvm/Config.in" source "package/jimtcl/Config.in"
package/guile/Config.in new file +17 -0
@@ -0,0 +1,17 @@ +config BR2_PACKAGE_GUILE + bool "guile" + depends on BR2_TOOLCHAIN_HAS_THREADS + select BR2_PACKAGE_LIBUNISTRING + select BR2_PACKAGE_LIBFFI + select BR2_PACKAGE_GMP + select BR2_PACKAGE_BDWGC + select BR2_PACKAGE_FLEX + select BR2_PACKAGE_LIBTOOL + help + Guile is an interpreter and compiler for the Scheme + programming language, a clean and elegant dialect of Lisp. + + http://www.gnu.org/software/guile + + comment "guile needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS
package/guile/guile-01-fix_arm_endianness.patch new file +19 -0
@@ -0,0 +1,19 @@ +Fix support for ARM endianness, otherwise it gives the error +"unknown CPU endianness" + +Signed-off-by: Pedro Aguilar <[email protected]> + +diff -Nau guile-2.0.11.orig/module/system/base/target.scm guile-2.0.11/module/system/base/target.scm +--- guile-2.0.11.orig/module/system/base/target.scm 2013-02-28 09:42:45.000000000 +0100 ++++ guile-2.0.11/module/system/base/target.scm 2014-11-01 21:23:15.301242749 +0100 +@@ -70,7 +70,9 @@ + ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu" + "mips" "mips64")) + (endianness big)) +- ((string-match "^arm.*el" cpu) ++ ((string-match "^arm.*eb" cpu) ++ (endianness big)) ++ ((string-match "^arm.*" cpu) + (endianness little)) + (else + (error "unknown CPU endianness" cpu)))))
package/guile/guile-02-calculate-csqrt_manually.patch new file +17 -0
@@ -0,0 +1,17 @@ +Calculate manually the sqrt() since scm_from_complex_double() gives an error +on ARM using uclibc. + +Signed-off-by: Pedro Aguilar <[email protected]> + +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c +--- guile-2.0.11.orig/libguile/numbers.c 2014-03-12 14:24:54.000000000 +0100 ++++ guile-2.0.11/libguile/numbers.c 2014-11-01 21:07:20.301263587 +0100 +@@ -10260,8 +10260,6 @@ + { + #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT \ + && defined SCM_COMPLEX_VALUE +- return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (z))); +-#else + double re = SCM_COMPLEX_REAL (z); + double im = SCM_COMPLEX_IMAG (z); + return scm_c_make_polar (sqrt (hypot (re, im)),
package/guile/guile-03-undef_use_gnu_local_locale_api.patch new file +16 -0
@@ -0,0 +1,16 @@ +Undef USE_GNU_LOCALE_API since it's not mandatory. + +Signed-off-by: Pedro Aguilar <[email protected]> + +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c +--- guile-2.0.11.orig/libguile/i18n.c 2014-01-21 22:25:11.000000000 +0100 ++++ guile-2.0.11/libguile/i18n.c 2014-11-01 21:59:29.001195319 +0100 +@@ -54,7 +54,7 @@ + Specifications Issue 7'' (aka. "POSIX 2008"): + + http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html */ +-# define USE_GNU_LOCALE_API ++# undef USE_GNU_LOCALE_API + #endif + + #include "libguile/posix.h" /* for `scm_i_locale_mutex' */
package/guile/guile.mk new file +32 -0
@@ -0,0 +1,32 @@ +################################################################################ +# +# guile +# +################################################################################ + +GUILE_VERSION = 2.0.11 +GUILE_SOURCE = guile-$(GUILE_VERSION).tar.xz +GUILE_SITE = ftp://ftp.gnu.org/pub/gnu/guile +GUILE_INSTALL_STAGING = YES +GUILE_LICENSE = LGPLv3+ +GUILE_LICENSE_FILES = LICENSE COPYING COPYING.LESSER +GUILE_DEPENDENCIES = host-guile libunistring libffi gmp bdwgc flex libtool + +HOST_GUILE_DEPENDENCIES = host-intltool host-libunistring host-libffi host-gmp host-bdwgc host-flex host-libtool + +# We need to specify libffi and bdwgc CFLAGS and LIBS since guile's configure +# script does not find them. +# The HAVE_GC* CFLAGS specify that we wil use internal callbacks instead +# of the ones provided by bdwgc. Eg. HAVE_GC_SET_FINALIZER_NOTIFIER specifies +# that we won't use bdwgc's GC_finalizer_notifier callback. +# Trying to use these specific bdwgc's callbacks breaks guile's building. +GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \ + LIBFFI_CFLAGS="-I$(TARGET_DIR)/usr/include" \ + LIBFFI_LIBS="-L$(TARGET_DIR)/usr/lib -lffi" \ + BDW_GC_CFLAGS="-I$(TARGET_DIR)/usr/include" \ + BDW_GC_LIBS="-L$(TARGET_DIR)/usr/lib -lgc" \ + CFLAGS+="-DHAVE_GC_SET_FINALIZER_NOTIFIER -DHAVE_GC_GET_HEAP_USAGE_SAFE -DHAVE_GC_GET_FREE_SPACE_DIVISOR -DHAVE_GC_SET_FINALIZE_ON_DEMAND" + +$(eval $(autotools-package)) +$(eval $(host-autotools-package)) +
Signature · 1 line
1.9.1
PATCH v2 4/4 guile: new package
Dear Pedro Aguilar,
Quoted 4 lines · Pedro Aguilar
Guile is an interpreter and compiler for the Scheme programming language, a clean and elegant dialect of Lisp.
Signed-off-by Pedro Aguilar <[email protected]>
Thanks for this contribution! A few comments below.
Quoted 6 lines
package/guile/Config.in new file +0
-0
package/guile/Config.in line 9
Quoted 9 lines
package/guile/Config.in new file +9
-0@@ -0,0 +1,17 @@ +config BR2_PACKAGE_GUILE + bool "guile" + depends on BR2_TOOLCHAIN_HAS_THREADS + select BR2_PACKAGE_LIBUNISTRING + select BR2_PACKAGE_LIBFFI + select BR2_PACKAGE_GMP + select BR2_PACKAGE_BDWGC + select BR2_PACKAGE_FLEX + select BR2_PACKAGE_LIBTOOL
Are sure you really need flex and libtool on the target?
package/guile/Config.in line 17
Quoted 8 lines
package/guile/Config.in new file +8
-0+ help + Guile is an interpreter and compiler for the Scheme + programming language, a clean and elegant dialect of Lisp. + + http://www.gnu.org/software/guile + + comment "guile needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS
No indentation for the "comment" line, and indentation of one tab for the "depends on" line.
package/guile/guile-01-fix_arm_endianness.patch line 4
Quoted 10 lines
package/guile/guile-01-fix_arm_endianness.patch new file +4
-0@@ -0,0 +1,19 @@ +Fix support for ARM endianness, otherwise it gives the error +"unknown CPU endianness" + +Signed-off-by: Pedro Aguilar <[email protected]>
Can you submit this patch upstream to the guile developers? Please Cc me when sending the patch upstream, as I know the Guile maintainer, so seeing my name in Cc will probably make him look at the patch :)
Quoted 13 lines
package/guile/guile-02-calculate-csqrt_manually.patch new file +7
-0@@ -0,0 +1,17 @@ +Calculate manually the sqrt() since scm_from_complex_double() gives an error +on ARM using uclibc. + +Signed-off-by: Pedro Aguilar <[email protected]> + +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c +--- guile-2.0.11.orig/libguile/numbers.c 2014-03-12 14:24:54.000000000 +0100
package/guile/guile-02-calculate-csqrt_manually.patch line 17
Quoted 10 lines
package/guile/guile-02-calculate-csqrt_manually.patch new file +10
-0++++ guile-2.0.11/libguile/numbers.c 2014-11-01 21:07:20.301263587 +0100 +@@ -10260,8 +10260,6 @@ + { + #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT \ + && defined SCM_COMPLEX_VALUE +- return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (z))); +-#else + double re = SCM_COMPLEX_REAL (z); + double im = SCM_COMPLEX_IMAG (z); + return scm_c_make_polar (sqrt (hypot (re, im)),
It would be good to have an upstreamable version of this. Since uClibc doesn't implement C99 complex math, I believe HAVE_USABLE_CSQRT should be false. Can you check why it isn't the case?
Quoted 9 lines
package/guile/guile-03-undef_use_gnu_local_locale_api.patch new file +3
-0@@ -0,0 +1,16 @@ +Undef USE_GNU_LOCALE_API since it's not mandatory. + +Signed-off-by: Pedro Aguilar <[email protected]>
package/guile/guile-03-undef_use_gnu_local_locale_api.patch line 13
Quoted 10 lines
package/guile/guile-03-undef_use_gnu_local_locale_api.patch new file +10
-0+ +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c +--- guile-2.0.11.orig/libguile/i18n.c 2014-01-21 22:25:11.000000000 +0100 ++++ guile-2.0.11/libguile/i18n.c 2014-11-01 21:59:29.001195319 +0100 +@@ -54,7 +54,7 @@ + Specifications Issue 7'' (aka. "POSIX 2008"): + + http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html */ +-# define USE_GNU_LOCALE_API ++# undef USE_GNU_LOCALE_API
Can you explain a bit more? Again, our goal is to have patches that can potentially be accepted by the upstream project.
Quoted 6 lines
package/guile/guile.mk new file +0
-0
package/guile/guile.mk line 9
Quoted 9 lines
package/guile/guile.mk new file +9
-0@@ -0,0 +1,32 @@ +################################################################################ +# +# guile +# +################################################################################ + +GUILE_VERSION = 2.0.11 +GUILE_SOURCE = guile-$(GUILE_VERSION).tar.xz +GUILE_SITE = ftp://ftp.gnu.org/pub/gnu/guile
Use $(BR2_GNU_MIRROR)
Also, do not align the '=' signs.
package/guile/guile.mk line 13
Quoted 4 lines
package/guile/guile.mk new file +4
-0+GUILE_INSTALL_STAGING = YES +GUILE_LICENSE = LGPLv3+ +GUILE_LICENSE_FILES = LICENSE COPYING COPYING.LESSER +GUILE_DEPENDENCIES = host-guile libunistring libffi gmp bdwgc flex libtool
So really flex and libtool needed on the target?
package/guile/guile.mk line 15
Quoted 1 line
package/guile/guile.mk new file +1
-0+HOST_GUILE_DEPENDENCIES = host-intltool host-libunistring host-libffi host-gmp host-bdwgc host-flex host-libtool
You need intltool for the host variant but not for the target onbe?
package/guile/guile.mk line 27
Quoted 12 lines
package/guile/guile.mk new file +12
-0+ +# We need to specify libffi and bdwgc CFLAGS and LIBS since guile's configure +# script does not find them. +# The HAVE_GC* CFLAGS specify that we wil use internal callbacks instead +# of the ones provided by bdwgc. Eg. HAVE_GC_SET_FINALIZER_NOTIFIER specifies +# that we won't use bdwgc's GC_finalizer_notifier callback. +# Trying to use these specific bdwgc's callbacks breaks guile's building. +GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \ + LIBFFI_CFLAGS="-I$(TARGET_DIR)/usr/include" \ + LIBFFI_LIBS="-L$(TARGET_DIR)/usr/lib -lffi" \ + BDW_GC_CFLAGS="-I$(TARGET_DIR)/usr/include" \ + BDW_GC_LIBS="-L$(TARGET_DIR)/usr/lib -lgc" \
Do, pointing to $(TARGET_DIR) for headers and libraries is not the correct thing to do. You should point to $(STAGING_DIR) instead.
However, passing -L$(STAGING_DIR)/usr/lib or -I$(STAGING_DIR)/usr/include is unnecessary since the Buildroot cross-compiler already looks there for libraries/headers by default.
package/guile/guile.mk line 28
Quoted 1 line
package/guile/guile.mk new file +1
-0+ CFLAGS+="-DHAVE_GC_SET_FINALIZER_NOTIFIER -DHAVE_GC_GET_HEAP_USAGE_SAFE -DHAVE_GC_GET_FREE_SPACE_DIVISOR -DHAVE_GC_SET_FINALIZE_ON_DEMAND"
Nope, you override the CFLAGS passed by Buildroot here. You should instead do:
CFLAGS="$(TARGET_CFLAGS) -foo -bar -baz"
package/guile/guile.mk line 31
Quoted 2 lines
package/guile/guile.mk new file +2
-0+$(eval $(autotools-package)) +$(eval $(host-autotools-package))
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 4/4 guile: new package
Hi Thomas,
Thanks for your comments and support.
I've already fixed Config.in and guile.mk.
Regarding the guile patches:
Quoted 17 lines · Thomas Petazzoni
Dear Pedro Aguilar,
package/guile/guile-01-fix_arm_endianness.patch line 4
Quoted 10 lines · Pedro Aguilar
package/guile/guile-01-fix_arm_endianness.patch new file +4
-0@@ -0,0 +1,19 @@ +Fix support for ARM endianness, otherwise it gives the error +"unknown CPU endianness" + +Signed-off-by: Pedro Aguilar <[email protected]>Can you submit this patch upstream to the guile developers? Please Cc me when sending the patch upstream, as I know the Guile maintainer, so seeing my name in Cc will probably make him look at the patch :)
I just noticed that this is already fixed in their git repo, so I changed the patch that reflects their fix.
Quoted 19 lines
Quoted 19 lines
package/guile/guile-02-calculate-csqrt_manually.patch new file +13
-0@@ -0,0 +1,17 @@ +Calculate manually the sqrt() since scm_from_complex_double() gives an error +on ARM using uclibc. + +Signed-off-by: Pedro Aguilar <[email protected]> + +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c +--- guile-2.0.11.orig/libguile/numbers.c 2014-03-12 14:24:54.000000000 +0100 ++++ guile-2.0.11/libguile/numbers.c 2014-11-01 21:07:20.301263587 +0100 +@@ -10260,8 +10260,6 @@ + { + #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT \ + && defined SCM_COMPLEX_VALUE +- return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (z)));
Quoted 8 lines
package/guile/guile-02-calculate-csqrt_manually.patch line 17
Quoted 4 lines
package/guile/guile-02-calculate-csqrt_manually.patch new file +4
-0+-#else + double re = SCM_COMPLEX_REAL (z); + double im = SCM_COMPLEX_IMAG (z); + return scm_c_make_polar (sqrt (hypot (re, im)),It would be good to have an upstreamable version of this. Since uClibc doesn't implement C99 complex math, I believe
HAVE_USABLE_CSQRTshould be false. Can you check why it isn't the case?
They only use HAVE_USABLE_CSQRT because of a bug in old glibc versions and they set it to 1 if this bug is not present. Since uclibc doesn't have this bug, HAVE_USABLE_CSQRT is always 1.
I modified configure.ac and if we're cross-compiling, it sets HAVE_USABLE_CSQRT to 0. This would be a safe default since disabling this define doesn't break anything:
configure.ac 2014-11-03 23:59:51.897267207 +0100 renamed from configure.ac 2014-03-12 14:36:02.000000000 +0100 +1 -1
@@ -862,7 +862,7 @@ }]])], [guile_cv_use_csqrt=yes], [guile_cv_use_csqrt="no, glibc 2.3 bug"], - [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])]) + [guile_cv_use_csqrt="no (cross-compiling)"])]) case $guile_cv_use_csqrt in yes*) AC_DEFINE([HAVE_USABLE_CSQRT], 1, [Define to 1 if csqrt is
bug-free])
Quoted 14 lines
Quoted 14 lines
package/guile/guile-03-undef_use_gnu_local_locale_api.patch new file +8
-0@@ -0,0 +1,16 @@ +Undef USE_GNU_LOCALE_API since it's not mandatory. + +Signed-off-by: Pedro Aguilar <[email protected]> + +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c +--- guile-2.0.11.orig/libguile/i18n.c 2014-01-21 22:25:11.000000000 +0100 ++++ guile-2.0.11/libguile/i18n.c 2014-11-01 21:59:29.001195319 +0100 +@@ -54,7 +54,7 @@
Quoted 8 lines
package/guile/guile-03-undef_use_gnu_local_locale_api.patch line 13
Quoted 5 lines
package/guile/guile-03-undef_use_gnu_local_locale_api.patch new file +5
-0+ Specifications Issue 7'' (aka. "POSIX 2008"): + + http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html */ +-# define USE_GNU_LOCALE_API ++# undef USE_GNU_LOCALE_APICan you explain a bit more? Again, our goal is to have patches that can potentially be accepted by the upstream project.
With this patch I avoid the compilation error 'dereferencing pointer to incomplete type' caused by an alias for glibc's locale type. Since guile works fine without this define, may be the proper patch would be to enable/disable it according to the used library (glib, uclibc, ...) although I'm not sure how to do this at 'configure' time.
Do you have any suggestion or different ideas?
Thanks!
Signature · 2 lines
Pedro Aguilar http://paguilar.org