List Info

Thread: Configure - allow disable pcsc-lite and openct linkage




Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-06 06:27:05
Hello,

I've created a patch for Gentoo that enables disabling the
linkage of pcsc-lite and openct,
even if they are installed on system.
It adds --disable-openct and --disable-pcsc-lite options.
Also a minor correction for pkg-config (adds
PKG_PROG_PKG_CONFIG).

Please review.

Best Regards,
Alon Bar-Lev

---

--- opensc-0.11.1.org/configure.in	2006-05-31
00:04:47.000000000 +0300
+++ opensc-0.11.1/configure.in	2006-12-02 19:10:35.000000000
+0200
 -25,6
+25,7  AC_SUBST(OPENSC_LT_AGE)
 
 AC_CANONICAL_HOST
 AC_PROG_CC
+PKG_PROG_PKG_CONFIG
 AC_C_BIGENDIAN
 
 dnl Check for some target-specific stuff
 -59,6
+60,17  case "$host" in
 	;;
 esac
 
+dnl Enable/disable openct
+AC_ARG_ENABLE(openct,
+	AC_HELP_STRING([--disable-openct], [disable openct
linkage. [[default=no]]]),
+	[ENABLE_OPENCT="$"],
+	[ENABLE_OPENCT="yes"])
+dnl Enable/disable pcsc
+AC_ARG_ENABLE(pcsc-lite,
+	AC_HELP_STRING([--disable-pcsc-lite], [disable pcsc-lite
linkage. [[default=no]]]),
+	[ENABLE_PCSC_LITE="$"],
+	[ENABLE_PCSC_LITE="yes"])
+
 dnl Options
 AM_MAINTAINER_MODE
 
 -194,14
+206,17  AC_CHECK_HEADER([ltdl.h], [AC_MSG_RESULT
    [ AC_MSG_ERROR([ltdl.h not found, please install libltdl
and/or libtool]) ])
 LIBS="$saved_LIBS"
 
-PKG_CHECK_MODULES(OPENCT, [libopenct], [
-	OPENCT_MSG=yes
-	AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and
header files])
-	], [
-	OPENCT_MSG=no
-	])
-AC_SUBST(OPENCT_CFLAGS)
-AC_SUBST(OPENCT_LIBS)
+OPENCT_MSG=no
+if test "x$" = "xyes";
then
+	PKG_CHECK_MODULES(OPENCT, [libopenct], [
+		OPENCT_MSG=yes
+		AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and
header files])
+		], [
+		OPENCT_MSG=no
+		])
+	AC_SUBST(OPENCT_CFLAGS)
+	AC_SUBST(OPENCT_LIBS)
+fi
 
 AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" =
"xyes")
 
 -216,72
+231,75  AC_SUBST(OPENSSL_LIBS)
 
 AM_CONDITIONAL(HAVE_OPENSSL, test "x$OPENSSL_MSG"
= "xyes")
 
-PKG_CHECK_MODULES(PCSC, [libpcsclite], [
-        PCSC_MSG=yes
-	AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation])
-        ], [
-        PCSC_MSG=no
-        ])
-AC_SUBST(PCSC_CFLAGS)
-AC_SUBST(PCSC_LIBS)
-
-case "$host" in
-*-*-darwin*)
-	if test -z "$PCSC_LIBS" -a -z
"$PCSC_LIBS"
-	then
+PCSC_MSG=no
+if test "x$" =
"xyes"; then
+	PKG_CHECK_MODULES(PCSC, [libpcsclite], [
 		PCSC_MSG=yes
-		PCSC_CFLAGS=""
-		PCSC_LIBS="-Wl,-framework,PCSC"
+		AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation])
+		], [
+		PCSC_MSG=no
+		])
+	AC_SUBST(PCSC_CFLAGS)
+	AC_SUBST(PCSC_LIBS)
+
+	case "$host" in
+	*-*-darwin*)
+		if test -z "$PCSC_LIBS" -a -z
"$PCSC_LIBS"
+		then
+			PCSC_MSG=yes
+			PCSC_CFLAGS=""
+			PCSC_LIBS="-Wl,-framework,PCSC"
+
+			# overwrite autoconf cached variables, too.
+			ac_env_PCSC_CFLAGS_set=${PCSC_CFLAGS+set}
+			ac_env_PCSC_CFLAGS_value=$PCSC_CFLAGS
+			ac_cv_env_PCSC_CFLAGS_set=${PCSC_CFLAGS+set}
+			ac_cv_env_PCSC_CFLAGS_value=$PCSC_CFLAGS
+			ac_env_PCSC_LIBS_set=${PCSC_LIBS+set}
+			ac_env_PCSC_LIBS_value=$PCSC_LIBS
+			ac_cv_env_PCSC_LIBS_set=${PCSC_LIBS+set}
+			ac_cv_env_PCSC_LIBS_value=$PCSC_LIBS
+
+			# header files are included via PCSC/*
+			AC_DEFINE(PCSC_INCLUDES_IN_PCSC, 1, [Header files in
PCSC subdirectory])
+			AC_DEFINE(HAVE_PCSC, 1 , [Have PC/SC implementation])
+		fi
+		;;
+	esac
 
