Mastercard / pkcs11-tools

A set of tools to manage objects on PKCS#11 cryptographic tokens. Compatible with many PKCS#11 library, including major HSM brands, NSS and softoken.
Other
162 stars 33 forks source link

Failing compilation on Ubuntu 22.04 #49

Closed d3cxxxx closed 1 year ago

d3cxxxx commented 1 year ago

Describe the bug The first step in building this software, ./bootstrap.sh fails with issues pointing to the configuration files.

Operating System (please complete the following information):

Additional context Output from running the command:

/pkcs11-tools$ ./bootstrap.sh Module list with included dependencies (indented): absolute-header attribute btowc builtin-expect byteswap c99 calloc-gnu calloc-posix dynarray errno extensions extern-inline fd-hook free-posix getdelim gethostname getline getopt-gnu getopt-posix gettext-h hard-locale include_next intprops inttypes-incomplete langinfo libc-config limits-h localcharset locale localeconv lock malloc-gnu malloc-posix mbrtowc mbsinit mbtowc msvc-inval msvc-nothrow multiarch nl_langinfo nocrash realloc-gnu realloc-posix regex setlocale-null snippet/_Noreturn snippet/arg-nonnull snippet/c++defs snippet/warn-on-use socketlib sockets socklen ssize_t std-gnu11 stdalign stdbool stddef stdint stdio stdlib strcase streq string strings sys_socket sys_types sys_uio sysexits termios threadlib time unistd vararrays verify wchar wcrtomb wctype-h windows-mutex windows-once windows-recmutex windows-rwlock xalloc-oversized File list: lib/_Noreturn.h lib/arg-nonnull.h lib/attribute.h lib/btowc.c lib/byteswap.in.h lib/c++defs.h lib/calloc.c lib/cdefs.h lib/dynarray.h lib/errno.in.h lib/fd-hook.c lib/fd-hook.h lib/free.c lib/getdelim.c lib/gethostname.c lib/getline.c lib/getopt-cdefs.in.h lib/getopt-core.h lib/getopt-ext.h lib/getopt-pfx-core.h lib/getopt-pfx-ext.h lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h lib/gettext.h lib/glthread/lock.c lib/glthread/lock.h lib/glthread/threadlib.c lib/hard-locale.c lib/hard-locale.h lib/intprops.h lib/inttypes.in.h lib/langinfo.in.h lib/lc-charset-dispatch.c lib/lc-charset-dispatch.h lib/libc-config.h lib/limits.in.h lib/localcharset.c lib/localcharset.h lib/locale.in.h lib/localeconv.c lib/malloc.c lib/malloc/dynarray-skeleton.c lib/malloc/dynarray.h lib/malloc/dynarray_at_failure.c lib/malloc/dynarray_emplace_enlarge.c lib/malloc/dynarray_finalize.c lib/malloc/dynarray_resize.c lib/malloc/dynarray_resize_clear.c lib/mbrtowc-impl-utf8.h lib/mbrtowc-impl.h lib/mbrtowc.c lib/mbsinit.c lib/mbtowc-impl.h lib/mbtowc-lock.c lib/mbtowc-lock.h lib/mbtowc.c lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c lib/msvc-nothrow.h lib/nl_langinfo-lock.c lib/nl_langinfo.c lib/realloc.c lib/regcomp.c lib/regex.c lib/regex.h lib/regex_internal.c lib/regex_internal.h lib/regexec.c lib/setlocale-lock.c lib/setlocale_null.c lib/setlocale_null.h lib/sockets.c lib/sockets.h lib/stdalign.in.h lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h lib/stdio.in.h lib/stdlib.in.h lib/strcasecmp.c lib/streq.h lib/string.in.h lib/strings.in.h lib/strncasecmp.c lib/sys_socket.c lib/sys_socket.in.h lib/sys_types.in.h lib/sys_uio.in.h lib/sysexits.in.h lib/termios.in.h lib/time.in.h lib/unistd.c lib/unistd.in.h lib/verify.h lib/w32sock.h lib/warn-on-use.h lib/wchar.in.h lib/wcrtomb.c lib/wctype-h.c lib/wctype.in.h lib/windows-initguard.h lib/windows-mutex.c lib/windows-mutex.h lib/windows-once.c lib/windows-once.h lib/windows-recmutex.c lib/windows-recmutex.h lib/windows-rwlock.c lib/windows-rwlock.h lib/xalloc-oversized.h m4/00gnulib.m4 m4/__inline.m4 m4/absolute-header.m4 m4/btowc.m4 m4/builtin-expect.m4 m4/byteswap.m4 m4/calloc.m4 m4/codeset.m4 m4/eealloc.m4 m4/errno_h.m4 m4/extensions.m4 m4/extern-inline.m4 m4/free.m4 m4/getdelim.m4 m4/gethostname.m4 m4/getline.m4 m4/getopt.m4 m4/gnulib-common.m4 m4/include_next.m4 m4/inttypes.m4 m4/langinfo_h.m4 m4/limits-h.m4 m4/localcharset.m4 m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-zh.m4 m4/locale_h.m4 m4/localeconv.m4 m4/lock.m4 m4/malloc.m4 m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbstate_t.m4 m4/mbtowc.m4 m4/msvc-inval.m4 m4/msvc-nothrow.m4 m4/multiarch.m4 m4/nl_langinfo.m4 m4/nocrash.m4 m4/off_t.m4 m4/pid_t.m4 m4/pthread_rwlock_rdlock.m4 m4/realloc.m4 m4/regex.m4 m4/setlocale_null.m4 m4/socketlib.m4 m4/sockets.m4 m4/socklen.m4 m4/sockpfaf.m4 m4/ssize_t.m4 m4/std-gnu11.m4 m4/stdalign.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdio_h.m4 m4/stdlib_h.m4 m4/strcase.m4 m4/string_h.m4 m4/strings_h.m4 m4/sys_socket_h.m4 m4/sys_types_h.m4 m4/sys_uio_h.m4 m4/sysexits.m4 m4/termios_h.m4 m4/threadlib.m4 m4/time_h.m4 m4/unistd_h.m4 m4/vararrays.m4 m4/visibility.m4 m4/warn-on-use.m4 m4/wchar_h.m4 m4/wchar_t.m4 m4/wcrtomb.m4 m4/wctype_h.m4 m4/wint_t.m4 m4/zzgnulib.m4 Finished.

