configure cleanup

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

configure cleanup

Andreas Jellinghaus-2
I'd like to make the configure code as simply as possible.
That includes removing all features we (no longer?) need.

For example the --with-common stuff doesn't work well with
pkg-config, so I would drop it.

also I'd like to simplify the code for most libraries.
for example this can probe for openct:
PKG_CHECK_MODULES(OPENCT, [openct], [
        OPENCT_MSG=yes
        AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files])
        ], [
        OPENCT_MSG=no
        ])
fi
AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes")


and openssl code is short as well:

PKG_CHECK_MODULES(OPENSSL, [openssl], [
        OPENSSL_MSG=yes
        AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries and header files])
        ], [
        OPENSSL_MSG=no
        ])
fi
AM_CONDITIONAL(HAVE_OPENSSL, test "x$OPENSSL_MSG" = "xyes")

(the long version is kept in the engine_pkcs11 confiure code, it needs
that complexity...)

and pcsc could bre probed like this:

case "$host" in
*-*-darwin*)
        if test -n "$PCSC_LIBS" -a -n "$PCSC_LIBS"
        then
                PCSC_MSG=yes
                PCSC_CFLAGS=""
                PCSC_LIBS="-Wl,-framework,PCSC"
        fi
        ;;
esac

PKG_CHECK_MODULES(PCSC, [libpcsclite], [
        PCSC_MSG=yes
        AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation])
        ], [
        PCSC_MSG=no
        ])
fi
AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes")

if test "x$PCSC_MSG" = "xyes"; then
        CPPFLAGS="${PCSC_CFLAGS} $saved_CPPFLAGS"
        CFLAGS="$PCSC_CFLAGS $saved_CFLAGS"
        LIBS="$PCSC_LIBS $saved_LIBS"
        AC_TRY_LINK([
#include <stdlib.h>
#ifdef __APPLE__
#include <PCSC/wintypes.h>
#include <PCSC/winscard.h>
#else
#include <winscard.h>
#endif
        ], [
SCardControl(NULL, NULL, 0, NULL, NULL);
        ], [
                AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite])
        ])
        CPPFLAGS="$saved_CPPFLAGS"
        CFLAGS="$saved_CFLAGS"
        LIBS="$saved_LIBS"
fi

