diff --git a/configure.ac b/configure.ac index 3eeaf82c..d82c289e 100644 --- a/configure.ac +++ b/configure.ac @@ -544,10 +544,10 @@ fi if test "${enable_sm}" = "yes"; then AC_DEFINE([ENABLE_SM], [1], [Enable secure messaging support]) + DEFAULT_SM_MODULE="${LIB_PRE}smm-local${DYN_LIB_EXT}" case "${host}" in *-mingw*|*-winnt*|*-cygwin*) - DEFAULT_SM_MODULE="smm-local.dll" - DEFAULT_SM_MODULE_PATH="\#module_path = \"\";" + DEFAULT_SM_MODULE_PATH="\# module_path = \"\";" ;; *-apple-*) DEFAULT_SM_MODULE="libsmm-local.dylib" @@ -627,15 +627,23 @@ if test "${enable_pcsc}" = "yes"; then fi AC_SUBST(DYN_LIB_EXT) +AC_SUBST(LIBDIR) +AC_SUBST(LIB_PRE) case "${host}" in *-mingw*|*-winnt*|*-cygwin*) DYN_LIB_EXT=".dll" + LIBDIR="" + LIB_PRE="" ;; *-apple-*) DYN_LIB_EXT=".dylib" + LIBDIR="\$(libdir)/" + LIB_PRE="lib" ;; *) DYN_LIB_EXT=".so" + LIBDIR="\$(libdir)/" + LIB_PRE="lib" ;; esac diff --git a/etc/Makefile.am b/etc/Makefile.am index 60e0c1be..fcd2286c 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -17,12 +17,13 @@ opensc.conf: opensc.conf.in force .in: @sed \ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \ - -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@DEBUG_FILE[@]|$(DEBUG_FILE)|g' \ -e 's|@DEFAULT_PCSC_PROVIDER[@]|$(DEFAULT_PCSC_PROVIDER)|g' \ -e 's|@DEFAULT_SM_MODULE[@]|$(DEFAULT_SM_MODULE)|g' \ -e 's|@DEFAULT_SM_MODULE_PATH[@]|$(DEFAULT_SM_MODULE_PATH)|g' \ -e 's|@DYN_LIB_EXT[@]|$(DYN_LIB_EXT)|g' \ + -e 's|@LIBDIR[@]|$(LIBDIR)|g' \ + -e 's|@LIB_PRE[@]|$(LIB_PRE)|g' \ -e 's|@PROFILE_DIR[@]|$(PROFILE_DIR)|g' \ -e 's|@PROFILE_DIR_DEFAULT[@]|$(PROFILE_DIR_DEFAULT)|g' \ < $< > $@ diff --git a/etc/opensc.conf.in b/etc/opensc.conf.in index 37d4ee8e..da26f5df 100644 --- a/etc/opensc.conf.in +++ b/etc/opensc.conf.in @@ -53,7 +53,7 @@ app default { # CT-API module configuration. reader_driver ctapi { - # module @libdir@/libtowitoko@DYN_LIB_EXT@ { + # module @LIBDIR@@LIB_PRE@towitoko@DYN_LIB_EXT@ { # CT-API ports: # 0..3 COM1..4 # 4 Printer @@ -134,7 +134,7 @@ app default { # # card_driver customcos { # The location of the driver library - # module = @libdir@/card_customcos@DYN_LIB_EXT@; + # module = @LIBDIR@@LIB_PRE@card_customcos@DYN_LIB_EXT@; # } # Force using specific card driver @@ -504,7 +504,7 @@ app default { # # emulate custom { # The location of the driver library - # module = @libdir@/p15emu_custom@DYN_LIB_EXT@; + # module = @LIBDIR@@LIB_PRE@p15emu_custom@DYN_LIB_EXT@; # } # some additional application parameters: