Mailing List Archive

[libgpg-error PATCH] doc: if ever, depend on yat2m$(EXEEXT)
Cygwin is not a "real" w32 system, and transparently hides the still
required '.exe' extension whenever possible. Unfortunately, this does
not apply to Makefile targets, so we still have to use '.exe' here.
Fortunately, there is the portable EXEEXT Makefile variable we can use.

Furthermore, we want to use a detected yat2m utility only if we are
cross compiling, but we do not need a Makefile dependency then.
Otherwise, the just created yat2m utility should work fine.

* doc/Makefile.am (CROSS_COMPILING, HAVE_YAT2M): Set empty YAT2M_DEP.
(not CROSS_COMPILING): Ignore detected yat2m, use local one. Use EXEEXT
in YAT2M_DEP rather than explicit '.exe' based on HAVE_W32_SYSTEM.
--

Analysis for the problem on Cygwin when YAT2M_DEP does lack EXEEXT:
* make has a default rule to create 'yat2m' from 'yat2m.c' (uses CC)
* gcc transparently adds '.exe' when creating executables for Cygwin
* 'yat2m.exe' created from default rule does perfectly work
* automake generates the 'yat2m$(EXEEXT)' Makefile target (uses libtool)
* with EXEEXT=.exe, Makefile has both targets 'yat2m' and 'yat2m.exe'
* parallel make does execute commands for both targets in parallel
* both targets really create 'yat2m.exe', overwriting each other...
---
doc/Makefile.am | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 6f3e5a1..3fff0a6 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -37,26 +37,21 @@ myman_pages = gpg-error-config.1

man_MANS = $(myman_pages)

+if CROSS_COMPILING
if HAVE_YAT2M
YAT2M_CMD = $(YAT2M)
-YAT2M_DEP = $(YAT2M)
+YAT2M_DEP =
else
-if CROSS_COMPILING
YAT2M_CMD = ./yat2m-for-build
YAT2M_DEP = yat2m-for-build
CLEANFILES += yat2m-for-build

yat2m-for-build: yat2m.c
$(CC_FOR_BUILD) -o $@ $(srcdir)/yat2m.c
-else
-if HAVE_W32_SYSTEM
-YAT2M_CMD = ./yat2m.exe
-YAT2M_DEP = yat2m.exe
-else
-YAT2M_CMD = ./yat2m
-YAT2M_DEP = yat2m
-endif
endif
+else
+YAT2M_CMD = ./yat2m$(EXEEXT)
+YAT2M_DEP = yat2m$(EXEEXT)
endif

yat2m-stamp: $(myman_sources) $(srcdir)/version.texi
--
2.16.1


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [libgpg-error PATCH] doc: if ever, depend on yat2m$(EXEEXT) [ In reply to ]
Hello,

Thanks for your patch.

Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> writes:
> * doc/Makefile.am (CROSS_COMPILING, HAVE_YAT2M): Set empty YAT2M_DEP.
> (not CROSS_COMPILING): Ignore detected yat2m, use local one. Use EXEEXT
> in YAT2M_DEP rather than explicit '.exe' based on HAVE_W32_SYSTEM.

I agree that using EXEEXT is better than HAVE_W32_SYSTEM. Also, I agree
that we don't need to use detected yat2m for !CROSS_COMPILING.

Furthermore, I also think that the detection of yat2m on build system is
not needed for CROSS_COMPILING now, because we can build
yat2m-for-build.

Remaining problem is we need to have something like EXEEXT for build
machine, so that we can support cross building on Windows (say, for
POSIX machine).

Here is my attempt. How do you think?
--
Re: [libgpg-error PATCH] doc: if ever, depend on yat2m$(EXEEXT) [ In reply to ]
Hello,

I've thought about EXEEXT for build too and found AC_PROG_CC_FOR_BUILD to
set $BUILD_EXEEXT, but because that was commented out in configure.ac I've
not followed that further, as I was not aware of AX_CC_FOR_BUILD at all.

So yes, your attempt looks good to me, thanks!

/haubi/