# check for reader.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PCSC_CFLAGS"
AC_CHECK_HEADER(reader.h,
        [AC_DEFINE([HAVE_READER_H], 1, [Define if pcsc-lite with reader.h
exists])],
        [AC_MSG_WARN([reader.h not found, install pcsc-lite 1.2.9-beta8 or
later, or use CFLAGS=... ./configure])],
        [ #include <reader.h>])
CFLAGS="$saved_CFLAGS"



that saves a lot of code and makes it easier to maintainer.
still the code is so far untested. how should I proceed?
Is it ok to do those changes / rewrites in trunk, or should
I rather try using a branch?

does anyone see a problem with the simplification?

Martin: is it ok, to ask mac os X users that do not want
to use the mac os X pcsc libs etc. to set PCSC_LIBS and PCSC_CFLAGS
before configuring? flexibel but keeps the code simple.


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 cleanup

Roumen Petrov-2
Hi all,
Tools like pkg-config are not usefull in development environment!
Should developers install untested dependent libraries - NO.


Andreas Jellinghaus wrote:

> I'd like to make the configure code as simply as possible.
> That includes removing all features we (no longer?) need.
>
> For example the --with-common stuff doesn't work well with
> pkg-config, so I would drop it.
>
> also I'd like to simplify the code for most libraries.
> for example this can probe for openct:
> PKG_CHECK_MODULES(OPENCT, [openct], [
>         OPENCT_MSG=yes
>         AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files])
>         ], [
>         OPENCT_MSG=no
>         ])
> fi
> AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes")
>
>
> and openssl code is short as well:
>
> PKG_CHECK_MODULES(OPENSSL, [openssl], [
>         OPENSSL_MSG=yes
>         AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries and header files])
>         ], [
>         OPENSSL_MSG=no
>         ])
> fi
> AM_CONDITIONAL(HAVE_OPENSSL, test "x$OPENSSL_MSG" = "xyes")
>
> (the long version is kept in the engine_pkcs11 confiure code, it needs
> that complexity...)
>
> and pcsc could bre probed like this:
>
> case "$host" in
> *-*-darwin*)
>         if test -n "$PCSC_LIBS" -a -n "$PCSC_LIBS"
>         then
>                 PCSC_MSG=yes
>                 PCSC_CFLAGS=""
>                 PCSC_LIBS="-Wl,-framework,PCSC"
>         fi
>         ;;
> esac
>
> PKG_CHECK_MODULES(PCSC, [libpcsclite], [
>         PCSC_MSG=yes
>         AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation])
>         ], [
>         PCSC_MSG=no
>         ])
> fi
> AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes")
>
> if test "x$PCSC_MSG" = "xyes"; then
>         CPPFLAGS="${PCSC_CFLAGS} $saved_CPPFLAGS"
>         CFLAGS="$PCSC_CFLAGS $saved_CFLAGS"
>         LIBS="$PCSC_LIBS $saved_LIBS"
>         AC_TRY_LINK([
> #include <stdlib.h>
> #ifdef __APPLE__
> #include <PCSC/wintypes.h>
> #include <PCSC/winscard.h>
> #else
> #include <winscard.h>
> #endif
>         ], [
> SCardControl(NULL, NULL, 0, NULL, NULL);
>         ], [
>                 AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite])
>         ])
>         CPPFLAGS="$saved_CPPFLAGS"
>         CFLAGS="$saved_CFLAGS"
>         LIBS="$saved_LIBS"
> fi
>
> # check for reader.h
> saved_CFLAGS="$CFLAGS"
> CFLAGS="$CFLAGS $PCSC_CFLAGS"
> AC_CHECK_HEADER(reader.h,
>         [AC_DEFINE([HAVE_READER_H], 1, [Define if pcsc-lite with reader.h
> exists])],
>         [AC_MSG_WARN([reader.h not found, install pcsc-lite 1.2.9-beta8 or
> later, or use CFLAGS=... ./configure])],
>         [ #include <reader.h>])
> CFLAGS="$saved_CFLAGS"
>
>
>
> that saves a lot of code and makes it easier to maintainer.
> still the code is so far untested. how should I proceed?
> Is it ok to do those changes / rewrites in trunk, or should
> I rather try using a branch?
>
> does anyone see a problem with the simplification?
>
> Martin: is it ok, to ask mac os X users that do not want
> to use the mac os X pcsc libs etc. to set PCSC_LIBS and PCSC_CFLAGS
> before configuring? flexibel but keeps the code simple.
>
>
> Regards, Andreas
> _______________________________________________
> opensc-devel mailing list
> [hidden email]
> http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
>


--
Get X.509 certificates support in OpenSSH:
http://roumenpetrov.info/openssh/
_______________________________________________
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 cleanup

Andreas Jellinghaus-2
On Wednesday 31 August 2005 21:03, Roumen Petrov wrote:
> Hi all,
> Tools like pkg-config are not usefull in development environment!
> Should developers install untested dependent libraries - NO.

let me quote from pkg.m4:

[Package requirements ($2) were not met.
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
to avoid the need to call pkg-config.  See the pkg-config man page for
more details.])],

I don't see anything wrong with this, you can see OPENCT_CFLAGS and
OPENCT_LIBS to point to whatever options you want and pkg-config
will neither be required nor called at all.

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 cleanup

Roumen Petrov-2
I cannot understand why developer should set tons of environment variables instead to use only two well known.


Andreas Jellinghaus wrote:

> On Wednesday 31 August 2005 21:03, Roumen Petrov wrote:
>
>>Hi all,
>>Tools like pkg-config are not usefull in development environment!
>>Should developers install untested dependent libraries - NO.
>
>
> let me quote from pkg.m4:
>
> [Package requirements ($2) were not met.
> Consider adjusting the PKG_CONFIG_PATH environment variable if you
> installed software in a non-standard prefix.
>
> Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
> to avoid the need to call pkg-config.  See the pkg-config man page for
> more details.])],
>
> I don't see anything wrong with this, you can see OPENCT_CFLAGS and
> OPENCT_LIBS to point to whatever options you want and pkg-config
> will neither be required nor called at all.
>
> Regards, Andreas
> _______________________________________________
> opensc-devel mailing list
> [hidden email]
> http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
>
_______________________________________________
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 cleanup

