public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Advice on setting Cygwin build parameters for OpenSC.
@ 2018-09-02  1:22 Darren Whobrey
  2018-09-02  9:08 ` Hans-Bernhard Bröker
  2018-09-06  5:47 ` dwhobrey
  0 siblings, 2 replies; 6+ messages in thread
From: Darren Whobrey @ 2018-09-02  1:22 UTC (permalink / raw)
  To: cygwin

Hi,
I’ve been talking to Doug Engert, one of the maintainers for the OpenSC project, and we could do with some advice on how best to set the build parameters for building OpenSC via Cygwin.

The good news is that with a small tweak to the current stock configure.ac, OpenSC builds nicely and works well on Cygwin – which is great because it enables a heap of SmartCard and Yubikey applications to work too, like ssh.

The tweak required to get OpenSC to work with the standard Cygwin utils, like ssh-agent, is to comment out a line in the configure.ac script that previously was causing it to force a WND build, which resulted in struct packing of 1 – and that doesn’t work with the ssh utils distributed with Cygwin. For details see the end of thread here: https://github.com/OpenSC/OpenSC/issues/607.

The question is, what is the most sensible way to update the configure.ac and still support other Cygwin users that may be using mingw or other toolchains rather than gcc? It seems that the default should be to not include the offending line, but then that would break WND builds. So maybe the configure.ac script should have another case block for WND builds? This aspect is stretching my knowledge and understanding of the implications, so would appreciate some advice 😊

Regards,
Darren.

Ps: if the Cygwin team could add OpenSC to it’s distributed binary packages that would be great too!


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice on setting Cygwin build parameters for OpenSC.
  2018-09-02  1:22 Advice on setting Cygwin build parameters for OpenSC Darren Whobrey
@ 2018-09-02  9:08 ` Hans-Bernhard Bröker
  2018-09-06  5:47 ` dwhobrey
  1 sibling, 0 replies; 6+ messages in thread
From: Hans-Bernhard Bröker @ 2018-09-02  9:08 UTC (permalink / raw)
  To: cygwin

Am 02.09.2018 um 03:22 schrieb Darren Whobrey:

> The tweak required to get OpenSC to work with the standard Cygwin 
> utils, like ssh-agent, is to comment out a line in the configure.ac 
> script that previously was causing it to force a WND build, which 
> resulted in struct packing of 1 – and that doesn’t work with the ssh 
> utils distributed with Cygwin. For details see the end of thread
> here: https://github.com/OpenSC/OpenSC/issues/607.

That line is flat-out wrong.  Delete it.  You're already in a 
--host=*cygwin* specific section of your configure.ac script, so there's 
no further precautions to be taken.

While at it, you may just as well delete the entire "with_cygwin_native" 
branch (lines 100..105), because that has been un-applicable for years. 
  Building for native windows (i.e. MinGW) is has long since stopped to 
be done by a -mno-cygwin flag.  Instead you would pass the configure 
script a --host={something with mingw in it} flag to initiate a proper 
cross-build, and that will bring you into the existing --host=*mingw* 
case abvoe.


> The question is, what is the most sensible way to update the
> configure.ac and still support other Cygwin users that may be using
> mingw or other toolchains rather than gcc? 

Checking for GCC is almost certainly a red herring here.

> should be to not include the offending line, but then that would
> break WND builds. 

Not really, because whatever you mean by "WND builds", they won't be 
ending up in that cygwin case.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice on setting Cygwin build parameters for OpenSC.
  2018-09-02  1:22 Advice on setting Cygwin build parameters for OpenSC Darren Whobrey
  2018-09-02  9:08 ` Hans-Bernhard Bröker
@ 2018-09-06  5:47 ` dwhobrey
  2018-09-06 14:05   ` Andrey Repin
  1 sibling, 1 reply; 6+ messages in thread
From: dwhobrey @ 2018-09-06  5:47 UTC (permalink / raw)
  To: cygwin

Thank you for the feedback.
WND would be _WIN32 builds.
Regards,
Darren



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice on setting Cygwin build parameters for OpenSC.
  2018-09-06  5:47 ` dwhobrey
