On Friday 10 August 2007, Andreas Jellinghaus wrote: > would be nice to get this working, but we need to set LTLIBLTDL or similar > (or adjust the autoconf makefiles - I prefer not setting LIBS so we can > add -lltdl only where needed and not on a global scale).
Attached. > also we need to > check if ltdl needs -ldl in term, might do so on some plattforms. Why? You don't create static library... So if A uses B and you like with A, B will be loaded at runtime by A. > > thats one of the reason why I like pkg-config and friends: the library comes > with info how to link it, including depending libraries, I don't have to > guess and maintain knowledge about that in our code. True... And libtool of all does not offer pkgconfig option... > also we need to document what to do if ltdl is installed in some place. > set CFLAGS and LIBS or add our own code to handle -L/foo/lib > and -I/foo/include ? another reason where pkg-config is much easier and > simply works. (but not an option here, the libtool guys don't ship ltdl with > a > pc file.) Attached. Alon. --- Index: configure.in =================================================================== --- configure.in (revision 3242) +++ configure.in (working copy) @@ -195,14 +195,26 @@ ]) dnl use ltdl -AC_CHECK_LIB([ltdl],lt_dlopen) +if test -z "${LTLIB_LIBS}"; then + AC_ARG_VAR([LTLIB_CFLAGS], [C compiler flags for libltdl]) + AC_ARG_VAR([LTLIB_LIBS], [linker flags for libltdl]) -saved_LIBS="$LIBS" -LIBS="$saved_LIBS $LIBLTDL" -AC_CHECK_HEADER([ltdl.h], [AC_MSG_RESULT([yes])], - [ AC_MSG_ERROR([ltdl.h not found, please install libltdl and/or libtool]) ]) -LIBS="$saved_LIBS" + AC_CHECK_LIB( + [ltdl], + [lt_dlopen], + [LTLIB_LIBS="-lltdl"], + [AC_MSG_ERROR([ltdl1 not found, please install libltdl and/or libtool])] + ) + AC_CHECK_HEADER( + [ltdl.h], + , + [AC_MSG_ERROR([ltdl.h not found, please install libltdl and/or libtool])] + ) +fi +AC_SUBST([LTLIB_CFLAGS]) +AC_SUBST([LTLIB_LIBS]) + OPENCT_MSG=no if test "x${ENABLE_OPENCT}" = "xyes"; then PKG_CHECK_MODULES(OPENCT, [libopenct], [ Index: src/tools/Makefile.am =================================================================== --- src/tools/Makefile.am (revision 3242) +++ src/tools/Makefile.am (working copy) @@ -22,7 +22,7 @@ pkcs15_tool_SOURCES = pkcs15-tool.c util.c $(top_srcdir)/src/common/my_getopt.c pkcs15_tool_LDADD = $(OPENSSL_LIBS) pkcs11_tool_SOURCES = pkcs11-tool.c util.c $(top_srcdir)/src/common/my_getopt.c -pkcs11_tool_LDADD = ../pkcs11/libpkcs11.la $(OPENSSL_LIBS) $(LTLIBLTDL) +pkcs11_tool_LDADD = ../pkcs11/libpkcs11.la $(OPENSSL_LIBS) $(LTLIB_LIBS) pkcs15_crypt_SOURCES = pkcs15-crypt.c util.c $(top_srcdir)/src/common/my_getopt.c pkcs15_crypt_LDADD = $(OPENSSL_LIBS) cryptoflex_tool_SOURCES = cryptoflex-tool.c util.c $(top_srcdir)/src/common/my_getopt.c Index: src/pkcs11/Makefile.am =================================================================== --- src/pkcs11/Makefile.am (revision 3242) +++ src/pkcs11/Makefile.am (working copy) @@ -33,7 +33,7 @@ pkcs11_spy_la_SOURCES = pkcs11-spy.c pkcs11-display.c pkcs11-display.h pkcs11_spy_la_LDFLAGS = -module -avoid-version -pkcs11_spy_la_LIBADD = $(OPENSSL_LIBS) libpkcs11.la $(LTLIBLTDL) +pkcs11_spy_la_LIBADD = $(OPENSSL_LIBS) libpkcs11.la $(LTLIB_LIBS) include_HEADERS = pkcs11.h Index: src/tests/Makefile.am =================================================================== --- src/tests/Makefile.am (revision 3242) +++ src/tests/Makefile.am (working copy) @@ -6,7 +6,7 @@ EXTRA_DIST = Makefile.mak -AM_LDFLAGS = @LIBOPENSC@ $(LTLIBLTDL) +AM_LDFLAGS = @LIBOPENSC@ $(LTLIB_LIBS) AM_CFLAGS = -I$(top_srcdir)/src/common noinst_PROGRAMS = base64 lottery p15dump pintest prngtest Index: src/libopensc/Makefile.am =================================================================== --- src/libopensc/Makefile.am (revision 3242) +++ src/libopensc/Makefile.am (working copy) @@ -37,7 +37,7 @@ pkcs15-actalis.c pkcs15-atrust-acos.c pkcs15-tccardos.c pkcs15-piv.c \ compression.c p15card-helper.c libopensc_la_LDFLAGS = -version-info @OPENSC_LT_CURRENT@:@OPENSC_LT_REVISION@:@OPENSC_LT_AGE@ -libopensc_la_LIBADD = @LIBSCCONF@ $(OPENSSL_LIBS) $(OPENCT_LIBS) $(PCSC_LIBS) $(LTLIBLTDL) +libopensc_la_LIBADD = @LIBSCCONF@ $(OPENSSL_LIBS) $(OPENCT_LIBS) $(PCSC_LIBS) $(LTLIB_LIBS) include_HEADERS = \ opensc.h pkcs15.h emv.h \ _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel