On Wed, Sep 09, 2020 at 08:55:15PM +0800, 罗勇刚(Yonggang Luo) wrote: > On Wed, Sep 9, 2020 at 8:51 PM Daniel P. Berrangé <berra...@redhat.com> > wrote: > > > On Wed, Sep 09, 2020 at 05:45:59PM +0800, Yonggang Luo wrote: > > > The mingw pkg-config are showing following absolute path and contains : > > as the separator, > > > so we must handling : properly. > > > > > > -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L > > -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw: > > > -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC > > -pipe -lncursesw -lgnurx -ltre -lintl -liconv > > > -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC > > -lncursesw > > > -DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC > > -lcursesw > > > -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe > > -lncursesw -lgnurx -ltre -lintl -liconv > > > -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw > > > -DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw > > > -DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx > > -ltre -lintl -liconv > > > -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw > > > -DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw > > > > > > msys2/mingw lacks the POSIX-required langinfo.h. > > > > > > gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe > > -lncursesw -lgnurx -ltre -lintl -liconv > > > test.c:4:10: fatal error: langinfo.h: No such file or directory > > > 4 | #include <langinfo.h> > > > | ^~~~~~~~~~~~ > > > compilation terminated. > > > > > > So we using g_get_codeset instead of nl_langinfo(CODESET) > > > > > > Signed-off-by: Yonggang Luo <luoyongg...@gmail.com> > > > Reviewed-by: Gerd Hoffmann <kra...@redhat.com> > > > --- > > > configure | 9 +++------ > > > ui/curses.c | 10 +++++----- > > > 2 files changed, 8 insertions(+), 11 deletions(-) > > > > > > diff --git a/configure b/configure > > > index f4f8bc3756..2e6d54e15b 100755 > > > --- a/configure > > > +++ b/configure > > > @@ -3653,8 +3653,8 @@ if test "$iconv" = "no" ; then > > > fi > > > if test "$curses" != "no" ; then > > > if test "$mingw32" = "yes" ; then > > > - curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" > > > - curses_lib_list="$($pkg_config --libs ncurses > > 2>/dev/null):-lpdcurses" > > > + curses_inc_list="$($pkg_config --cflags ncursesw > > 2>/dev/null):-I/${MSYSTEM,,}/include/ncursesw:" > > > + curses_lib_list="$($pkg_config --libs ncursesw > > 2>/dev/null):-lncursesw" > > > > The original code would try ncurses via pkg-config and if that failed, > > would > > falback to pdcurses. > > > > The new code tries ncursesw via pkg-config and then tries ncursesw again > > via manually specified args, and doesn't try ncurses or pdcurses at all. > > > Gotcha, Indeed $pkg_config --cflags ncurses can find curses on mingw32, > the problem is onw mingw32 the include path > have :, so we can not use : as the path sepaerator, for cross-paltform > reason, which is best for path separator?
I guess it was using ":" because " " might be valid in the file path. How about using "#" or "%" instead as those should be more unlikely to clash. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|