Re: relicensing libunistring to "dual LGPLv3+ or GPLv2"

2016-11-19 Thread Bruno Haible
Hi Paolo,

For the 'frexpl-nolibm' module I also need your approval, since you
contributed lib/frexpl.c on 2003-02-18.

Would you agree to relicense your initial lib/frexpl.c
under 'LGPLv3+ or GPLv2'?
Or possibly even under LGPLv2+?

If you don't voice an objection within a week, I'll assume you agree.

Bruno

> It has been decided that libunistring is going to be relicensed under
> "dual LGPLv3+ or GPLv2" license. See
> http://lists.gnu.org/archive/html/bug-libunistring/2016-11/msg3.html
> 
> To this effect, the libunistring modules in gnulib that are currently under
> LGPLv3+ need to be relicensed to 'LGPLv3+ or GPLv2'. Those modules that
> are under LGPLv2+ stay under LGPLv2+.
> 
> 1)
> This proposed patch does this. It also extends gnulib-tool so that
>   * the option --lgpl accepts the form --lgpl=3orGPLv2
>   * the compatibility checks consider this 'LGPLv3+ or GPLv2' license
> (namely, the allowed relicensings are:
>  LGPLv2+ --> 'LGPLv3+ or GPLv2'
>  'LGPLv3+ or GPLv2' --> LGPLv3+ = LGPL
>  'LGPLv3+ or GPLv2' --> GPLv2+
>  'LGPLv3+ or GPLv2' --> GPLv3+ = GPL
> 
> 2)
> Some libunistring modules depend on gnulib modules with an LGPL license:
> 
> unicase needs:
> 
>   Module  Authors of the lib/* files (modulo trivial changes)
>   memcmp2 Bruno
>   amemxfrmBruno
> 
> unistdio needs:
> 
>   Module  Authors of the lib/* files (modulo trivial changes)
> 
>   fpieee  --
>   fpucw   Bruno
>   frexpl-nolibm   Bruno
>   frexp-nolibmBruno
>   isnand-nolibm   Bruno, Paul, Eric, Ludovic
>   isnanf-nolibm   Bruno, Paul, Eric, Ludovic
>   isnanl-nolibm   Bruno, Paul, Eric, Ludovic
>   printf-frexpBruno
>   printf-frexpl   Bruno
>   printf-safe --
>   signbit Bruno, Paul
> 
> I am willing to relicense these modules to 'LGPLv3+ or GPLv2' or to the even
> weaker license LGPLv2+.
> 
> lib/float+.h is already under LGPLv2+, per the modules 'integer_length' and
> 'vasnprintf'.
> 
> === Paul, Eric, Ludovic, ===
> 
> Would you agree to relicense your changes to lib/isnan.c
> under 'LGPLv3+ or GPLv2'?
> Or possibly even under LGPLv2+?
> 
> The history is here:
> http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=history;f=lib/isnan.c
> 
> Bruno

--
In memoriam Farhád Asdaqí 





Re: relicensing libunistring to "dual LGPLv3+ or GPLv2"

2016-11-19 Thread Paolo Bonzini


On 19/11/2016 11:26, Bruno Haible wrote:
> Hi Paolo,
> 
> For the 'frexpl-nolibm' module I also need your approval, since you
> contributed lib/frexpl.c on 2003-02-18.
> 
> Would you agree to relicense your initial lib/frexpl.c
> under 'LGPLv3+ or GPLv2'?
> Or possibly even under LGPLv2+?
> 
> If you don't voice an objection within a week, I'll assume you agree.

LGPLv2+ is fine for any gnulib module I wrote.

Paolo

> 
> Bruno
> 
>> It has been decided that libunistring is going to be relicensed under
>> "dual LGPLv3+ or GPLv2" license. See
>> http://lists.gnu.org/archive/html/bug-libunistring/2016-11/msg3.html
>>
>> To this effect, the libunistring modules in gnulib that are currently under
>> LGPLv3+ need to be relicensed to 'LGPLv3+ or GPLv2'. Those modules that
>> are under LGPLv2+ stay under LGPLv2+.
>>
>> 1)
>> This proposed patch does this. It also extends gnulib-tool so that
>>   * the option --lgpl accepts the form --lgpl=3orGPLv2
>>   * the compatibility checks consider this 'LGPLv3+ or GPLv2' license
>> (namely, the allowed relicensings are:
>>  LGPLv2+ --> 'LGPLv3+ or GPLv2'
>>  'LGPLv3+ or GPLv2' --> LGPLv3+ = LGPL
>>  'LGPLv3+ or GPLv2' --> GPLv2+
>>  'LGPLv3+ or GPLv2' --> GPLv3+ = GPL
>>
>> 2)
>> Some libunistring modules depend on gnulib modules with an LGPL license:
>>
>> unicase needs:
>>
>>   Module  Authors of the lib/* files (modulo trivial changes)
>>   memcmp2 Bruno
>>   amemxfrmBruno
>>
>> unistdio needs:
>>
>>   Module  Authors of the lib/* files (modulo trivial changes)
>>
>>   fpieee  --
>>   fpucw   Bruno
>>   frexpl-nolibm   Bruno
>>   frexp-nolibmBruno
>>   isnand-nolibm   Bruno, Paul, Eric, Ludovic
>>   isnanf-nolibm   Bruno, Paul, Eric, Ludovic
>>   isnanl-nolibm   Bruno, Paul, Eric, Ludovic
>>   printf-frexpBruno
>>   printf-frexpl   Bruno
>>   printf-safe --
>>   signbit Bruno, Paul
>>
>> I am willing to relicense these modules to 'LGPLv3+ or GPLv2' or to the even
>> weaker license LGPLv2+.
>>
>> lib/float+.h is already under LGPLv2+, per the modules 'integer_length' and
>> 'vasnprintf'.
>>
>> === Paul, Eric, Ludovic, ===
>>
>> Would you agree to relicense your changes to lib/isnan.c
>> under 'LGPLv3+ or GPLv2'?
>> Or possibly even under LGPLv2+?
>>
>> The history is here:
>> http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=history;f=lib/isnan.c
>>
>> Bruno
> 
> --
> In memoriam Farhád Asdaqí 
> 
> 
> 



strerror: make C++ safe

2016-11-19 Thread Bruno Haible
When creating a gnulib testdir for module 'strerror'
  ./gnulib-tool --create-testdir --with-c++-tests --with-tests --dir=... 
strerror
and forcing REPLACE_STRERROR=1, the compilation in C++ mode with 
GNULIB_NAMESPACE
fails:

$ ./configure CPPFLAGS="-DGNULIB_NAMESPACE= -Wall" CC=g++
$ make
...
g++ -DHAVE_CONFIG_H -I. -I..  -DGNULIB_STRICT_CHECKING=1 
-DGNULIB_NAMESPACE= -Wall  -g -O2 -MT strerror.o -MD -MP -MF 
.deps/strerror.Tpo -c -o strerror.o strerror.c
strerror.c: In function 'char* rpl_strerror(int)':
strerror.c:70:35: error: invalid conversion from 'void*' to 'char*' 
[-fpermissive]
make[4]: *** [strerror.o] Error 1

The reason is that memcpy() returns a 'void *'. But we want a 'char *' here.
Rather than introduce a cast, simply use the known return value of memcpy().

I'm pushing this fix:


2016-11-19  Bruno Haible  

strerror: Make it compile in C++ mode.
* lib/strerror.c (strerror): Ignore the return value of memcpy().

--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -66,5 +66,6 @@ strerror (int n)
   if (sizeof buf <= len)
 abort ();
 
-  return memcpy (buf, msg, len + 1);
+  memcpy (buf, msg, len + 1);
+  return buf;
 }




relocatable-prog-wrapper fixes

2016-11-19 Thread Bruno Haible
Hi,

When building a libiconv snapshot with --enable-relocatable on Cygwin,
"make install" fails with

libtool: link: gcc -g -O2 iconv.o iconv.res -o .libs/iconv.exe  
-L/usr/local/cygwin64/lib ../srclib/libicrt.a /tmp/inst/lib/libiconv.dll.a 
-L/tmp/inst/lib
RELOC_LIBRARY_PATH_VAR="PATH" RELOC_LIBRARY_PATH_VALUE="/tmp/inst/lib" 
RELOC_PREFIX="/tmp/inst" RELOC_DESTDIR="" RELOC_COMPILE_COMMAND="gcc 
-I/usr/local/cygwin64/include -Wall -g -O2 -L/usr/local/cygwin64/lib" 
RELOC_SRCDIR="../../srclib" RELOC_BUILDDIR="../srclib" RELOC_CONFIG_H_DIR=".." 
RELOC_EXEEXT=".exe" RELOC_STRIP_PROG=":" RELOC_INSTALL_PROG="/usr/bin/install 
-c" /bin/sh ../libtool --mode=install ../../build-aux/install-reloc iconv.exe 
/tmp/inst/bin/iconv.exe
libtool: install: ../../build-aux/install-reloc .libs/iconv.exe 
/tmp/inst/bin/iconv.exe
/usr/bin/install -c .libs/iconv.exe /tmp/inst/bin/iconv.exe
gcc -I/usr/local/cygwin64/include -Wall -g -O2 -L/usr/local/cygwin64/lib 
-I../srclib -I../../srclib -I.. -DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC 
-DINSTALLPREFIX="/tmp/inst" -DINSTALLDIR="/tmp/inst/bin" -DLIBPATHVAR="PATH" 
-DLIBDIRS="/tmp/inst/lib", -DEXEEXT=".exe" ../../srclib/relocwrapper.c 
../../srclib/progname.c ../../srclib/progreloc.c ../../srclib/areadlink.c 
../../srclib/careadlinkat.c ../../srclib/allocator.c 
../../srclib/strerror-override.c ../../srclib/stat.c ../../srclib/lstat.c 
../../srclib/readlink.c ../../srclib/canonicalize-lgpl.c ../../srclib/malloca.c 
../../srclib/relocatable.c ../../srclib/setenv.c ../../srclib/strerror.c 
../../srclib/c-ctype.c -o /tmp/inst/bin/iconv.wrapper.exe
In file included from /usr/include/sys/_types.h:159:0,
 from /usr/include/sys/reent.h:15,
 from /usr/include/sys/errno.h:11,
 from /usr/include/errno.h:9,
 from ../../srclib/strerror-override.h:21,
 from ../../srclib/strerror-override.c:22:
../../srclib/strerror-override.h:53:38: error: expected identifier or '(' 
before 'void'
 #  define strerror_override(ignored) NULL
  ^
../../srclib/strerror-override.c:35:1: note: in expansion of macro 
'strerror_override'
 strerror_override (int errnum)
 ^
../../srclib/strerror-override.h:53:38: error: expected ')' before numeric 
constant
 #  define strerror_override(ignored) NULL
  ^
../../srclib/strerror-override.c:35:1: note: in expansion of macro 
'strerror_override'
 strerror_override (int errnum)
 ^
make[1]: *** [Makefile:115: install] Error 1

This is caused by the fix from
http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg1.html
that was added on 2014-08-07. It contained several mistakes:
  - Adding strerror-override.c to the compilation runs against the intent of
the change from 2011-05-21
  relocatable-prog-wrapper: Assume strerror() exists.
  - Some .o files were not removed.
  - Source files were not listed in module description.

Additionally, my change from 2011-05-21 also had two mistakes:
  - It should have done
  #undef strerror
to avoid dragging in rpl_strerror.
  - It should have removed the dependency to the 'intprops' module.

This fixes it.


2016-11-19  Bruno Haible  

relocatable-prog-wrapper: Fix breakage on Cygwin.
* modules/relocatable-prog-wrapper (Files): Add lib/stat.c, lib/lstat.c.
(Depends-on): Remove intprops.
* lib/relocwrapper.c: Update dependency tree.
(strerror): Undefine.
* build-aux/install-reloc (func_create_wrapper): Do not compile
strerror.c and strerror-override.c. Erase stat.o and lstat.o.

diff --git a/lib/relocwrapper.c b/lib/relocwrapper.c
index 5eefa2b..69a6e98 100644
--- a/lib/relocwrapper.c
+++ b/lib/relocwrapper.c
@@ -19,16 +19,23 @@
relocwrapper
 -> progname
 -> progreloc
--> areadlink
-   -> careadlinkat
+   -> areadlink
+  -> careadlinkat
  -> allocator
-   -> readlink
--> canonicalize-lgpl
-   -> malloca
-   -> readlink
+  -> readlink
+ -> stat
+-> dosname
+-> pathmax
+-> verify
+   -> canonicalize-lgpl
+  -> malloca
+  -> lstat
+  -> readlink
 -> relocatable
 -> setenv
-> malloca
+-> fprintf-posix [ignore, cut dependency tree here]
+-> strerror [ignore, cut dependency tree here]
 -> c-ctype
 
Macros that need to be set while compiling this file:
@@ -60,6 +67,7 @@
 
 /* Use the system functions, not the gnulib overrides in this file.  */
 #undef fprintf
