Перейти к содержанию

Компиляция и установка программ из исходников

1. Устанавливаем требуемые компонеты

Для Debian

apt install build-essential automake autoconf

root@server:/var/git/bgpq4# apt install build-essential automake autoconf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-8 dirmngr dpkg-dev fakeroot g++ g++-8 gcc gcc-8 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libassuan0 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-8-dev libgomp1 libisl19 libitm1 libksba8 liblsan0
  libmpc3 libmpfr6 libmpx2 libnpth0 libsigsegv2 libstdc++-8-dev libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev pinentry-curses
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc libtool gettext binutils-doc cpp-doc gcc-8-locales dbus-user-session pinentry-gnome3 tor debian-keyring g++-multilib g++-8-multilib gcc-8-doc libstdc++6-8-dbg gcc-multilib flex bison gdb
  gcc-doc gcc-8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg parcimonie xloadimage scdaemon glibc-doc bzr libstdc++-8-doc m4-doc make-doc
  pinentry-doc
yThe following NEW packages will be installed:
  autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-8 dirmngr dpkg-dev fakeroot g++ g++-8 gcc gcc-8 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server
  gpgconf gpgsm libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libassuan0 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-8-dev libgomp1
  libisl19 libitm1 libksba8 liblsan0 libmpc3 libmpfr6 libmpx2 libnpth0 libsigsegv2 libstdc++-8-dev libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev pinentry-curses
