poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allow accessing the installed files in a Cygwin-based mingw environm


From: Jose E. Marchesi
Subject: Re: Allow accessing the installed files in a Cygwin-based mingw environment
Date: Sun, 19 Feb 2023 14:37:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hello Bruno.

This is OK for both master and maint/poke-3.
Thanks!

> Hi,
>
> I see that some people start adding support for building poke for
> native Windows.
>
> One piece (a small one, but nevertheless) in this support is to make
> sure that after "make install", poke will find its initial *.pk files
> to load. This is non-trivial because "make install" may have installed
> these files in
>   /usr/local/mingw/share/poke/
> but at runtime they will be looked up in
>   C:\cygwin64\usr\local\mingw\share\poke\
>
> You see the problem? PKGDATADIR gets defined to "/usr/local/mingw/share/poke"
> but that won't work at runtime.
>
> The solution is to use the 'configmake' module from Gnulib, that provides
> these variables (PKGDATADIR, LOCALEDIR, and others) correctly, since today
> <https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00143.html>.
> Find attached the proposed patch. Together with a gnulib submodule upgrade
> it will have the desired effect.
>
> The patch will also compile fine without a gnulib submodule upgrade; it's just
> that it will have no effect until the gnulib submodule upgrade.
>
> Regarding LOCALEDIR, the next gettext version will improve the situation;
> therefore it's too early now to propose a patch that handles LOCALEDIR in
> the same way.
>
>>From 6b418d6ec11ccead4825fcdeaa8f1d6f71af98d8 Mon Sep 17 00:00:00 2001
> From: Bruno Haible <bruno@clisp.org>
> Date: Sun, 19 Feb 2023 00:16:38 +0100
> Subject: [PATCH] Allow accessing the installed files in a Cygwin-based mingw
>  environment.
>
> * bootstrap.conf (gnulib_modules, libpoke_modules): Add configmake.
> * libpoke/Makefile.am (libpoke_la_CPPFLAGS): Don't define PKGDATADIR.
> * libpoke/libpoke.c: Instead, include configmake.h.
> * libpoke/pkl.c: Likewise.
> * poke/Makefile.am (poke_CPPFLAGS): Don't define PKGDATADIR.
> * poke/pk-map.c: Instead, include configmake.h.
> * poke/pk-term.c: Likewise.
> * poke/poke.c: Likewise.
> * poked/Makefile.am (poked_CPPFLAGS): Remove useless -I options. Don't define
> PKGDATADIR. Add -I options to find the common gl/ directories.
> * poked/poked.c: Include configmake.h.
> * testsuite/poke.libpoke/Makefile.am (COMMON_CPPFLAGS): Don't define 
> PKGDATADIR.
> ---
>  bootstrap.conf                     | 6 +++---
>  libpoke/Makefile.am                | 1 -
>  libpoke/libpoke.c                  | 1 +
>  libpoke/pkl.c                      | 2 ++
>  poke/Makefile.am                   | 1 -
>  poke/pk-map.c                      | 1 +
>  poke/pk-term.c                     | 1 +
>  poke/poke.c                        | 1 +
>  poked/Makefile.am                  | 5 ++---
>  poked/poked.c                      | 1 +
>  testsuite/poke.libpoke/Makefile.am | 1 -
>  11 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/bootstrap.conf b/bootstrap.conf
> index d6a8e71b..c5cf0452 100644
> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -1,8 +1,6 @@
>  # Bootstrap configuration.
>  
> -# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
> -# 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Free Software Foundation,
> -# Inc.
> +# Copyright (C) 2006-2023 Free Software Foundation, Inc.
>  
>  # This program is free software: you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -26,6 +24,7 @@ gnulib_modules="
>    basename-lgpl
>    bind
>    byteswap
> +  configmake
>    findprog
>    fstat
>    gendocs
> @@ -73,6 +72,7 @@ gnulib_modules="
>  libpoke_modules="
>    basename-lgpl
>    byteswap
> +  configmake
>    errno
>    fopen-gnu
>    free-posix
> diff --git a/libpoke/Makefile.am b/libpoke/Makefile.am
> index 792408c3..7e256cf7 100644
> --- a/libpoke/Makefile.am
> +++ b/libpoke/Makefile.am
> @@ -187,7 +187,6 @@ LTV_AGE=0
>  libpoke_la_CPPFLAGS = -I$(top_builddir)/gl-libpoke 
> -I$(top_srcdir)/gl-libpoke \
>                        -I$(top_srcdir)/common \
>                        -DPKL_DEBUG \
> -                      -DPKGDATADIR=\"$(pkgdatadir)\" \
>                        -DPKGINFODIR=\"$(infodir)\" \
>                        -DLOCALEDIR=\"$(localedir)\" \
>                        $(CFLAG_VISIBILITY) \
> diff --git a/libpoke/libpoke.c b/libpoke/libpoke.c
> index 99a7b2a2..4849e21e 100644
> --- a/libpoke/libpoke.c
> +++ b/libpoke/libpoke.c
> @@ -30,6 +30,7 @@
>  #include "pvm-val.h" /* XXX */
>  #include "libpoke.h"
>  #include "ios-dev.h" /* for struct ios_dev_if */
> +#include "configmake.h"
>  
>  struct _pk_compiler
>  {
> diff --git a/libpoke/pkl.c b/libpoke/pkl.c
> index 848defa6..a067c7e0 100644
> --- a/libpoke/pkl.c
> +++ b/libpoke/pkl.c
> @@ -45,6 +45,8 @@
>  #include "pkl-fold.h"
>  #include "pkl-env.h"
>  
> +#include "configmake.h"
> +
>  #define PKL_COMPILING_EXPRESSION 0
>  #define PKL_COMPILING_PROGRAM    1
>  #define PKL_COMPILING_STATEMENT  2
> diff --git a/poke/Makefile.am b/poke/Makefile.am
> index 5c6b0fa1..13edfc4e 100644
> --- a/poke/Makefile.am
> +++ b/poke/Makefile.am
> @@ -51,7 +51,6 @@ poke_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl \
>                  -I$(top_srcdir)/common \
>                  -I$(top_srcdir)/libpoke -I$(top_builddir)/libpoke \
>                  -DJITTER_VERSION=\"$(JITTER_VERSION)\" \
> -                -DPKGDATADIR=\"$(pkgdatadir)\" \
>                  -DPKGINFODIR=\"$(infodir)\" \
>                  -DLOCALEDIR=\"$(localedir)\"
>  poke_CFLAGS = -Wall
> diff --git a/poke/pk-map.c b/poke/pk-map.c
> index fe0b0444..7f1fb6fc 100644
> --- a/poke/pk-map.c
> +++ b/poke/pk-map.c
> @@ -31,6 +31,7 @@
>  #include "pk-term.h"
>  #include "pk-map.h"
>  #include "pk-map-parser.h"
> +#include "configmake.h"
>  
>  /* Unique map ID.
>     This number is unique per map in a poke session.  */
> diff --git a/poke/pk-term.c b/poke/pk-term.c
> index 71d33ac8..cad4ca16 100644
> --- a/poke/pk-term.c
> +++ b/poke/pk-term.c
> @@ -34,6 +34,7 @@
>  
>  #include "poke.h"
>  #include "pk-utils.h"
> +#include "configmake.h"
>  
>  /* Several variables related to the pager.  */
>  
> diff --git a/poke/poke.c b/poke/poke.c
> index af223309..28cfbba8 100644
> --- a/poke/poke.c
> +++ b/poke/poke.c
> @@ -38,6 +38,7 @@
>  #include "pk-utils.h"
>  #include "pk-map.h"
>  #include "pk-ios.h"
> +#include "configmake.h"
>  
>  /* poke can be run either interactively (from a tty) or in batch mode.
>     The following predicate records this.  */
> diff --git a/poked/Makefile.am b/poked/Makefile.am
> index 145d2b1e..6434ad82 100644
> --- a/poked/Makefile.am
> +++ b/poked/Makefile.am
> @@ -32,9 +32,8 @@ poked_SOURCES = poked.c \
>  poked_SOURCES += ../common/pk-utils.c ../common/pk-utils.h
>  
>  poked_CPPFLAGS = -I$(top_srcdir)/common \
> -                 -I$(top_builddir)/gl-poked -I$(top_srcdir)/gl-poked \
> -                 -I$(top_srcdir)/libpoke -I$(top_builddir)/libpoke \
> -                 -DPKGDATADIR=\"$(pkgdatadir)\"
> +                 -I$(top_builddir)/gl -I$(top_srcdir)/gl \
> +                 -I$(top_srcdir)/libpoke -I$(top_builddir)/libpoke
>  poked_CFLAGS = -Wall
>  poked_LDADD = $(top_builddir)/gl/libgnu.la \
>                $(top_builddir)/libpoke/libpoke.la \
> diff --git a/poked/poked.c b/poked/poked.c
> index e739dc39..7e087c6a 100644
> --- a/poked/poked.c
> +++ b/poked/poked.c
> @@ -31,6 +31,7 @@
>  #include "pk-utils.h"
>  #include "usock.h"
>  #include "libpoke.h"
> +#include "configmake.h"
>  
>  pk_compiler pkc;
>  struct usock *srv;
> diff --git a/testsuite/poke.libpoke/Makefile.am 
> b/testsuite/poke.libpoke/Makefile.am
> index e51eb8f9..a9eaf887 100644
> --- a/testsuite/poke.libpoke/Makefile.am
> +++ b/testsuite/poke.libpoke/Makefile.am
> @@ -27,7 +27,6 @@ endif
>  COMMON_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl \
>                    -I$(top_srcdir)/common \
>                    -DTESTDIR=\"$(abs_srcdir)\" \
> -                  -DPKGDATADIR=\"$(pkgdatadir)\" \
>                    -I$(top_srcdir)/libpoke -I$(top_builddir)/libpoke
>  # Old DejaGnu versions need a specific old interpretation of 'inline'.
>  COMMON_CFLAGS = -fgnu89-inline



reply via email to

[Prev in Thread] Current Thread [Next in Thread]