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

(Help, please) no way to build the source code on Ubuntu 20... #31

Closed jordigarcia71 closed 3 years ago

jordigarcia71 commented 3 years ago

Good afternoon,

I am pretty lost trying to build the source code on Ubuntu 20... After running 'autoconf' I get many 'undefined macro' messages, as you can see below,

Googling I found that running 'autoreconf -fi' might solve it, there's still a macro error related to AC_MSG_WARN though.

Any help would be much appreciated. Thanks a lot

jordi@jordi-VirtualBox:~/pkcs11-tools-master$ autoconf configure.ac:1: error: possibly undefined macro: dnl If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:20: error: possibly undefined macro: AM_MAINTAINER_MODE configure.ac:38: error: possibly undefined macro: AC_MSG_FAILURE configure.ac:51: error: possibly undefined macro: AC_MSG_WARN configure.ac:60: error: possibly undefined macro: AM_INIT_AUTOMAKE configure.ac:63: error: possibly undefined macro: AM_PROG_AR configure.ac:66: error: possibly undefined macro: AC_PROG_LIBTOOL configure.ac:71: error: possibly undefined macro: AM_CONDITIONAL configure.ac:82: error: possibly undefined macro: AC_CHECK_DECLS configure.ac:98: error: possibly undefined macro: AM_COND_IF configure.ac:102: error: possibly undefined macro: AC_SEARCH_LIBS configure.ac:102: error: possibly undefined macro: AC_MSG_ERROR configure.ac:106: error: possibly undefined macro: AC_CHECK_LIB jordi@jordi-VirtualBox:~/pkcs11-tools-master$

jordi@jordi-VirtualBox:~/pkcs11-tools-master$ autoreconf -fi 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' configure.ac:51: error: possibly undefined macro: AC_MSG_WARN If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/bin/autoconf failed with exit status: 1 jordi@jordi-VirtualBox:~/pkcs11-tools-master$

VERSIONS

jordi@jordi-VirtualBox:~/pkcs11-tools-master$ uname -a Linux jordi-VirtualBox 5.8.0-49-generic #55~20.04.1-Ubuntu SMP Fri Mar 26 01:01:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

jordi@jordi-VirtualBox:~/pkcs11-tools-master$ autoconf --version autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html, http://gnu.org/licenses/exceptions.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

jordi@jordi-VirtualBox:~/pkcs11-tools-master$ m4 --version m4 (GNU M4) 1.4.18 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

keldonin commented 3 years ago

Hi @jordigarcia71 ,

This is likely because you haven't deployed all required dependencies. AC_MSG_WARN is usually an indication that pkg-config or autoconf-archive is not deployed.

Please check https://github.com/Mastercard/pkcs11-tools/blob/master/docs/INSTALL.md#pre-requisites for deploying all pre-requisites (there is a command to deploy the dependencies on Ubuntu),

$ sudo apt-get install autoconf-archive autoconf automake libtool pkg-config

then follow instructions at https://github.com/Mastercard/pkcs11-tools/blob/master/docs/INSTALL.md#installation .

Let me know if you still encounter issues. If that be the case, please post the whole process in this thread, to help resolution.

Thank you,

jordigarcia71 commented 3 years ago

Hi Eric,

Thanks a lot for the very rapid response. You're right that I had not gone through all the pre-requisites. I think I did it well now, however when running 'make install' it responds "**make: * No rule to make target 'install'. Stop."

What may I be missing? Find all my steps on the attachment. Thanks again Error building pkcs11-tools-master.txt

keldonin commented 3 years ago

Hi @jordigarcia71,

it seems you are missing a couple of other dependencies, on Ubuntu:

To install these dependencies, just execute the command:

$ sudo apt-get install libssl-dev bison flex

Try this and let me know of the outcome. If successful, I'll adjust the install page accordingly.

Regards,

jordigarcia71 commented 3 years ago

Hi @keldonin ,

Unfortunately the same message persists, after running the command to install libssl-dev, bison, and flex (even if trying a 'make install' after restarting the system). Any idea? Thank you!

jordi@jordi-VirtualBox:~/pkcs11-tools-master$ sudo apt-get install libssl-dev bison flex [sudo] password for jordi: Reading package lists... Done Building dependency tree
Reading state information... Done The following packages were automatically installed and are no longer required: libfprint-2-tod1 libllvm10 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libfl-dev libfl2 Suggested packages: bison-doc flex-doc libssl-doc The following NEW packages will be installed bison flex libfl-dev libfl2 libssl-dev 0 to upgrade, 5 to newly install, 0 to remove and 97 not to upgrade. Need to get 2.573 kB of archives. After this operation, 11,2 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://es.archive.ubuntu.com/ubuntu focal/main amd64 flex amd64 2.6.4-6.2 [317 kB] Get:2 http://es.archive.ubuntu.com/ubuntu focal/main amd64 bison amd64 2:3.5.1+dfsg-1 [657 kB] Get:3 http://es.archive.ubuntu.com/ubuntu focal/main amd64 libfl2 amd64 2.6.4-6.2 [11,5 kB] Get:4 http://es.archive.ubuntu.com/ubuntu focal/main amd64 libfl-dev amd64 2.6.4-6.2 [6.316 B] Get:5 http://es.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.3 [1.582 kB] Fetched 2.573 kB in 5s (497 kB/s)
Selecting previously unselected package flex. (Reading database ... 215493 files and directories currently installed.) Preparing to unpack .../flex_2.6.4-6.2_amd64.deb ... Unpacking flex (2.6.4-6.2) ... Selecting previously unselected package bison. Preparing to unpack .../bison_2%3a3.5.1+dfsg-1_amd64.deb ... Unpacking bison (2:3.5.1+dfsg-1) ... Selecting previously unselected package libfl2:amd64. Preparing to unpack .../libfl2_2.6.4-6.2_amd64.deb ... Unpacking libfl2:amd64 (2.6.4-6.2) ... Selecting previously unselected package libfl-dev:amd64. Preparing to unpack .../libfl-dev_2.6.4-6.2_amd64.deb ... Unpacking libfl-dev:amd64 (2.6.4-6.2) ... Selecting previously unselected package libssl-dev:amd64. Preparing to unpack .../libssl-dev_1.1.1f-1ubuntu2.3_amd64.deb ... Unpacking libssl-dev:amd64 (1.1.1f-1ubuntu2.3) ... Setting up flex (2.6.4-6.2) ... Setting up libssl-dev:amd64 (1.1.1f-1ubuntu2.3) ... Setting up libfl2:amd64 (2.6.4-6.2) ... Setting up bison (2:3.5.1+dfsg-1) ... update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode Setting up libfl-dev:amd64 (2.6.4-6.2) ... Processing triggers for libc-bin (2.31-0ubuntu9.1) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for install-info (6.7.0.dfsg.2-5) ... jordi@jordi-VirtualBox:~/pkcs11-tools-master$ sudo make install **make: * No rule to make target 'install'. Stop.

keldonin commented 3 years ago

Hi @jordigarcia71,

now you have deployed all dependencies, proceed as follows:

$ ./bootstrap.sh
$ ./configure
$ make
$ sudo make install

Theinstallrule does not imply to build the package, you have to build separately first.

Let me know if you still encounter problems,

jordigarcia71 commented 3 years ago

Hi @keldonin

Just to let you know this time it worked perfectly! Thanks a lot for your very rapid and precise answer :-)

Regards Jordi

keldonin commented 3 years ago

Alright, enjoy the tool!