0 upgraded, 57 newly installed, 0 to remove and 0 not upgraded.
Need to get 57.8 MB of archives.
After this operation, 204 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://deb.debian.org/debian buster/main amd64 libsigsegv2 amd64 2.12-2 [32.8 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 m4 amd64 1.4.18-2 [203 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 autoconf all 2.69-11 [341 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 autotools-dev all 20180224.1 [77.0 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 automake all 1:1.16.1-4 [771 kB]
Get:6 http://deb.debian.org/debian buster/main amd64 binutils-common amd64 2.31.1-16 [2,073 kB]
Get:7 http://deb.debian.org/debian buster/main amd64 libbinutils amd64 2.31.1-16 [478 kB]
Get:8 http://deb.debian.org/debian buster/main amd64 binutils-x86-64-linux-gnu amd64 2.31.1-16 [1,823 kB]
Get:9 http://deb.debian.org/debian buster/main amd64 binutils amd64 2.31.1-16 [56.8 kB]
Get:10 http://deb.debian.org/debian buster/main amd64 libc-dev-bin amd64 2.28-10 [275 kB]
Get:11 http://deb.debian.org/debian buster/main amd64 linux-libc-dev amd64 4.19.194-1 [1,459 kB]
Get:12 http://deb.debian.org/debian buster/main amd64 libc6-dev amd64 2.28-10 [2,691 kB]
Get:13 http://deb.debian.org/debian buster/main amd64 libisl19 amd64 0.20-2 [587 kB]
Get:14 http://deb.debian.org/debian buster/main amd64 libmpfr6 amd64 4.0.2-1 [775 kB]
Get:15 http://deb.debian.org/debian buster/main amd64 libmpc3 amd64 1.1.0-1 [41.3 kB]
Get:16 http://deb.debian.org/debian buster/main amd64 cpp-8 amd64 8.3.0-6 [8,914 kB]
Get:17 http://deb.debian.org/debian buster/main amd64 cpp amd64 4:8.3.0-1 [19.4 kB]
Get:18 http://deb.debian.org/debian buster/main amd64 libcc1-0 amd64 8.3.0-6 [46.6 kB]
Get:19 http://deb.debian.org/debian buster/main amd64 libgomp1 amd64 8.3.0-6 [75.8 kB]
Get:20 http://deb.debian.org/debian buster/main amd64 libitm1 amd64 8.3.0-6 [27.7 kB]
Get:21 http://deb.debian.org/debian buster/main amd64 libatomic1 amd64 8.3.0-6 [9,032 B]
Get:22 http://deb.debian.org/debian buster/main amd64 libasan5 amd64 8.3.0-6 [362 kB]
Get:23 http://deb.debian.org/debian buster/main amd64 liblsan0 amd64 8.3.0-6 [131 kB]
Get:24 http://deb.debian.org/debian buster/main amd64 libtsan0 amd64 8.3.0-6 [283 kB]
Get:25 http://deb.debian.org/debian buster/main amd64 libubsan1 amd64 8.3.0-6 [120 kB]
Get:26 http://deb.debian.org/debian buster/main amd64 libmpx2 amd64 8.3.0-6 [11.4 kB]
Get:27 http://deb.debian.org/debian buster/main amd64 libgcc-8-dev amd64 8.3.0-6 [2,298 kB]
Get:28 http://deb.debian.org/debian buster/main amd64 gcc-8 amd64 8.3.0-6 [9,452 kB]
Get:29 http://deb.debian.org/debian buster/main amd64 gcc amd64 4:8.3.0-1 [5,196 B]
Get:30 http://deb.debian.org/debian buster/main amd64 libstdc++-8-dev amd64 8.3.0-6 [1,532 kB]
Get:31 http://deb.debian.org/debian buster/main amd64 g++-8 amd64 8.3.0-6 [9,752 kB]
Get:32 http://deb.debian.org/debian buster/main amd64 g++ amd64 4:8.3.0-1 [1,644 B]
Get:33 http://deb.debian.org/debian buster/main amd64 make amd64 4.2.1-1.2 [341 kB]
Get:34 http://deb.debian.org/debian buster/main amd64 libdpkg-perl all 1.19.7 [1,414 kB]
Get:35 http://deb.debian.org/debian buster/main amd64 dpkg-dev all 1.19.7 [1,773 kB]
Get:36 http://deb.debian.org/debian buster/main amd64 build-essential amd64 12.6 [7,576 B]
Get:37 http://deb.debian.org/debian buster/main amd64 libassuan0 amd64 2.5.2-1 [49.4 kB]
Get:38 http://deb.debian.org/debian buster/main amd64 gpgconf amd64 2.2.12-1+deb10u1 [510 kB]
Get:39 http://deb.debian.org/debian buster/main amd64 libksba8 amd64 1.3.5-2 [99.7 kB]
Get:40 http://deb.debian.org/debian buster/main amd64 libnpth0 amd64 1.6-1 [18.4 kB]
Get:41 http://deb.debian.org/debian buster/main amd64 dirmngr amd64 2.2.12-1+deb10u1 [712 kB]
Get:42 http://deb.debian.org/debian buster/main amd64 libfakeroot amd64 1.23-1 [45.9 kB]
Get:43 http://deb.debian.org/debian buster/main amd64 fakeroot amd64 1.23-1 [85.8 kB]
Get:44 http://deb.debian.org/debian buster/main amd64 gnupg-l10n all 2.2.12-1+deb10u1 [1,010 kB]
Get:45 http://deb.debian.org/debian buster/main amd64 gnupg-utils amd64 2.2.12-1+deb10u1 [861 kB]
Get:46 http://deb.debian.org/debian buster/main amd64 gpg amd64 2.2.12-1+deb10u1 [865 kB]
Get:47 http://deb.debian.org/debian buster/main amd64 pinentry-curses amd64 1.1.0-2 [64.5 kB]
Get:48 http://deb.debian.org/debian buster/main amd64 gpg-agent amd64 2.2.12-1+deb10u1 [617 kB]
Get:49 http://deb.debian.org/debian buster/main amd64 gpg-wks-client amd64 2.2.12-1+deb10u1 [485 kB]
Get:50 http://deb.debian.org/debian buster/main amd64 gpg-wks-server amd64 2.2.12-1+deb10u1 [478 kB]
Get:51 http://deb.debian.org/debian buster/main amd64 gpgsm amd64 2.2.12-1+deb10u1 [604 kB]
Get:52 http://deb.debian.org/debian buster/main amd64 gnupg all 2.2.12-1+deb10u1 [715 kB]
Get:53 http://deb.debian.org/debian buster/main amd64 libalgorithm-diff-perl all 1.19.03-2 [47.9 kB]
Get:54 http://deb.debian.org/debian buster/main amd64 libalgorithm-diff-xs-perl amd64 0.04-5+b1 [11.8 kB]
Get:55 http://deb.debian.org/debian buster/main amd64 libalgorithm-merge-perl all 0.08-3 [12.7 kB]
Get:56 http://deb.debian.org/debian buster/main amd64 libfile-fcntllock-perl amd64 0.22-3+b5 [35.4 kB]
Get:57 http://deb.debian.org/debian buster/main amd64 manpages-dev all 4.16-2 [2,232 kB]
Fetched 57.8 MB in 6s (9,133 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 35605 files and directories currently installed.)
Preparing to unpack .../00-libsigsegv2_2.12-2_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.12-2) ...
Selecting previously unselected package m4.
Preparing to unpack .../01-m4_1.4.18-2_amd64.deb ...
Unpacking m4 (1.4.18-2) ...
Selecting previously unselected package autoconf.
Preparing to unpack .../02-autoconf_2.69-11_all.deb ...
Unpacking autoconf (2.69-11) ...
Selecting previously unselected package autotools-dev.
Preparing to unpack .../03-autotools-dev_20180224.1_all.deb ...
Unpacking autotools-dev (20180224.1) ...
Selecting previously unselected package automake.
Preparing to unpack .../04-automake_1%3a1.16.1-4_all.deb ...
Unpacking automake (1:1.16.1-4) ...
Selecting previously unselected package binutils-common:amd64.
Preparing to unpack .../05-binutils-common_2.31.1-16_amd64.deb ...
Unpacking binutils-common:amd64 (2.31.1-16) ...
Selecting previously unselected package libbinutils:amd64.
Preparing to unpack .../06-libbinutils_2.31.1-16_amd64.deb ...
Unpacking libbinutils:amd64 (2.31.1-16) ...
Selecting previously unselected package binutils-x86-64-linux-gnu.
Preparing to unpack .../07-binutils-x86-64-linux-gnu_2.31.1-16_amd64.deb ...
Unpacking binutils-x86-64-linux-gnu (2.31.1-16) ...
Selecting previously unselected package binutils.
Preparing to unpack .../08-binutils_2.31.1-16_amd64.deb ...
Unpacking binutils (2.31.1-16) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../09-libc-dev-bin_2.28-10_amd64.deb ...
Unpacking libc-dev-bin (2.28-10) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../10-linux-libc-dev_4.19.194-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.19.194-1) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../11-libc6-dev_2.28-10_amd64.deb ...
Unpacking libc6-dev:amd64 (2.28-10) ...
Selecting previously unselected package libisl19:amd64.
Preparing to unpack .../12-libisl19_0.20-2_amd64.deb ...
Unpacking libisl19:amd64 (0.20-2) ...
Selecting previously unselected package libmpfr6:amd64.
Preparing to unpack .../13-libmpfr6_4.0.2-1_amd64.deb ...
Unpacking libmpfr6:amd64 (4.0.2-1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../14-libmpc3_1.1.0-1_amd64.deb ...
Unpacking libmpc3:amd64 (1.1.0-1) ...
Selecting previously unselected package cpp-8.
Preparing to unpack .../15-cpp-8_8.3.0-6_amd64.deb ...
Unpacking cpp-8 (8.3.0-6) ...
Selecting previously unselected package cpp.
Preparing to unpack .../16-cpp_4%3a8.3.0-1_amd64.deb ...
Unpacking cpp (4:8.3.0-1) ...
Selecting previously unselected package libcc1-0:amd64.
Preparing to unpack .../17-libcc1-0_8.3.0-6_amd64.deb ...
Unpacking libcc1-0:amd64 (8.3.0-6) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../18-libgomp1_8.3.0-6_amd64.deb ...
Unpacking libgomp1:amd64 (8.3.0-6) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../19-libitm1_8.3.0-6_amd64.deb ...
Unpacking libitm1:amd64 (8.3.0-6) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../20-libatomic1_8.3.0-6_amd64.deb ...
Unpacking libatomic1:amd64 (8.3.0-6) ...
Selecting previously unselected package libasan5:amd64.
Preparing to unpack .../21-libasan5_8.3.0-6_amd64.deb ...
Unpacking libasan5:amd64 (8.3.0-6) ...
Selecting previously unselected package liblsan0:amd64.
Preparing to unpack .../22-liblsan0_8.3.0-6_amd64.deb ...
Unpacking liblsan0:amd64 (8.3.0-6) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../23-libtsan0_8.3.0-6_amd64.deb ...
Unpacking libtsan0:amd64 (8.3.0-6) ...
Selecting previously unselected package libubsan1:amd64.
Preparing to unpack .../24-libubsan1_8.3.0-6_amd64.deb ...
Unpacking libubsan1:amd64 (8.3.0-6) ...
Selecting previously unselected package libmpx2:amd64.
Preparing to unpack .../25-libmpx2_8.3.0-6_amd64.deb ...
Unpacking libmpx2:amd64 (8.3.0-6) ...
Selecting previously unselected package libgcc-8-dev:amd64.
Preparing to unpack .../26-libgcc-8-dev_8.3.0-6_amd64.deb ...
Unpacking libgcc-8-dev:amd64 (8.3.0-6) ...
Selecting previously unselected package gcc-8.
Preparing to unpack .../27-gcc-8_8.3.0-6_amd64.deb ...
Unpacking gcc-8 (8.3.0-6) ...
Selecting previously unselected package gcc.
Preparing to unpack .../28-gcc_4%3a8.3.0-1_amd64.deb ...
Unpacking gcc (4:8.3.0-1) ...
Selecting previously unselected package libstdc++-8-dev:amd64.
Preparing to unpack .../29-libstdc++-8-dev_8.3.0-6_amd64.deb ...
Unpacking libstdc++-8-dev:amd64 (8.3.0-6) ...
Selecting previously unselected package g++-8.
Preparing to unpack .../30-g++-8_8.3.0-6_amd64.deb ...
Unpacking g++-8 (8.3.0-6) ...
Selecting previously unselected package g++.
Preparing to unpack .../31-g++_4%3a8.3.0-1_amd64.deb ...
Unpacking g++ (4:8.3.0-1) ...
Selecting previously unselected package make.
Preparing to unpack .../32-make_4.2.1-1.2_amd64.deb ...
Unpacking make (4.2.1-1.2) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../33-libdpkg-perl_1.19.7_all.deb ...
Unpacking libdpkg-perl (1.19.7) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../34-dpkg-dev_1.19.7_all.deb ...
Unpacking dpkg-dev (1.19.7) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../35-build-essential_12.6_amd64.deb ...
Unpacking build-essential (12.6) ...
Selecting previously unselected package libassuan0:amd64.
Preparing to unpack .../36-libassuan0_2.5.2-1_amd64.deb ...
Unpacking libassuan0:amd64 (2.5.2-1) ...
Selecting previously unselected package gpgconf.
Preparing to unpack .../37-gpgconf_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gpgconf (2.2.12-1+deb10u1) ...
Selecting previously unselected package libksba8:amd64.
Preparing to unpack .../38-libksba8_1.3.5-2_amd64.deb ...
Unpacking libksba8:amd64 (1.3.5-2) ...
Selecting previously unselected package libnpth0:amd64.
Preparing to unpack .../39-libnpth0_1.6-1_amd64.deb ...
Unpacking libnpth0:amd64 (1.6-1) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../40-dirmngr_2.2.12-1+deb10u1_amd64.deb ...
Unpacking dirmngr (2.2.12-1+deb10u1) ...
Selecting previously unselected package libfakeroot:amd64.
Preparing to unpack .../41-libfakeroot_1.23-1_amd64.deb ...
Unpacking libfakeroot:amd64 (1.23-1) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../42-fakeroot_1.23-1_amd64.deb ...
Unpacking fakeroot (1.23-1) ...
Selecting previously unselected package gnupg-l10n.
Preparing to unpack .../43-gnupg-l10n_2.2.12-1+deb10u1_all.deb ...
Unpacking gnupg-l10n (2.2.12-1+deb10u1) ...
Selecting previously unselected package gnupg-utils.
Preparing to unpack .../44-gnupg-utils_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gnupg-utils (2.2.12-1+deb10u1) ...
Selecting previously unselected package gpg.
Preparing to unpack .../45-gpg_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gpg (2.2.12-1+deb10u1) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../46-pinentry-curses_1.1.0-2_amd64.deb ...
Unpacking pinentry-curses (1.1.0-2) ...
Selecting previously unselected package gpg-agent.
Preparing to unpack .../47-gpg-agent_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gpg-agent (2.2.12-1+deb10u1) ...
Selecting previously unselected package gpg-wks-client.
Preparing to unpack .../48-gpg-wks-client_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gpg-wks-client (2.2.12-1+deb10u1) ...
Selecting previously unselected package gpg-wks-server.
Preparing to unpack .../49-gpg-wks-server_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gpg-wks-server (2.2.12-1+deb10u1) ...
Selecting previously unselected package gpgsm.
Preparing to unpack .../50-gpgsm_2.2.12-1+deb10u1_amd64.deb ...
Unpacking gpgsm (2.2.12-1+deb10u1) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../51-gnupg_2.2.12-1+deb10u1_all.deb ...
Unpacking gnupg (2.2.12-1+deb10u1) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../52-libalgorithm-diff-perl_1.19.03-2_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-2) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../53-libalgorithm-diff-xs-perl_0.04-5+b1_amd64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-5+b1) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../54-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../55-libfile-fcntllock-perl_0.22-3+b5_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3+b5) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../56-manpages-dev_4.16-2_all.deb ...
Unpacking manpages-dev (4.16-2) ...
Setting up libksba8:amd64 (1.3.5-2) ...
Setting up manpages-dev (4.16-2) ...
Setting up libfile-fcntllock-perl (0.22-3+b5) ...
Setting up libalgorithm-diff-perl (1.19.03-2) ...
Setting up binutils-common:amd64 (2.31.1-16) ...
Setting up linux-libc-dev:amd64 (4.19.194-1) ...
Setting up libnpth0:amd64 (1.6-1) ...
Setting up libassuan0:amd64 (2.5.2-1) ...
Setting up libgomp1:amd64 (8.3.0-6) ...
Setting up libfakeroot:amd64 (1.23-1) ...
Setting up fakeroot (1.23-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libasan5:amd64 (8.3.0-6) ...
Setting up autotools-dev (20180224.1) ...
Setting up make (4.2.1-1.2) ...
Setting up libmpfr6:amd64 (4.0.2-1) ...
Setting up gnupg-l10n (2.2.12-1+deb10u1) ...
Setting up libsigsegv2:amd64 (2.12-2) ...
Setting up libmpc3:amd64 (1.1.0-1) ...
Setting up libatomic1:amd64 (8.3.0-6) ...
Setting up libdpkg-perl (1.19.7) ...
Setting up libmpx2:amd64 (8.3.0-6) ...
Setting up libubsan1:amd64 (8.3.0-6) ...
Setting up libisl19:amd64 (0.20-2) ...
Setting up gpgconf (2.2.12-1+deb10u1) ...
Setting up libbinutils:amd64 (2.31.1-16) ...
Setting up cpp-8 (8.3.0-6) ...
Setting up libc-dev-bin (2.28-10) ...
Setting up libalgorithm-diff-xs-perl (0.04-5+b1) ...
Setting up libcc1-0:amd64 (8.3.0-6) ...
Setting up gpg (2.2.12-1+deb10u1) ...
Setting up liblsan0:amd64 (8.3.0-6) ...
Setting up libitm1:amd64 (8.3.0-6) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up gnupg-utils (2.2.12-1+deb10u1) ...
Setting up binutils-x86-64-linux-gnu (2.31.1-16) ...
Setting up libtsan0:amd64 (8.3.0-6) ...
Setting up pinentry-curses (1.1.0-2) ...
Setting up gpg-agent (2.2.12-1+deb10u1) ...
Setting up gpgsm (2.2.12-1+deb10u1) ...
Setting up m4 (1.4.18-2) ...
Setting up binutils (2.31.1-16) ...
Setting up dpkg-dev (1.19.7) ...
Setting up dirmngr (2.2.12-1+deb10u1) ...
Setting up libgcc-8-dev:amd64 (8.3.0-6) ...
Setting up autoconf (2.69-11) ...
Setting up gpg-wks-server (2.2.12-1+deb10u1) ...
Setting up cpp (4:8.3.0-1) ...
Setting up libc6-dev:amd64 (2.28-10) ...
Setting up libstdc++-8-dev:amd64 (8.3.0-6) ...
Setting up automake (1:1.16.1-4) ...
update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode
Setting up gcc-8 (8.3.0-6) ...
Setting up gpg-wks-client (2.2.12-1+deb10u1) ...
Setting up gcc (4:8.3.0-1) ...
Setting up g++-8 (8.3.0-6) ...
Setting up gnupg (2.2.12-1+deb10u1) ...
Setting up g++ (4:8.3.0-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.6) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...



2. Сакчиваем, распоковываем исходные файлы...

Если исходный дистрибутив лежит на git-е, то скачиваем к себе этот git-репозиторий отдельно

git clone "адрес проекта"

Пример для проекта bgpq4

git clone https://github.com/bgp/bgpq4

Cloning into 'bgpq4'...
remote: Enumerating objects: 1310, done.
remote: Counting objects: 100% (1310/1310), done.
remote: Compressing objects: 100% (377/377), done.
remote: Total 1310 (delta 971), reused 1250 (delta 928), pack-reused 0
Receiving objects: 100% (1310/1310), 307.17 KiB | 1.06 MiB/s, done.
Resolving deltas: 100% (971/971), done.
-----------------------------------------------------------
root@server:/var/git# ls -la
total 12
drwxr-xr-x  3 root root 4096 Aug 12 03:20 .
drwxr-xr-x 13 root root 4096 Aug 12 03:19 ..
drwxr-xr-x  4 root root 4096 Aug 12 03:20 bgpq4

3. Собираем конфигуратор ("конфигурация конфигуратора")

Для сборки программ в GNU/Linux используется (в основном) программа make, которая запускает инструкции из Makefile, но поскольку дистрибутивов GNU/Linux много, и они все разные, то для того чтобы собрать программу, нужно для каждого дистрибутива отдельно прописывать пути,где какие лежат библиотеки и заголовочные файлы. Программисты не могут изучать каждый дистрибутив и для каждого отдельно создавать Makefile.

Поэтому придумали конфигураторы, которые «изучают» систему, и в соответствии с полученными знаниями создают Makefile.

Но на конфигураторе они не остановились и придумали конфигураторы конфигураторов...

./bootstrap

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:7: installing './compile'
configure.ac:2: installing './install-sh'
configure.ac:2: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'

3. Запускаем конфигуратор ("конфигурация конфигуратора")

./configure

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking sys/queue.h usability... yes
checking sys/queue.h presence... yes
checking for sys/queue.h... yes
checking sys/tree.h usability... no
checking sys/tree.h presence... no
checking for sys/tree.h... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for STAILQ_ interface in queue.h... yes
checking for strlcpy... no
checking for pledge... no
checking for socket in -lsocket... no
checking for getaddrinfo in -lnsl... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands

4. Компилируем

Собирает из исходников (компилирует) необходимые для работы программы файлы

make

root@server:/var/git/bgpq4# 
make  all-am
make[1]: Entering directory '/var/git/bgpq4'
  CC       bgpq4.o
  CC       bgpq4_printer.o
  CC       bgpq_expander.o
  CC       expander_freeall.o
  CC       strlcpy.o
  CC       sx_maxsockbuf.o
  CC       sx_prefix.o
  CC       sx_report.o
  CC       sx_slentry.o
  CCLD     bgpq4
make[1]: Leaving directory '/var/git/bgpq4'

4. Устанавиливаем

Раскидывает скомпилированные файлы/библиотеки по нужным директориям.

make install

make[1]: Entering directory '/var/git/bgpq4'
 /usr/bin/mkdir -p '/usr/local/bin'
  /usr/bin/install -c bgpq4 '/usr/local/bin'
 /usr/bin/mkdir -p '/usr/local/share/man/man8'
 /usr/bin/install -c -m 644 bgpq4.8 '/usr/local/share/man/man8'
make[1]: Leaving directory '/var/git/bgpq4'

5. Запускаем готовый файл

Программа установлена и готова к работе

bgpq4

Usage: bgpq4 [-h host[:port]] [-S sources] [-E|G <num>|f <num>|t] [-46ABbdJjKNnwXz] [-R len] <OBJECTS> ... [EXCEPT <OBJECTS> ...]

Vendor targets:
 no option : Cisco IOS Classic (default)
 -X        : Cisco IOS XR
 -U        : Huawei
 -j        : JSON
 -J        : Juniper Junos
 -K        : MikroTik RouterOS
 -b        : NIC.CZ BIRD
 -N        : Nokia SR OS (Classic CLI)
 -n        : Nokia SR OS (MD-CLI)
 -B        : OpenBSD OpenBGPD
 -e        : Arista EOS
 -F fmt    : User defined format (example: '-F %n/%l')

Input filters:
 -4        : generate IPv4 prefix-lists (default)
 -6        : generate IPv6 prefix-lists
 -m len    : maximum prefix length (default: 32 for IPv4, 128 for IPv6)
 -L depth  : limit recursion depth (default: unlimited)
 -S sources: only use specified IRR sources, in the specified order (comma separated)
 -w        : 'validate' AS numbers: accept only ones with registered routes

Output modifiers:
 -A        : try to aggregate prefix-lists/route-filters
 -E        : generate extended access-list (Cisco), route-filter (Juniper)
             [ip|ipv6]-prefix-list (Nokia) or prefix-set (OpenBGPD)
 -f number : generate input as-path access-list
 -G number : generate output as-path access-list
 -M match  : extra match conditions for JunOS route-filters
 -l name   : use specified name for generated access/prefix/.. list
 -R len    : allow more specific routes up to specified masklen
 -r len    : allow more specific routes from masklen specified
 -s        : generate sequence numbers in prefix-lists (IOS only)
 -t        : generate as-sets for OpenBGPD (OpenBGPD 6.4+), BIRD and JSON formats
 -z        : generate route-filter-list (Junos only)
 -W len    : specify max-entries on as-path line (use 0 for infinity)

Utility operations:
 -d        : generate some debugging output
 -h host   : host running IRRD software (default: rr.ntt.net)
             use 'host:port' to specify alternate port
 -T        : disable pipelining (not recommended)
 -v        : print version and exit

bgpq4 version: 0.0.7 (https://github.com/bgp/bgpq4)

Литература


Последнее обновление: 2026-02-22