Configure help for Mac

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Configure help for Mac

Stef Hoeben-2
Hi,

little remainder: "pkg-config openssl" doesn't work
on Mac unless you "export PKG_CONFIG_PATH=/usr/lib/"
but it would be nicer to let it build out of the box,
so I'm trying to 'harcode' OpenSSL support on Mac
because we can be pretty sure it's always there...

But adding the following to configure.in:

--- configure.in        (revision 2636)
+++ configure.in        (working copy)
@@ -51,6 +51,10 @@
        CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
        ;;
 *-*-darwin*)
+       # "pkg-config openssl" doesn't seem to work; but openssl should
always be present
+       OPENSSL_LIBS="-lcrypto"
+       OPENSSL_CFLAGS=""
+       AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries and header
files])
        LIBS="$LIBS -Wl,-framework,CoreFoundation"
        if test "$GCC" = "yes"; then
                CFLAGS="$CFLAGS -no-cpp-precomp"

doesn't seem to work, ./configure gives:

  checking for OPENSSL_CFLAGS...
  checking for OPENSSL_LIBS...
  Package openssl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `openssl.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'openssl' found

So the question is: is there an elegant way to 'disable' the
pkg-config stuff on Mac, or something else to solve it without
having to mess with the non-Mac parts of configure.in?

Thx,
Stef
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Martin Paljak
On 10/7/05, Stef Hoeben <[hidden email]> wrote:
> little remainder: "pkg-config openssl" doesn't work
> on Mac unless you "export PKG_CONFIG_PATH=/usr/lib/"
> but it would be nicer to let it build out of the box,
> so I'm trying to 'harcode' OpenSSL support on Mac
> because we can be pretty sure it's always there...
Actually it's /usr/lib/pkgconfig

> So the question is: is there an elegant way to 'disable' the
> pkg-config stuff on Mac, or something else to solve it without
> having to mess with the non-Mac parts of configure.in?
Maybe it works if we hardcode /usr/lib/pkgconfig into the
PKG_CONFIG_PATH for darwin ? It's a safe bet also.

As i build against the latest pcsc on os x (pcsc is found via
pkg-config too) this works for me:

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/Library/Ideelabor/lib/pkgconfig
./configure --prefix=/Library/Ideelabor \
--sysconfdir=/Library/Ideelabor/etc \
--disable-sensitive-logging





--
Martin Paljak
[hidden email]
http://martin.paljak.pri.ee/
+372.5156495 - phone
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Stef Hoeben-2
Hi Martin,

Martin Paljak wrote:

>On 10/7/05, Stef Hoeben <[hidden email]> wrote:
>  
>
>>little remainder: "pkg-config openssl" doesn't work
>>on Mac unless you "export PKG_CONFIG_PATH=/usr/lib/"
>>but it would be nicer to let it build out of the box,
>>so I'm trying to 'harcode' OpenSSL support on Mac
>>because we can be pretty sure it's always there...
>>    
>>
>Actually it's /usr/lib/pkgconfig
>  
>
Ah yes, sorry... (copy-past error.).

>>So the question is: is there an elegant way to 'disable' the
>>pkg-config stuff on Mac, or something else to solve it without
>>having to mess with the non-Mac parts of configure.in?
>>    
>>
>Maybe it works if we hardcode /usr/lib/pkgconfig into the
>PKG_CONFIG_PATH for darwin ? It's a safe bet also.
>  
>
Looks fine for me. You know how to do this?

>As i build against the latest pcsc on os x (pcsc is found via
>pkg-config too) this works for me:
>
>export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/Library/Ideelabor/lib/pkgconfig
>./configure --prefix=/Library/Ideelabor \
>--sysconfdir=/Library/Ideelabor/etc \
>--disable-sensitive-logging
>
Strange, even without setting the PKG_CONFIG_PATH (and besides, there's
no libpscsc or so in
the /usr/lib/pkgconfig/ on my Mac 10.4?), configure does print at the end:
    PC/SC support:       yes
So there seems to be something strange going on. Any idea?

(Also: personally, I think it would be nice if OpenSC would
build/install with a simple ./bootstrap,
./configure, make and make install, without having to change the env.)

Cheers, thx,
Stef

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Andreas Jellinghaus-2
In reply to this post by Stef Hoeben-2
My Position is:
we need to document configure / make / make install,
all options in configure, all environment variables
and so on.

that documentation can simply include:

to compile opensc on mac os X, you will most likely
want this:
export OPENSSL_CFLAGS="-I/usr/include"
export OPENSSL_LIBS="-L/usr/lib -lcrypto"
./configure --prefix=/usr --sysconfdir=/etc
make
make install


I don't like magic boxes. I think it is better to give
the user a good idea what is happening, and how he can
influence it. If a user sees above, it is quite trivial,
to use a different openssl, install in a different place
or chose a different location for the config file.

Even if we add more magic to configure, we still need
to document everything we had before adding that magic,
and we need to document the additional magic.

And I think that good ideas are those which cause
a shorter and clearer documentation than it was before.

So for now please help with the documentation.
New features are ok, if you help with the documentation,
and you think it will be easier to write the docu after
adding that feature.

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Andreas Jellinghaus-2
In reply to this post by Stef Hoeben-2
On Friday 07 October 2005 12:01, Stef Hoeben wrote:
> Strange, even without setting the PKG_CONFIG_PATH (and besides, there's
> no libpscsc or so in
> the /usr/lib/pkgconfig/ on my Mac 10.4?), configure does print at the end:
>     PC/SC support:       yes
> So there seems to be something strange going on. Any idea?

special code for pcsc on darwin. it adds fake PCSC_CFLAGS and PCSC_LIBS
if none are given, so it works out of the box.

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Stef Hoeben-2
Andreas Jellinghaus wrote:

>On Friday 07 October 2005 12:01, Stef Hoeben wrote:
>  
>
>>Strange, even without setting the PKG_CONFIG_PATH (and besides, there's
>>no libpscsc or so in
>>the /usr/lib/pkgconfig/ on my Mac 10.4?), configure does print at the end:
>>    PC/SC support:       yes
>>So there seems to be something strange going on. Any idea?
>>    
>>
>
>special code for pcsc on darwin. it adds fake PCSC_CFLAGS and PCSC_LIBS
>if none are given, so it works out of the box.
>
Ah, nice...

Can't we do the same for openssl?

Cheers,
Stef

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Martin Paljak
> >special code for pcsc on darwin. it adds fake PCSC_CFLAGS and PCSC_LIBS
> >if none are given, so it works out of the box.

> Can't we do the same for openssl?

We can and should. Will write it if noone else is faster.


--
Martin Paljak
[hidden email]
http://martin.paljak.pri.ee/
+372.5156495 - phone
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Andreas Jellinghaus-2
In reply to this post by Stef Hoeben-2
On Friday 07 October 2005 13:42, Stef Hoeben wrote:
> >special code for pcsc on darwin. it adds fake PCSC_CFLAGS and PCSC_LIBS
> >if none are given, so it works out of the box.
> >
> Ah, nice...
>
> Can't we do the same for openssl?

well... my view is this: PCSC is quite important because apple introduced
a bug or evil feature or whatever you want to call it. to add configure
code makes the documentation much shorter than not having it, and explaining
the mac os x "feature" and how to work around it in detail.

the openssl situation on the other hand is not special at all. your system
should have pkg-config and openssl (runtime and development). if one of
those is missing, it is best to add it.

I don't know why mac os X does not include pkg-config, but I think it is
a bad decission. adding it yourself or using environment might be a good
solution. because it is documented what you should do, I don't think the
situation is bad,,,even if it is clearly not perfect.

sure, we can add configure code. but we have two fight two evils:
 - the code still must be flexible. (martin had problems with pcsc code
   once he used his own version of pcsc-lite. if we add auto magic code
   for openssl, we should make very sure, we can still use a non system
   openssl, too).
 - complexity. lets keep configure maintainable. each feature needs to
   be documented and maintained, and in the past we have not been very
   good at this.

also I got code from JP for creating a nice gui installer for mac os X.
I haven't looked into it, but will do so, and I think we should have that.
so configure on mac os X is not a very important issue for me, I'm fine
with the current documented procedure, and once we have a gui installer
few people will compile it themself anyway.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Peter Stuge
On Sun, Oct 09, 2005 at 07:23:57PM +0200, Andreas Jellinghaus wrote:
> sure, we can add configure code. but we have two fight two evils:
>  - the code still must be flexible. (martin had problems with pcsc
>    code once he used his own version of pcsc-lite. if we add auto
>    magic code for openssl, we should make very sure, we can still
>    use a non system openssl, too).

How about --with-ssl= and --with-ssl-include + --with-ssl-libs, where
the former sets both of the latter to the same value?


>  - complexity. lets keep configure maintainable. each feature needs
>    to be documented and maintained, and in the past we have not
>    been very good at this.

Good point.


> also I got code from JP for creating a nice gui installer for mac
> os X.

Nice!

Have you done any testing with cross-compiling for Windows with mingw?
I cross-compiled Pageant successfully, but haven't tried with
anything else.


//Peter
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Andreas Jellinghaus-2
On Monday 10 October 2005 01:02, Peter Stuge wrote:
> How about --with-ssl= and --with-ssl-include + --with-ssl-libs, where
> the former sets both of the latter to the same value?

is
./configure --prefix=/usr --sysconfdir=/etc \
        --with-ssl-include="-I/usr/include" \
        --with-ssl-libs="-L/usr/lib -lcrypto"
so much easier than
export OPENSSL_CFLAGS="-I/usr/include"
export OPENSSL_LIBS="-L/usr/lib -lcrypto"
./configure --prefix=/usr --sysconfdir=/etc

?

I'm not 100% sure if the benefit of the first is worth the additional code
and complexity and need for documentation.

as long as we stay with pkg-config, you then had two options:
OPENSSL_CFLAGS and --with-ssl-includes. which one would win?
we would need to document that... or had to get rid of pkg-config.

> Have you done any testing with cross-compiling for Windows with mingw?
> I cross-compiled Pageant successfully, but haven't tried with
> anything else.

no. For a while I tried linux based mingw for cross compilation,
but mingw or wine are not enough, as I would need the windows
header files for PCSC and stuff, and that way a valid windows
license etc. too much headacke.

so currently I'm still using visual c on windows, and have no plans
for anything else.

Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Ludovic Rousseau
In reply to this post by Andreas Jellinghaus-2
On 07/10/05, Andreas Jellinghaus <[hidden email]> wrote:

> My Position is:
> we need to document configure / make / make install,
> all options in configure, all environment variables
> and so on.
>
> that documentation can simply include:
>
> to compile opensc on mac os X, you will most likely
> want this:
> export OPENSSL_CFLAGS="-I/usr/include"
> export OPENSSL_LIBS="-L/usr/lib -lcrypto"
> ./configure --prefix=/usr --sysconfdir=/etc
> make
> make install

We could put these 5 lines in a script file called MacOSXmagicbox.sh
so users do not have to cut-n-paste the lines themseves? :-)

> I don't like magic boxes. I think it is better to give
> the user a good idea what is happening, and how he can
> influence it. If a user sees above, it is quite trivial,
> to use a different openssl, install in a different place
> or chose a different location for the config file.

./configure is already a big magic box. We could also decide to let
the user write his own Makefiles so he knows what he does :-)

I disagree with you on how much ./configure should be magic. But I
can't do much to change things.

It is not really important for me since I use a debian/rules script to
compile OpenSC and I put my magic commands in it.

Everything can be magic if you do not know how it works. A few years
ago ./configure was very magic for me.

This mail is sarcastic, consider it as a joke if you want.

Bye,

--
 Dr. Ludovic Rousseau
 For private mail use [hidden email] and not "big brother" Google
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Configure help for Mac

Andreas Jellinghaus-2
On Monday 10 October 2005 10:38, Ludovic Rousseau wrote:
> This mail is sarcastic, consider it as a joke if you want.

write a patch, post it.
if it compiles, it works and is properly documented,
and several developers want it, then it will go in,
whether I like it or not.

I might have different preferences and I know I'm way
to loud on this mailing list, but I'm no dictator.
we should follow consens and whatever most developers
agree to.

I know I want the minimum code necessary in configure,
maybe that is being over protective. But I spend far
too much time on trying to understand the huge maze configure
is, and still got some stuff wrong. So thats why I fear
complexity, it did bite me several times in configure.
help with maintaining it is very welcome.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel