diff mbox series

[v2,1/2] package/netsurf: fix build with BR2_OPTIMIZE_FAST

Message ID 20220422212117.1291718-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [v2,1/2] package/netsurf: fix build with BR2_OPTIMIZE_FAST | expand

Commit Message

Fabrice Fontaine April 22, 2022, 9:21 p.m. UTC
Disable duktape with BR2_OPTIMIZE_FAST to fix the following build
failure:

In file included from content/handlers/javascript/duktape/duktape.h:195,
                 from build/Linux-framebuffer/duktape/application_cache.c:21:
content/handlers/javascript/duktape/duk_config.h:2861:2: error: #error __FAST_MATH__ defined, refusing to compile
 2861 | #error __FAST_MATH__ defined, refusing to compile
      |  ^~~~~

Fixes:
 - http://autobuild.buildroot.org/results/2f1b42e2be3aa76cbacd84f3d0ad8b13edce6982

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/netsurf/netsurf.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Arnout Vandecappelle April 25, 2022, 7:33 p.m. UTC | #1
On 22/04/2022 23:21, Fabrice Fontaine wrote:
> Disable duktape with BR2_OPTIMIZE_FAST to fix the following build
> failure:
> 
> In file included from content/handlers/javascript/duktape/duktape.h:195,
>                   from build/Linux-framebuffer/duktape/application_cache.c:21:
> content/handlers/javascript/duktape/duk_config.h:2861:2: error: #error __FAST_MATH__ defined, refusing to compile
>   2861 | #error __FAST_MATH__ defined, refusing to compile
>        |  ^~~~~
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/2f1b42e2be3aa76cbacd84f3d0ad8b13edce6982
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>   package/netsurf/netsurf.mk | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/package/netsurf/netsurf.mk b/package/netsurf/netsurf.mk
> index 1064698c12..574c1423df 100644
> --- a/package/netsurf/netsurf.mk
> +++ b/package/netsurf/netsurf.mk
> @@ -14,6 +14,17 @@ NETSURF_CPE_ID_VENDOR = netsurf-browser
>   NETSURF_DEPENDENCIES = expat jpeg libpng \
>   	host-bison host-flex host-gperf host-pkgconf host-vim
>   
> +# internal duktape doesn't build with BR2_OPTIMIZE_FAST
> +ifeq ($(BR2_OPTIMIZE_FAST),y)
> +define NETSURF_DUKTAPE_CONFIGURE_CMDS
> +	echo "override NETSURF_USE_DUKTAPE := NO"       >> $(@D)/netsurf/Makefile.config
> +endef
> +else
> +define NETSURF_DUKTAPE_CONFIGURE_CMDS
> +	echo "override NETSURF_USE_DUKTAPE := YES"      >> $(@D)/netsurf/Makefile.config
> +endef
> +endif

  Ideally we'd unbundle duktape of course. I took a look, doesn't look doable.

  Thing is, with this, based on optimisation option, you have netsurf with or 
without javascript support. Not exactly ideal. I think this should be a 
user-visible option then.

  Anyway, for now, applied to master, thanks.

  Regards,
  Arnout

> +
>   ifeq ($(BR2_PACKAGE_NETSURF_GTK),y)
>   NETSURF_DEPENDENCIES += libgtk2
>   NETSURF_FRONTEND = gtk2
> @@ -77,6 +88,7 @@ endef
>   endif
>   
>   define NETSURF_CONFIGURE_CMDS
> +	$(NETSURF_DUKTAPE_CONFIGURE_CMDS)
>   	$(NETSURF_ICONV_CONFIGURE_CMDS)
>   	$(NETSURF_SVG_CONFIGURE_CMDS)
>   	$(NETSURF_FONTLIB_CONFIGURE_CMDS)
diff mbox series

Patch

diff --git a/package/netsurf/netsurf.mk b/package/netsurf/netsurf.mk
index 1064698c12..574c1423df 100644
--- a/package/netsurf/netsurf.mk
+++ b/package/netsurf/netsurf.mk
@@ -14,6 +14,17 @@  NETSURF_CPE_ID_VENDOR = netsurf-browser
 NETSURF_DEPENDENCIES = expat jpeg libpng \
 	host-bison host-flex host-gperf host-pkgconf host-vim
 
+# internal duktape doesn't build with BR2_OPTIMIZE_FAST
+ifeq ($(BR2_OPTIMIZE_FAST),y)
+define NETSURF_DUKTAPE_CONFIGURE_CMDS
+	echo "override NETSURF_USE_DUKTAPE := NO"       >> $(@D)/netsurf/Makefile.config
+endef
+else
+define NETSURF_DUKTAPE_CONFIGURE_CMDS
+	echo "override NETSURF_USE_DUKTAPE := YES"      >> $(@D)/netsurf/Makefile.config
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_NETSURF_GTK),y)
 NETSURF_DEPENDENCIES += libgtk2
 NETSURF_FRONTEND = gtk2
@@ -77,6 +88,7 @@  endef
 endif
 
 define NETSURF_CONFIGURE_CMDS
+	$(NETSURF_DUKTAPE_CONFIGURE_CMDS)
 	$(NETSURF_ICONV_CONFIGURE_CMDS)
 	$(NETSURF_SVG_CONFIGURE_CMDS)
 	$(NETSURF_FONTLIB_CONFIGURE_CMDS)