+#undef strerror
 
 /* Return a copy of the filename, with an extra ".bin" at the end.
More generally, it replaces "${EXEEXT}" at the end with ".bin${EXEEXT}".  */
diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper
index a75b426..50444b1 100644
--- a/modules/relocatable-prog-wrapper
+++ b/modules/relocatable-prog-wrappe

Re: safer Unicode parsing

2016-11-19 Thread Bruno Haible
Paul Eggert wrote:
> > -#if FULL_SAFETY || CONFIG_UNICODE_SAFETY
> 
> Since this removes the only use of FULL_SAFETY, its definition in 
> tests/unistr/test-u32-mbtouc.c should also be removed.

Good catch; thanks. Pushed with this additional change.

Bruno
--
In memoriam Farhád Asdaqí 





bootstrap fails on Darwin for `libtool'

2016-11-19 Thread Werner LEMBERG

Folks,


I got the following report for groff

  https://savannah.gnu.org/bugs/?49651

  The groff build from repository source fails in the ./bootstrap
  phase on MacOS X systems.  GNU libtool conflicts with the Xcode
  libtool. The attached patch [below] checks for a Darwin build and
  uses glibtool/glibtoolize when detected.

This looks reasonable to me.  Is this the right fix?  If yes, please
incorporate it into gnulib.


Werner


==


diff --git a/bootstrap b/bootstrap
index ce90bc4..a9cb5e5 100755
--- a/bootstrap
+++ b/bootstrap
@@ -435,7 +435,10 @@ check_versions() {
   while read app req_ver; do
 # We only need libtoolize from the libtool package.
 if test "$app" = libtool; then
-  app=libtoolize
+  case `uname` in
+  Darwin*) app=glibtoolize ;;
+  *) app=libtoolize ;;
+  esac
 fi
 # Exempt git if --no-git is in effect.
 if test "$app" = git; then



Re: bootstrap fails on Darwin for `libtool'