Nils Larsch
In reply to this post by Andreas Jellinghaus-2
Andreas Jellinghaus wrote:

> I'd like to make the configure code as simply as possible.
> That includes removing all features we (no longer?) need.
>
> For example the --with-common stuff doesn't work well with
> pkg-config, so I would drop it.
>
> also I'd like to simplify the code for most libraries.
> for example this can probe for openct:
> PKG_CHECK_MODULES(OPENCT, [openct], [
>         OPENCT_MSG=yes
>         AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files])
>         ], [
>         OPENCT_MSG=no
>         ])
> fi
> AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes")
>
>
> and openssl code is short as well:
>
> PKG_CHECK_MODULES(OPENSSL, [openssl], [
>         OPENSSL_MSG=yes
>         AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries and header files])
>         ], [
>         OPENSSL_MSG=no
>         ])
> fi
> AM_CONDITIONAL(HAVE_OPENSSL, test "x$OPENSSL_MSG" = "xyes")
>
> (the long version is kept in the engine_pkcs11 confiure code, it needs
> that complexity...)
>
> and pcsc could bre probed like this:
>
> case "$host" in
> *-*-darwin*)
>         if test -n "$PCSC_LIBS" -a -n "$PCSC_LIBS"
>         then
>                 PCSC_MSG=yes
>                 PCSC_CFLAGS=""
>                 PCSC_LIBS="-Wl,-framework,PCSC"
>         fi
>         ;;
> esac
>
> PKG_CHECK_MODULES(PCSC, [libpcsclite], [
>         PCSC_MSG=yes
>         AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation])
>         ], [
>         PCSC_MSG=no
>         ])
> fi
> AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes")
>
> if test "x$PCSC_MSG" = "xyes"; then
>         CPPFLAGS="${PCSC_CFLAGS} $saved_CPPFLAGS"
>         CFLAGS="$PCSC_CFLAGS $saved_CFLAGS"
>         LIBS="$PCSC_LIBS $saved_LIBS"
>         AC_TRY_LINK([
> #include <stdlib.h>
> #ifdef __APPLE__
> #include <PCSC/wintypes.h>
> #include <PCSC/winscard.h>
> #else
> #include <winscard.h>
> #endif
>         ], [
> SCardControl(NULL, NULL, 0, NULL, NULL);
>         ], [
>                 AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite])
>         ])
>         CPPFLAGS="$saved_CPPFLAGS"
>         CFLAGS="$saved_CFLAGS"
>         LIBS="$saved_LIBS"
> fi
>
> # check for reader.h
> saved_CFLAGS="$CFLAGS"
> CFLAGS="$CFLAGS $PCSC_CFLAGS"
> AC_CHECK_HEADER(reader.h,
>         [AC_DEFINE([HAVE_READER_H], 1, [Define if pcsc-lite with reader.h
> exists])],
>         [AC_MSG_WARN([reader.h not found, install pcsc-lite 1.2.9-beta8 or
> later, or use CFLAGS=... ./configure])],
>         [ #include <reader.h>])
> CFLAGS="$saved_CFLAGS"
>
>
>
> that saves a lot of code and makes it easier to maintainer.
> still the code is so far untested. how should I proceed?
> Is it ok to do those changes / rewrites in trunk, or should
> I rather try using a branch?

I'm not really happy with this change as it prevents me from building
opensc on my developement system (and restricts the supported
platforms in general) due to a lack of some *.pc files :-(  I guess I
need to stick to revesion 2523 of configure.in.

Nils
_______________________________________________
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 cleanup

Andreas Jellinghaus-2
> I'm not really happy with this change as it prevents me from building
> opensc on my developement system (and restricts the supported
> platforms in general) due to a lack of some *.pc files :-(  I guess I
> need to stick to revesion 2523 of configure.in.

sorry, already commited. is there any problem with
export OPENSSL_LIBS="-L/path/to/your/openssl/lib -lcrypto -lssl"
export OPENSSL_CFLAGS="-I/path/to/your/openssl/include"
before running configure? that should bypass pkg-config for openssl.

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