On 07/10/2018 04:12 AM, NIIBE Yutaka wrote:
> Hello,
>
> Thanks for your patch.
>
> Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> writes:
>> * doc/Makefile.am (CROSS_COMPILING, HAVE_YAT2M): Set empty YAT2M_DEP.
>> (not CROSS_COMPILING): Ignore detected yat2m, use local one. Use EXEEXT
>> in YAT2M_DEP rather than explicit '.exe' based on HAVE_W32_SYSTEM.
>
> I agree that using EXEEXT is better than HAVE_W32_SYSTEM. Also, I agree
> that we don't need to use detected yat2m for !CROSS_COMPILING.
>
> Furthermore, I also think that the detection of yat2m on build system is
> not needed for CROSS_COMPILING now, because we can build
> yat2m-for-build.
>
> Remaining problem is we need to have something like EXEEXT for build
> machine, so that we can support cross building on Windows (say, for
> POSIX machine).
>
> Here is my attempt. How do you think?
>

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [libgpg-error PATCH] doc: if ever, depend on yat2m$(EXEEXT) [ In reply to ]
On 07/12/2018 05:15 PM, Michael Haubenwallner wrote:
> Hello,
>
> I've thought about EXEEXT for build too and found AC_PROG_CC_FOR_BUILD to
> set $BUILD_EXEEXT, but because that was commented out in configure.ac I've
> not followed that further, as I was not aware of AX_CC_FOR_BUILD at all.
>

Ohw, shouldn't the build tools in src/ also use EXEEXT_FOR_BUILD?

/haubi/

> So yes, your attempt looks good to me, thanks>
> /haubi/
>
> On 07/10/2018 04:12 AM, NIIBE Yutaka wrote:
>> Hello,
>>
>> Thanks for your patch.
>>
>> Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> writes:
>>> * doc/Makefile.am (CROSS_COMPILING, HAVE_YAT2M): Set empty YAT2M_DEP.
>>> (not CROSS_COMPILING): Ignore detected yat2m, use local one. Use EXEEXT
>>> in YAT2M_DEP rather than explicit '.exe' based on HAVE_W32_SYSTEM.
>>
>> I agree that using EXEEXT is better than HAVE_W32_SYSTEM. Also, I agree
>> that we don't need to use detected yat2m for !CROSS_COMPILING.
>>
>> Furthermore, I also think that the detection of yat2m on build system is
>> not needed for CROSS_COMPILING now, because we can build
>> yat2m-for-build.
>>
>> Remaining problem is we need to have something like EXEEXT for build
>> machine, so that we can support cross building on Windows (say, for
>> POSIX machine).
>>
>> Here is my attempt. How do you think?
>>
Re: [libgpg-error PATCH] doc: if ever, depend on yat2m$(EXEEXT) [ In reply to ]
Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> wrote:
>> I've thought about EXEEXT for build too and found AC_PROG_CC_FOR_BUILD to
>> set $BUILD_EXEEXT, but because that was commented out in configure.ac I've
>> not followed that further, as I was not aware of AX_CC_FOR_BUILD at all.
>>
>
> Ohw, shouldn't the build tools in src/ also use EXEEXT_FOR_BUILD?

Good catch. That's right.


Please have a look at:

https://gnupg.org/faq/HACKING.html#sec-1-3

and send your GnuPG DCO (Developer's Certificate of Origin).

The file is available at:

https://dev.gnupg.org/source/gnupg/browse/master/doc/DCO

And please add "Signed-off-by" line in your commit log, so that I can
apply your patch.
--

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [libgpg-error PATCH] doc: if ever, depend on yat2m$(EXEEXT) [ In reply to ]
On 07/13/2018 05:14 AM, NIIBE Yutaka wrote:
> Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> wrote:
>>> I've thought about EXEEXT for build too and found AC_PROG_CC_FOR_BUILD to
>>> set $BUILD_EXEEXT, but because that was commented out in configure.ac I've
>>> not followed that further, as I was not aware of AX_CC_FOR_BUILD at all.
>>>
>>
>> Ohw, shouldn't the build tools in src/ also use EXEEXT_FOR_BUILD?
>
> Good catch. That's right.
>
>
> Please have a look at:
>
> https://gnupg.org/faq/HACKING.html#sec-1-3
>
> and send your GnuPG DCO (Developer's Certificate of Origin).
>
> The file is available at:
>
> https://dev.gnupg.org/source/gnupg/browse/master/doc/DCO

Here we go.

>
> And please add "Signed-off-by" line in your commit log, so that I can
> apply your patch.
>

Not sure how to deal with my "Signed-off-by" line exceeding the git commit
message line length limit of 72 characters.

Thanks!
/haubi/