2016-11-19 Thread Bruno Haible
The background appears to be that on macOS:
  * /usr/bin/libtool is an Apple program, that does not support the GNU
interface. It comes with Xcode; Xcode is the usual way to install a
C compiler on this platform.
  * To avoid a conflict, people often configure GNU libtool with
--program-prefix=g.
  * Thus their libtoolize script will be found as 'glibtoolize'.

But AFAICS there is no 'libtoolize' from Apple.

> +  case `uname` in
> +  Darwin*) app=glibtoolize ;;

I would still check to see whether 'libtoolize' exists, before trying
'glibtoolize'. Rationale: 'libtoolize' is the default name, 'glibtoolize'
is just a convention used by many people.

Bruno




Re: relicensing libunistring to "dual LGPLv3+ or GPLv2"

2016-11-19 Thread Bruno Haible
Paolo Bonzini wrote:
> LGPLv2+ is fine for any gnulib module I wrote.

Thank you, Paolo.

With all approvals complete, I pushed the relicensing changes.

Bruno
--
In memoriam Kerem Yılmazer 




Re: [PATCH] Fix gnulib C++ namespace support and std::frexp

2016-11-19 Thread Bruno Haible
Pedro Alves wrote:
> --- a/lib/math.in.h
> +++ b/lib/math.in.h
> @@ -983,7 +983,7 @@ _GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
>  # else
>  _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
>  # endif
> -_GL_CXXALIASWARN (frexp);
> +_GL_CXXALIASWARN1 (frexp, double, (double x, int *expptr));
>  #elif defined GNULIB_POSIXCHECK
>  # undef frexp
>  /* Assume frexp is always declared.  */

Thank you. It's evidently correct.

Bruno