Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 3/5] dos2unix: remove WCHAR dependency
Date: Fri, 4 Sep 2015 11:52:25 +0100	[thread overview]
Message-ID: <55E977E9.3040404@imgtec.com> (raw)
In-Reply-To: <934c9f1ca101afba70b5fe1efeaea01767ec95fd.1441253454.git.baruch@tkos.co.il>

Dear Baruch Siach,

On 09/03/2015 05:10 AM, Baruch Siach wrote:
> Add a patch fixing wchar build failure.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> I added this as a separate patch after version bump to avoid package patch
> rebase churn.
> 
> v3:
>    * New patch in this series (Peter)
> ---
>  .../dos2unix/0001-fix-build-without-wchar.patch    | 59 ++++++++++++++++++++++
>  package/dos2unix/Config.in                         |  4 --
>  package/dos2unix/dos2unix.mk                       |  4 ++
>  3 files changed, 63 insertions(+), 4 deletions(-)
>  create mode 100644 package/dos2unix/0001-fix-build-without-wchar.patch
> 
> diff --git a/package/dos2unix/0001-fix-build-without-wchar.patch b/package/dos2unix/0001-fix-build-without-wchar.patch
> new file mode 100644
> index 000000000000..c3188363ec7e
> --- /dev/null
> +++ b/package/dos2unix/0001-fix-build-without-wchar.patch
> @@ -0,0 +1,59 @@
> +Don't reference wchar_t when D2U_UNICODE is not defined.
> +
> +Patch status: upstream (http://sourceforge.net/p/dos2unix/code/736)
> +
> +Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> +
> +diff -Nuar dos2unix-7.3.orig/common.c dos2unix-7.3/common.c
> +--- dos2unix-7.3.orig/common.c	2015-08-21 02:02:31.000000000 +0300
> ++++ dos2unix-7.3/common.c	2015-09-02 22:13:33.648486366 +0300
> +@@ -1615,9 +1615,11 @@
> +     } else if (pFlag->status & WRONG_CODEPAGE) {
> +       d2u_fprintf(stderr,"%s: ",progname);
> +       d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
> ++#ifdef D2U_UNICODE
> +     } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
> +       d2u_fprintf(stderr,"%s: ",progname);
> +       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), "stdin", (int)sizeof(wchar_t));
> ++#endif
> +     } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
> +       d2u_fprintf(stderr,"%s: ",progname);
> +       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), "stdin", pFlag->line_nr);
> +@@ -1701,9 +1703,11 @@
> +   } else if (pFlag->status & WRONG_CODEPAGE) {
> +     d2u_fprintf(stderr,"%s: ",progname);
> +     d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
> ++#ifdef D2U_UNICODE
> +   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
> +     d2u_fprintf(stderr,"%s: ",progname);
> +     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
> ++#endif
> +   } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
> +     d2u_fprintf(stderr,"%s: ",progname);
> +     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
> +@@ -1781,9 +1785,11 @@
> +   } else if (pFlag->status & WRONG_CODEPAGE) {
> +     d2u_fprintf(stderr,"%s: ",progname);
> +     d2u_fprintf(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode);
> ++#ifdef D2U_UNICODE
> +   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
> +     d2u_fprintf(stderr,"%s: ",progname);
> +     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
> ++#endif
> +   } else if (pFlag->status & UNICODE_CONVERSION_ERROR) {
> +     d2u_fprintf(stderr,"%s: ",progname);
> +     d2u_fprintf(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr);
> +@@ -1834,11 +1840,13 @@
> +       d2u_fprintf(stderr,"%s: ",progname);
> +       d2u_fprintf(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile);
> +     }
> ++#ifdef D2U_UNICODE
> +   } else if (pFlag->status & WCHAR_T_TOO_SMALL) {
> +     if (pFlag->verbose) {
> +       d2u_fprintf(stderr,"%s: ",progname);
> +       d2u_fprintf(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t));
> +     }
> ++#endif
> +   }
> + }
> + 
> diff --git a/package/dos2unix/Config.in b/package/dos2unix/Config.in
> index fdcd0700509b..782c25cf0e13 100644
> --- a/package/dos2unix/Config.in
> +++ b/package/dos2unix/Config.in
> @@ -1,11 +1,7 @@
>  config BR2_PACKAGE_DOS2UNIX
>  	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
> -	depends on BR2_USE_WCHAR # gettext
>  	bool "dos2unix"
>  	help
>  	  dos2unix converts text file line endings between CRLF and LF
>  
>  	  http://freshmeat.net/projects/dos2unix
> -
> -comment "dos2unix needs a toolchain w/ wchar"
> -	depends on !BR2_USE_WCHAR
> diff --git a/package/dos2unix/dos2unix.mk b/package/dos2unix/dos2unix.mk
> index 0d5a67456e6b..4c5f4fcff384 100644
> --- a/package/dos2unix/dos2unix.mk
> +++ b/package/dos2unix/dos2unix.mk
> @@ -20,6 +20,10 @@ DOS2UNIX_DEPENDENCIES += gettext
>  DOS2UNIX_MAKE_OPTS += LIBS_EXTRA=-lintl
>  endif
>  
> +ifeq ($(BR2_USE_WCHAR),)
> +DOS2UNIX_MAKE_OPTS += UCS=
> +endif
> +
>  define DOS2UNIX_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(DOS2UNIX_MAKE_OPTS)
>  endef
> 

Reviewed-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

Any instructions on how to reproduce the build failure so I can test it?
Also, does that patch fixes an autobuild failure? If so, please add the
"Fixes" line and the URL.

Regards,

Vincent.

  reply	other threads:[~2015-09-04 10:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03  4:10 [Buildroot] [PATCH v3 1/5] dos2unix: add target support Baruch Siach
2015-09-03  4:10 ` [Buildroot] [PATCH v3 2/5] dos2unix: bump to version 7.3 Baruch Siach
2015-09-04 10:52   ` Vicente Olivert Riera
2015-09-03  4:10 ` [Buildroot] [PATCH v3 3/5] dos2unix: remove WCHAR dependency Baruch Siach
2015-09-04 10:52   ` Vicente Olivert Riera [this message]
2015-09-04 12:16     ` Baruch Siach
2015-09-03  4:10 ` [Buildroot] [PATCH v3 4/5] dos2unix: remove host-gettext dependency from host package Baruch Siach
2015-09-04 10:52   ` Vicente Olivert Riera
2015-09-03  4:10 ` [Buildroot] [PATCH v3 5/5] dos2unix: update homepage link Baruch Siach
2015-09-04 10:52   ` Vicente Olivert Riera
2015-09-04 10:52 ` [Buildroot] [PATCH v3 1/5] dos2unix: add target support Vicente Olivert Riera
2015-09-04 15:07 ` Peter Korsgaard
2015-09-06  9:36   ` Baruch Siach
2015-09-06  9:42     ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E977E9.3040404@imgtec.com \
    --to=vincent.riera@imgtec.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox