ports/security/opencryptoki/files/patch-configure.in
Hiroki Sato 8c8d2c3d81 Update to 3.5. Notable changes are as follows:
- No longer required to run pkcs11_startup.

   pkcs11_startup and pkcs_slotd were shell scripts that created the
   config file, pk_config_data, which was read by pkcsslotd to get
   available slot information.

   The pk_config_data configuration file has been replaced with
   /etc/opencryptoki/opencryptoki.conf.

   In version 3, the pkcsslotd daemon reads opencryptoki.conf to get slot
   information. The opencryptoki.conf by default contains slot information
   for each token currently supported by opencryptoki with the exception of
   the ICSF token, which requires some initial setup.
   Please see man page for opencryptoki.conf for further information.

   Since pk_config_data is no longer required, pkcs11_startup and
   pkcs_slotd have been removed.
2016-05-18 17:22:59 +00:00

96 lines
2.7 KiB
Text

--- configure.in.orig 2016-04-29 17:26:45 UTC
+++ configure.in
@@ -6,6 +6,9 @@ AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([foreign 1.6])
+AC_DEFINE(_BSD_SOURCE, 1, BSD functions)
+AC_DEFINE(__BSD_VISIBLE, 1, BSD extensions)
+
dnl Checks for header files.
AC_DISABLE_STATIC
LT_INIT
@@ -25,6 +28,7 @@ AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getcwd])
+AC_CHECK_FUNCS([asprintf])
dnl Used in various scripts
AC_PATH_PROG([ID], [id], [/us/bin/id])
@@ -40,10 +44,16 @@ AC_PROG_YACC
dnl Define custom variables
-lockdir=$localstatedir/lock/opencryptoki
+AC_ARG_WITH([lockdir],
+ [AS_HELP_STRING([--with-lockdir],[lock directory])],
+ [lockdir=$withval],
+ [lockdir=$localstatedir/lock/opencryptoki])
AC_SUBST(lockdir)
-logdir=$localstatedir/log/opencryptoki
+AC_ARG_WITH([logdir],
+ [AS_HELP_STRING([--with-logdir],[log directory])],
+ [logdir=$withval],
+ [logdir=$localstatedir/log/opencryptoki])
AC_SUBST(logdir)
dnl ---
@@ -166,6 +176,21 @@ AC_ARG_WITH([systemd],
[],
[with_systemd=no])
+dnl --- check for pkcs11 user
+AC_ARG_WITH([pkcs11user],
+ AC_HELP_STRING([--with-pkcs11user[[=USER]]], [set pkcs11 user [[pkcs11]]]),
+ [pkcs11_user=$withval],
+ [pkcs11_user=pkcs11])
+
+dnl --- check for pkcs11 group
+AC_ARG_WITH(pkcs11group,
+ AC_HELP_STRING([--with-pkcs11group[[=GROUP]]], [set pkcs11 group [[pkcs11]]]),
+ [pkcs11_group=$withval],
+ [pkcs11_group=pkcs11])
+
+AC_SUBST(PKCS11USER, $pkcs11_user)
+AC_SUBST(PKCS11GROUP, $pkcs11_group)
+
dnl ---
dnl ---
dnl --- Now that we have all the options, let's check for a valid build
@@ -554,13 +579,31 @@ fi
AM_CONDITIONAL([ENABLE_PKCSEP11_MIGRATE], [test "x$enable_pkcsep11_migrate" = "xyes"])
-CFLAGS="$CFLAGS -DPKCS64 -D_XOPEN_SOURCE=600 -Wall -Wno-pointer-sign"
-
-CFLAGS+=' -DCONFIG_PATH=\"$(localstatedir)/lib/opencryptoki\" -DSBIN_PATH=\"$(sbindir)\" -DLIB_PATH=\"$(libdir)\" -DLOCKDIR_PATH=\"$(lockdir)\" -DOCK_CONFDIR=\"$(sysconfdir)/opencryptoki\" -DOCK_LOGDIR=\"$(logdir)\"'
+CFLAGS="$CFLAGS \
+ -Wall \
+ -Wno-pointer-sign \
+"
+CPPFX=' \
+ -DCONFIG_PATH=\"$(localstatedir)/lib/opencryptoki\" \
+ -DSBIN_PATH=\"$(sbindir)\" \
+ -DLIB_PATH=\"$(libdir)\" \
+ -DLOCKDIR_PATH=\"$(lockdir)\" \
+ -DOCK_CONFDIR=\"$(sysconfdir)/opencryptoki\" \
+ -DOCK_LOGDIR=\"$(logdir)\" \
+'
+CPPFLAGS="$CPPFLAGS \
+ -DPKCS64 \
+ -D_XOPEN_SOURCE=600 \
+ $CPPFX \
+ -DPKCS11USER=\\\"${pkcs11_user}\\\" \
+ -DPKCS11GROUP=\\\"${pkcs11_group}\\\" \
+"
# At this point, CFLAGS is set to something sensible
AC_PROG_CC
+AC_SUBST(FPIC, $lt_prog_compiler_pic)
+
AC_CONFIG_FILES([Makefile usr/Makefile \
usr/include/Makefile \
usr/include/pkcs11/Makefile \