-		# overwrite autoconf cached variables, too.
-		ac_env_PCSC_CFLAGS_set=${PCSC_CFLAGS+set}
-		ac_env_PCSC_CFLAGS_value=$PCSC_CFLAGS
-		ac_cv_env_PCSC_CFLAGS_set=${PCSC_CFLAGS+set}
-		ac_cv_env_PCSC_CFLAGS_value=$PCSC_CFLAGS
-		ac_env_PCSC_LIBS_set=${PCSC_LIBS+set}
-		ac_env_PCSC_LIBS_value=$PCSC_LIBS
-		ac_cv_env_PCSC_LIBS_set=${PCSC_LIBS+set}
-		ac_cv_env_PCSC_LIBS_value=$PCSC_LIBS
-
-		# header files are included via PCSC/*
-		AC_DEFINE(PCSC_INCLUDES_IN_PCSC, 1, [Header files in PCSC
subdirectory])
-		AC_DEFINE(HAVE_PCSC, 1 , [Have PC/SC implementation])
+	saved_LIBS="$LIBS"
+	saved_CFLAGS="$CFLAGS"
+	if test "x$PCSC_MSG" = "xyes"; then
+		CFLAGS="$ $saved_CFLAGS"
+		LIBS="$PCSC_LIBS $saved_LIBS"
+		AC_TRY_LINK([
+	#include <stdlib.h>
+	#ifdef PCSC_INCLUDES_IN_PCSC
+	#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])
+		])
 	fi
-	;;
-esac
-
-AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" =
"xyes")
+	LIBS="$saved_LIBS"
+	CFLAGS="$saved_CFLAGS"
 
-saved_LIBS="$LIBS"
-saved_CFLAGS="$CFLAGS"
-if test "x$PCSC_MSG" = "xyes"; then
-	CFLAGS="$ $saved_CFLAGS"
-	LIBS="$PCSC_LIBS $saved_LIBS"
-	AC_TRY_LINK([
-#include <stdlib.h>
-#ifdef PCSC_INCLUDES_IN_PCSC
-#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])
-	])
+	# 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 PCSC_CFLAGS=... ./configure])],
+		[ #include <reader.h>])
+	CFLAGS="$saved_CFLAGS"
 fi
-LIBS="$saved_LIBS"
-CFLAGS="$saved_CFLAGS"
 
-# 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 PCSC_CFLAGS=... ./configure])],
-	[ #include <reader.h>])
-CFLAGS="$saved_CFLAGS"
+AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" =
"xyes")
 
 dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION,
 dnl                   [ACTION-IF-FOUND [,
ACTION-IF-NOT-FOUND ]]])
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-06 08:47:14
On Wed, Dec 06, 2006 at 08:27:05AM +0200, Alon Bar-Lev
wrote:
> I've created a patch for Gentoo that enables disabling
the linkage
> of pcsc-lite and openct, even if they are installed on
system.
> It adds --disable-openct and --disable-pcsc-lite
options.

This is good for other systems than Gentoo of course. But
opensc
already has a local use flag for openct and some others have
a local
pcsc-lite use flag so I think it's a good idea, but on the
other hand
I don't really know the policy for adding new use flags.

Thanks!


//Peter
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-06 12:48:34
On 12/6/06, Peter Stuge <stuge-opensc-develcdy.org> wrote:
> On Wed, Dec 06, 2006 at 08:27:05AM +0200, Alon Bar-Lev
wrote:
> > I've created a patch for Gentoo that enables
disabling the linkage
> > of pcsc-lite and openct, even if they are
installed on system.
> > It adds --disable-openct and --disable-pcsc-lite
options.
>
> This is good for other systems than Gentoo of course.
But opensc
> already has a local use flag for openct and some others
have a local
> pcsc-lite use flag so I think it's a good idea, but on
the other hand
> I don't really know the policy for adding new use
flags.
>
> Thanks!

