Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use one configuration file for all systems
  • Loading branch information
Frank Morgner committed Oct 1, 2015
1 parent a4ca190 commit 1480a4e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 711 deletions.
15 changes: 14 additions & 1 deletion configure.ac
Expand Up @@ -114,13 +114,19 @@ esac

case "${host}" in
*-mingw*|*-winnt*|*-cygwin*)
DEBUG_FILE="%TEMP%\opensc-debug.log"
DEBUG_FILE="%TEMP%\\\opensc-debug.log"
PROFILE_DIR_DEFAULT="obtained from windows registers"
PROFILE_DIR="\"\""
;;
*)
DEBUG_FILE="/tmp/opensc-debug.log"
PROFILE_DIR="\$(pkgdatadir)"
PROFILE_DIR_DEFAULT="\$(pkgdatadir)"
;;
esac
AC_DEFINE_UNQUOTED([DEBUG_FILE], ["${DEBUG_FILE}"], [Debug file])
AC_DEFINE_UNQUOTED([PROFILE_DIR], ["${PROFILE_DIR}"], [Directory of profiles])
AC_DEFINE_UNQUOTED([PROFILE_DIR_DEFAULT], ["${PROFILE_DIR_DEFAULT}"], [Default directory of profiles])

AC_ARG_ENABLE(
[strict],
Expand Down Expand Up @@ -512,15 +518,19 @@ if test "${enable_sm}" = "yes"; then
case "${host}" in
*-mingw*|*-winnt*|*-cygwin*)
DEFAULT_SM_MODULE="smm-local.dll"
DEFAULT_SM_MODULE_PATH="\# module_path = \"\";"
;;
*-apple-*)
DEFAULT_SM_MODULE="libsmm-local.3.dylib"
DEFAULT_SM_MODULE_PATH="module_path = \$(libdir);"
;;
*)
DEFAULT_SM_MODULE="libsmm-local.so.3"
DEFAULT_SM_MODULE_PATH="module_path = \$(libdir);"
;;
esac
AC_DEFINE_UNQUOTED([DEFAULT_SM_MODULE], ["${DEFAULT_SM_MODULE}"], [Default SM module])
AC_DEFINE_UNQUOTED([DEFAULT_SM_MODULE_PATH], ["${DEFAULT_SM_MODULE_PATH}"], [Default SM module path])
fi

if test "${enable_openct}" = "yes"; then
Expand Down Expand Up @@ -697,7 +707,10 @@ AC_SUBST([OPTIONAL_OPENCT_LIBS])
AC_SUBST([OPTIONAL_PCSC_CFLAGS])
AC_SUBST([LIBRARY_BITNESS])
AC_SUBST([DEFAULT_SM_MODULE])
AC_SUBST([DEFAULT_SM_MODULE_PATH])
AC_SUBST([DEBUG_FILE])
AC_SUBST([PROFILE_DIR])
AC_SUBST([PROFILE_DIR_DEFAULT])

AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"])
AM_CONDITIONAL([ENABLE_ZLIB], [test "${enable_zlib}" = "yes"])
Expand Down
13 changes: 8 additions & 5 deletions etc/Makefile.am
@@ -1,12 +1,12 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/opensc.conf.win
DISTCLEANFILES = opensc.conf opensc.conf.win
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
DISTCLEANFILES = opensc.conf

EXTRA_DIST = Makefile.mak

SUFFIXES = .in

dist_noinst_DATA = opensc.conf.in opensc.conf.win.in
nodist_noinst_DATA = opensc.conf opensc.conf.win # For Windows MSVC build
dist_noinst_DATA = opensc.conf.in
nodist_noinst_DATA = opensc.conf

# Make sure we build this every time
# as there is no dependency for this.
Expand All @@ -18,9 +18,12 @@ opensc.conf: opensc.conf.in force
@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|@DEBUG_FILE[@]|$(DEBUG_FILE)|g' \
-e 's|@DEFAULT_SM_MODULE_PATH[@]|$(DEFAULT_SM_MODULE_PATH)|g' \
-e 's|@PROFILE_DIR[@]|$(PROFILE_DIR)|g' \
-e 's|@PROFILE_DIR_DEFAULT[@]|$(PROFILE_DIR_DEFAULT)|g' \
< $< > $@

install-exec-hook: opensc.conf
Expand Down
8 changes: 0 additions & 8 deletions etc/Makefile.mak
@@ -1,8 +0,0 @@
all: opensc.conf.win

opensc.conf.win: opensc.conf.win.in
copy /y opensc.conf.win.in opensc.conf.win

clean::
del /Q opensc.conf.win

25 changes: 13 additions & 12 deletions etc/opensc.conf.in
Expand Up @@ -32,9 +32,9 @@ app default {

# PKCS#15 initialization / personalization
# profiles directory for pkcs15-init.
# Default: @pkgdatadir@
# Default: @PROFILE_DIR_DEFAULT@
#
# profile_dir = @pkgdatadir@;
# profile_dir = @PROFILE_DIR@;

# Paranoid memory allocation.
#
Expand Down Expand Up @@ -335,12 +335,11 @@ app default {
}

secure_messaging local_authentic {
#path to ans name of external SM module
#module_name = @DEFAULT_SM_MODULE@;
#module_path = @libdir@;
# name of external SM module
# module_name = @DEFAULT_SM_MODULE@;
# directory with external SM module
# Default: defined by windows register
# module_path = "";
@DEFAULT_SM_MODULE_PATH@

# specific data to tune the module initialization
# module_data = "Here can be your SM module init data";
Expand All @@ -363,8 +362,8 @@ app default {

secure_messaging local_gemalto_iam {
module_name = @DEFAULT_SM_MODULE@;
module_path = @libdir@;
#module_data = "";
@DEFAULT_SM_MODULE_PATH@
# module_data = "";
type = acl; # transmit, acl

ifd_serial = "11:22:33:44:55:66:77:88";
Expand All @@ -382,7 +381,8 @@ app default {

secure_messaging local_amos {
module_name = @DEFAULT_SM_MODULE@;
module_path = @libdir@;
@DEFAULT_SM_MODULE_PATH@
# module_data = "";
mode = acl;
ifd_serial = "11:22:33:44:55:66:77:88";
keyset_02_enc = "ENCROECHANTILLON";
Expand All @@ -391,7 +391,8 @@ app default {

secure_messaging local_amos_eid {
module_name = @DEFAULT_SM_MODULE@;
module_path = @libdir@;
@DEFAULT_SM_MODULE_PATH@
# module_data = "";
mode = acl;
ifd_serial = "11:22:33:44:55:66:77:88";
keyset_E828BD080FD2504543432D654944_03_enc = "RW_PUBL_ENC_TEST";
Expand All @@ -400,8 +401,8 @@ app default {

secure_messaging local_adele {
module_name = @DEFAULT_SM_MODULE@;
module_path = @libdir@;
#module_data = "";
@DEFAULT_SM_MODULE_PATH@
# module_data = "";
type = acl; # transmit, acl

ifd_serial = "11:22:33:44:55:66:77:88";
Expand Down

0 comments on commit 1480a4e

Please sign in to comment.