@ 2018-09-06 14:05   ` Andrey Repin
  2018-09-06 16:25     ` Csaba Raduly
  0 siblings, 1 reply; 6+ messages in thread
From: Andrey Repin @ 2018-09-06 14:05 UTC (permalink / raw)
  To: dwhobrey, cygwin

Greetings, dwhobrey!

> Thank you for the feedback.
> WND would be _WIN32 builds.

If you are going for native builds, why using Cygwin in the first place?
If you still want to use Cygwin for building, you have to install
cross-compilers and properly specify target host.


-- 
With best regards,
Andrey Repin
Thursday, September 6, 2018 14:13:59

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice on setting Cygwin build parameters for OpenSC.
  2018-09-06 14:05   ` Andrey Repin
@ 2018-09-06 16:25     ` Csaba Raduly
  2018-09-09  3:41       ` cyg Simple
  0 siblings, 1 reply; 6+ messages in thread
From: Csaba Raduly @ 2018-09-06 16:25 UTC (permalink / raw)
  To: cygwin list; +Cc: dwhobrey

Hi Andrey,

On Thu, Sep 6, 2018 at 3:59 PM, Andrey Repin  wrote:
> Greetings, dwhobrey!
>
>> Thank you for the feedback.
>> WND would be _WIN32 builds.
>
> If you are going for native builds, why using Cygwin in the first place?
> If you still want to use Cygwin for building, you have to install
> cross-compilers and properly specify target host.

In OpenSC's  build system (configure.ac),  the Cygwin-specific parts
are 10-11 years old.
"cygwin native = yes" means the old-style Mingw build ( -mno-cygwin )
to create native Win32 programs/libraries,
whereas "cygwin native = no" means generating Cygwin programs/libraries
(with CRYPTOKI_FORCE_WIN32 being forcibly - and probably incorrectly - defined).

Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Advice on setting Cygwin build parameters for OpenSC.
  2018-09-06 16:25     ` Csaba Raduly
@ 2018-09-09  3:41       ` cyg Simple
  0 siblings, 0 replies; 6+ messages in thread
From: cyg Simple @ 2018-09-09  3:41 UTC (permalink / raw)
  To: cygwin

On 9/6/2018 12:25 PM, Csaba Raduly wrote:
> Hi Andrey,
> 
> On Thu, Sep 6, 2018 at 3:59 PM, Andrey Repin  wrote:
>> Greetings, dwhobrey!
>>
>>> Thank you for the feedback.
>>> WND would be _WIN32 builds.
>>
>> If you are going for native builds, why using Cygwin in the first place?
>> If you still want to use Cygwin for building, you have to install
>> cross-compilers and properly specify target host.
> 
> In OpenSC's  build system (configure.ac),  the Cygwin-specific parts
> are 10-11 years old.
> "cygwin native = yes" means the old-style Mingw build ( -mno-cygwin )

The -mno-cygwin has been dead for a few several years now.  The option
is no longer available in current GCC.  You now install the
{x86_64,i686}-w64-mingw32 cross compilers and specify
--host={x86_64,i686}-w64-mingw32 when you configure.

> to create native Win32 programs/libraries,
> whereas "cygwin native = no" means generating Cygwin programs/libraries
> (with CRYPTOKI_FORCE_WIN32 being forcibly - and probably incorrectly - defined).
> 

So to get Cygwin specific build you just don't specify the --host option.

The change to configure.ac and supporting .m4 files is up to you.  But
-mno-cygwin isn't available if you plan to use current GCC regardless.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-09  3:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-02  1:22 Advice on setting Cygwin build parameters for OpenSC Darren Whobrey
2018-09-02  9:08 ` Hans-Bernhard Bröker
2018-09-06  5:47 ` dwhobrey
2018-09-06 14:05   ` Andrey Repin
2018-09-06 16:25     ` Csaba Raduly
2018-09-09  3:41       ` cyg Simple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).