This patch IS already used by Gentoo users...
The USE flags were already implemented, but with you don't
use openct
use flag, you don't want the configure to use openct even if
this
component is installed on system.
Just wanted it to be included in upstream.
You are right this is not Gentoo specific.
It is important to have --disabe-XXXX or --without-XXXX for
every
optional component in configure.

Best Regards,
Alon Bar-Lev.
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-09 15:49:30
Alon Bar-Lev wrote:
> I've created a patch for Gentoo that enables disabling
the linkage of pcsc-lite and openct,
> even if they are installed on system.
> It adds --disable-openct and --disable-pcsc-lite
options.

Well, if it helps... commited to trunk, thanks! Can you have
a look at 
the wiki and document the options somewhere, if you find a
fiting place?

> Also a minor correction for pkg-config (adds
PKG_PROG_PKG_CONFIG).

thanks!

Regards, Andreas
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-09 16:02:55
On 12/9/06, Andreas Jellinghaus <ajdungeon.inka.de> wrote:
> Well, if it helps... commited to trunk, thanks! Can you
have a look at
> the wiki and document the options somewhere, if you
find a fiting place?

Done!

Best Regards,
Alon Bar-Lev.
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-11 08:26:23
Andreas Jellinghaus ha scritto:
>> It adds --disable-openct and --disable-pcsc-lite
options.
> 
> Well, if it helps... commited to trunk, thanks!

Yes, it helps, thanks. It's always a good thing to
deliberately choose 
which libraries and packages link to.

--
Alessandro
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-11 09:02:22
Alessandro Premoli wrote:
> Yes, it helps, thanks. It's always a good thing to
deliberately choose 
> which libraries and packages link to.

I don't remember many configure scripts that had all this
complexity to
not only automatically detect some library - which is
sometimes already
horrible - but also to allow to disable that detection if
the library is
optional.

debugging configure is already one of the least things
anyone wants to 
do, so keeping it small and simple is an important goal.

but maybe the whole system is broken, I'm looking forward to
see if 
cmake is more practical. kde is switiching to it, and half a
year
after kde4 release we will see if it works out or not. but
so far what
I read looks promising.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-11 09:14:34
Andreas Jellinghaus wrote:
dungeon.inka.de" type="cite">
I don't remember many configure scripts that had all this complexity to
not only automatically detect some library - which is sometimes already
horrible - but also to allow to disable that detection if the library is
optional.

debugging configure is already one of the least things anyone wants to do, so keeping it small and simple is an important goal.
You are speaking here too much from the developer side and forget the user...If this makes it easier to configure it correctly, than it is an advantage!


--
Regards
 
Signer:      Eddy Nigg, StartCom Ltd.
Phone:       +1.213.341.0390
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-11 09:35:39
On 11/12/06, Andreas Jellinghaus <ajdungeon.inka.de> wrote:
> but maybe the whole system is broken, I'm looking
forward to see if
> cmake is more practical. kde is switiching to it, and
half a year
> after kde4 release we will see if it works out or not.
but so far what
> I read looks promising.

I tried to use cmake for a project. It looks nice but I
could not find
an equivalent for "make dist" and "make
distcheck". But maybe I have
not looked hard enough in the documentation.

Bye

-- 
  Dr. Ludovic Rousseau
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
Configure - allow disable pcsc-lite and openct linkage
user name
2006-12-11 09:56:54
On 12/11/06, Ludovic Rousseau <ludovic.rousseaugmail.com> wrote:
> On 11/12/06, Andreas Jellinghaus <ajdungeon.inka.de> wrote:
> > but maybe the whole system is broken, I'm looking
forward to see if
> > cmake is more practical. kde is switiching to it,
and half a year
> > after kde4 release we will see if it works out or
not. but so far what
> > I read looks promising.
>
> I tried to use cmake for a project. It looks nice but I
could not find
> an equivalent for "make dist" and "make
distcheck". But maybe I have
> not looked hard enough in the documentation.

No. Please don't do that!
I tried to use this new cmake in KDE for QCA.
It is horrible!
autoconf/automake is much better!

In stead of using a scripting engine, they reinvented the
wheel, and
created the most complex definition language the could think
of. Even
a simple if statement is a mess.

Best Regards,
Alon Bar-Lev.
_______________________________________________
opensc-devel mailing list
opensc-devellists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc
-devel
[1-10] [11-12]

about | contact  Other archives ( Real Estate discussion Medical topics )