You may need to add #include directives for the following .h files.

include

include

include

include

include

include

include

include

include

include

You may need to use the following Makefile variables when linking. Use them in _LDADD when linking a program, or in _a_LDFLAGS or _la_LDFLAGS when linking a library. $(GETHOSTNAME_LIB) $(LIBSOCKET) $(LIBTHREAD) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_SETLOCALE_NULL) $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

Don't forget to

  • add "gl/Makefile" to AC_CONFIG_FILES in ./configure.ac,
  • mention "gl" in SUBDIRS in Makefile.am,
  • mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am,
  • mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
  • invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
  • invoke gl_INIT in ./configure.ac. autoreconf: export WARNINGS= autoreconf: Entering directory '.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' autoreconf: configure.ac: not using Intltool autoreconf: configure.ac: not using Gtkdoc autoreconf: running: aclocal --force -I m4 autoreconf: running: /usr/bin/autoconf --force configure.ac:37: warning: AC_PROG_CC_C99 is obsolete; use AC_PROG_CC configure.ac:40: warning: ac_ext=c configure.ac:40: ac_cpp='$CPP $CPPFLAGS' configure.ac:40: ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' configure.ac:40: ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' configure.ac:40: ac_compiler_gnu=$ac_cv_c_compiler_gnu configure.ac:40: if test -n "$ac_tool_prefix"; then configure.ac:40: # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. configure.ac:40: set dummy ${ac_tool_prefix}gcc; ac_word=$2 configure.ac:40: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 configure.ac:40: printf %s "checking for $ac_word... " >&6; } configure.ac:40: if test ${ac_cv_prog_CC+y} configure.ac:40: then : configure.ac:40: printf %s "(cached) " >&6 configure.ac:40: else $as_nop configure.ac:40: if test -n "$CC"; then configure.ac:40: ac_cv_prog_CC="$CC" # Let the user override the test. configure.ac:40: else configure.ac:40: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR configure.ac:40: for as_dir in $PATH configure.ac:40: do configure.ac:40: IFS=$as_save_IFS configure.ac:40: case $as_dir in #((( configure.ac:40: '' is m4_require'd but not m4_defun'd lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/programs.m4:41: _AC_CHECK_PROG is expanded from... ./lib/autoconf/programs.m4:101: AC_CHECK_PROG is expanded from... ./lib/autoconf/programs.m4:221: AC_CHECK_TOOL is expanded from... ./lib/autoconf/c.m4:452: AC_PROG_CC is expanded from... configure.ac:40: the top level configure.ac:46: warning: ac_ext=c configure.ac:46: ac_cpp='$CPP $CPPFLAGS' configure.ac:46: ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' configure.ac:46: ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' configure.ac:46: ac_compiler_gnu=$ac_cv_c_compiler_gnu configure.ac:46: if test -n "$ac_tool_prefix"; then configure.ac:46: # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. configure.ac:46: set dummy ${ac_tool_prefix}gcc; ac_word=$2 configure.ac:46: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 configure.ac:46: printf %s "checking for $ac_word... " >&6; } configure.ac:46: if test ${ac_cv_prog_CC+y} configure.ac:46: then : configure.ac:46: printf %s "(cached) " >&6 configure.ac:46: else $as_nop configure.ac:46: if test -n "$CC"; then configure.ac:46: ac_cv_prog_CC="$CC" # Let the user override the test. configure.ac:46: else configure.ac:46: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR configure.ac:46: for as_dir in $PATH configure.ac:46: do configure.ac:46: IFS=$as_save_IFS configure.ac:46: case $as_dir in #((( configure.ac:46: '' is m4_require'd but not m4_defun'd lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/programs.m4:41: _AC_CHECK_PROG is expanded from... ./lib/autoconf/programs.m4:101: AC_CHECK_PROG is expanded from... ./lib/autoconf/programs.m4:221: AC_CHECK_TOOL is expanded from... ./lib/autoconf/c.m4:452: AC_PROG_CC is expanded from... configure.ac:46: the top level configure.ac:55: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete ./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from... ./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from... aclocal.m4:1041: AM_PROG_LEX is expanded from... configure.ac:55: the top level configure.ac:72: warning: The macro 'AC_PROG_LIBTOOL' is obsolete. configure.ac:72: You should run autoupdate. m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from... configure.ac:72: the top level configure.ac:214: warning: The macro 'AC_CANONICAL_SYSTEM' is obsolete. configure.ac:214: You should run autoupdate. ./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from... m4/ax_create_target_h.m4:473: AC_CANONICAL_CPU_ARCH is expanded from... m4/ax_create_target_h.m4:93: AX_CREATE_TARGET_H is expanded from... configure.ac:214: the top level configure.ac:34: error: possibly undefined macro: AC_PROG_CC If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:38: error: possibly undefined macro: AC_PROG_CC_C99 configure.ac:57: error: possibly undefined macro: AC_MSG_WARN autoreconf: error: /usr/bin/autoconf failed with exit status: 1

/pkcs11-tools$

keldonin commented 1 year ago

Hi @d3c1978 ,

this seems to be a duplicate of #46. Please consult resolution and let us know if that solves your issue.

d3cxxxx commented 1 year ago

That did solve the issue. Thank you. Can this step be added to the Instructions in the Readme to make it easier for users to not run into this issue?

keldonin commented 1 year ago

Thanks for the suggestion, @d3c1978. We will adapt accordingly.