Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-developer:toolchain:install-buildsystem [2021/10/15 10:15] – [Build system setup] spelling vgaeteradocs:guide-developer:toolchain:install-buildsystem [2024/09/30 18:39] (current) – [Void] Remove Python 2 and add missing packages from the requirements table harpia
Line 2: Line 2:
   - Assuming a [[wp>Linux|GNU/Linux]] environment, otherwise see [[docs:guide-developer:toolchain:start|alternative guides]].   - Assuming a [[wp>Linux|GNU/Linux]] environment, otherwise see [[docs:guide-developer:toolchain:start|alternative guides]].
   - Install ''[[wp>Git (software)|Git]]'' to download the source code, and your distro's default ''[[wp>GNU build system|build tools]]'' metapackage to do the cross-compilation process.   - Install ''[[wp>Git (software)|Git]]'' to download the source code, and your distro's default ''[[wp>GNU build system|build tools]]'' metapackage to do the cross-compilation process.
-  - Some feeds might not available over Git but only via ''[[wp>Apache Subversion|subversion]]'' (short: ''svn''or ''[[wp>Mercurial|mercurial]]''. If you want to obtain their source-code, you need to install svn and mercurial as well.+  - You may also need to install ''[[wp>Apache Subversion|Subversion (SVN)]]'' or ''[[wp>Mercurial|Mercurial]]'' to fetch the source-code for some feeds which are not available over Git.
   - Install other prerequisite packages, as indicated in the table and examples below.   - Install other prerequisite packages, as indicated in the table and examples below.
   - Unset environment variables like ''SED'' and ''GREP_OPTIONS'' and aliases/functions like ''which''.   - Unset environment variables like ''SED'' and ''GREP_OPTIONS'' and aliases/functions like ''which''.
Line 8: Line 8:
 ===== Prerequisites ===== ===== Prerequisites =====
 This table contains the package name for each build prerequisite in different GNU/Linux and Unix like distributions. This table contains the package name for each build prerequisite in different GNU/Linux and Unix like distributions.
-  * Bleeding edge distros like [[https://forum.openwrt.org/t/solved-build-from-master-on-archlinux-gives-error-for-freadahead-c/18693/6?u=brianbaligad|Archlinux may fail to build base-files]] if ''Cryptographically signed package lists'' in ''Global build settings'' is enabled.+  * Bleeding edge distros like [[https://forum.openwrt.org/t/solved-build-from-master-on-archlinux-gives-error-for-freadahead-c/18693/6?u=brianbaligad|Arch Linux may fail to build base-files]] if ''Cryptographically signed package lists'' in ''Global build settings'' is enabled.
  
 <sortable> <sortable>
-^ Prerequisite ^ Debian ^ SUSE ^ Red Hat ^ macOS (via MacPorts) ^ Fedora ^ Arch ^ Gentoo ^ +^ Prerequisite                       ^ Debian                    ^ SUSE                     ^ Red Hat                  ^ macOS (via MacPorts)   ^ Fedora                   ^ Arch                     ^ Gentoo                           
-| asciidoc | asciidoc | asciidoc | asciidoc | asciidoc | asciidoc | asciidoc | app-text/asciidoc | +| asciidoc                           | asciidoc                  | asciidoc                 | asciidoc                 | asciidoc               | asciidoc                 | asciidoc                 | app-text/asciidoc                
-| [[wp>Bash (Unix shell)|GNU Bash]] | bash |bash| bash | bash | bash| bash| app-shells/bash | +| [[wp>Bash (Unix shell)|GNU Bash]]  | bash                      | bash                     | bash                     | bash                   | bash                     | bash                     | app-shells/bash                  
-| [[wp>GNU Binutils]] | binutils | binutils| binutils| binutils| binutils| binutils| sys-devel/binutils | +| [[wp>GNU Binutils]]                | binutils                  | binutils                 | binutils                 | binutils               | binutils                 | binutils                 | sys-devel/binutils               
-| [[wp>bzip2]] | bzip2 | bzip2| bzip2| bzip2| bzip2| bzip2| app-arch/bzip2 | +| [[wp>bzip2]]                       | bzip2                     | bzip2                    | bzip2                    | bzip2                  | bzip2                    | bzip2                    | app-arch/bzip2                   
-| [[wp>flex lexical analyser|flex]] | flex|flex| flex | flex| flex| flex| sys-devel/flex | +| [[wp>flex lexical analyser|flex]]  | flex                      | flex                     | flex                     | flex                   | flex                     | flex                     | sys-devel/flex                   
-| [[wp>Git (software)|git]] | git-core| git-core| git | git-core | git | git| dev-vcs/git | +| [[wp>Git (software)|git]]          | git                       | git-core                 | git                      | git-core               | git                      | git                      | dev-vcs/git                      
-| [[wp>GNU C++ Compiler]] | %%g++%% | %%gcc-c++%% | %%gcc-c++%% | ? | %%gcc-c++%% | gcc | sys-devel/gcc | +| [[wp>GNU C++ Compiler]]            | %%g++%%                   | %%gcc-c++%%              | %%gcc-c++%%              | ?                      | %%gcc-c++%%              | gcc                      | sys-devel/gcc                    
-| [[wp>GNU C Compiler]] | gcc| gcc| gcc| ?| gcc| gcc| sys-devel/gcc | +| [[wp>GNU C Compiler]]              | gcc                       | gcc                      | gcc                      | ?                      | gcc                      | gcc                      | sys-devel/gcc                    
-| GNU Time | | ? | ? | | ? | time | sys-process/time | +| GNU Time                           time                      | ?                        | ?                        gtime                  | ?                        | time                     | sys-process/time                 
-| getopt | util-linux | util-linux | util-linux | getopt| util-linux | util-linux | sys-apps/util-linux | +| getopt                             | util-linux                | util-linux               | util-linux               | getopt                 | util-linux               | util-linux               | sys-apps/util-linux              
-| [[wp>GNU awk]] | gawk| gawk| gawk| gawk| gawk| gawk| sys-apps/gawk | +| [[wp>GNU awk]]                     | gawk                      | gawk                     | gawk                     | gawk                   | gawk                     | gawk                     | sys-apps/gawk                    | 
-| help2man | help2man | ? | ? | | help2man | help2man | sys-apps/help2man | +| [[wp>gzip]]                        | gzip                      | gzip                     | gzip                     | gzip                   | gzip                     | gzip                     | app-arch/gzip                    
-| intltool-update | intltool| intltool| intltool| intltool| intltool| intltool | dev-util/intltool | +| help2man                           | help2man                  | ?                        | ?                        help2man               | help2man                 | help2man                 | sys-apps/help2man                
-| libelf-dev | libelf-dev | ? | ? | | elfutils-libelf-devel | libelf | virtual/libelf | +| intltool-update                    | intltool                  | intltool                 | intltool                 | intltool               | intltool                 | intltool                 | dev-util/intltool                
-| libz, libz-dev | zlib1g-dev | zlib-devel| zlib-devel| zlib| zlib-devel| zlib | sys-libs/zlib | +| libelf-dev                         | libelf-dev                | ?                        | ?                        libelf                 | elfutils-libelf-devel    | libelf                   | virtual/libelf                   
-| [[wp>make (software) | GNU make]] | make | make| make | gmake| make| make | sys-devel/make | +| libz, libz-dev                     | zlib1g-dev                | zlib-devel               | zlib-devel               | zlib, libzip, libzzip  | zlib-devel               | zlib                     | sys-libs/zlib                    
-| [[wp>ncurses]] | libncurses5-dev| ncurses-devel| ncurses-devel| ncurses| ncurses-devel| ncurses | sys-libs/ncurses | +| [[wp>make (software)| GNU make]]   | make                      | make                     | make                     | gmake                  | make                     | make                     | sys-devel/make                   
-| openssl/ssl.h | libssl-dev| libopenssl-devel| openssl-devel| openssl| openssl-devel| openssl | dev-libs/openssl | +| [[wp>ncurses]]                     libncurses-dev            | ncurses-devel            | ncurses-devel            | ncurses                | ncurses-devel            | ncurses                  | sys-libs/ncurses                 
-| patch| patch | patch | patch | patchutils| patch| patch | sys-devel/patch | +| openssl/ssl.h                      | libssl-dev                | libopenssl-devel         | openssl-devel            | openssl                | openssl-devel            | openssl                  | dev-libs/openssl                 
-| perl-ExtUtils-MakeMaker| perl-modules | perl-ExtUtils-MakeMaker| perl-ExtUtils-MakeMaker| p5-extutils-makemaker| perl-ExtUtils-MakeMaker| perl-extutils-makemaker | virtual/perl-ExtUtils-MakeMaker | +| patch                              | patch                     | patch                    | patch                    | patchutils             | patch                    | patch                    | sys-devel/patch                  
-| perl-Thread-Queue | | ? | ? | ? | perl-Thread-Queue | ? | virtual/perl-Thread-Queue | +| perl-ExtUtils-MakeMaker            | perl-modules              | perl-ExtUtils-MakeMaker  | perl-ExtUtils-MakeMaker  | p5-extutils-makemaker  | perl-ExtUtils-MakeMaker  | perl-extutils-makemaker  | virtual/perl-ExtUtils-MakeMaker  
-| python2-dev | python2-dev | python-devel| ?| python2| ? | python2 | dev-lang/python:2 | +| perl-Thread-Queue                  libthread-queue-any-perl  | ?                        | ?                        | ?                      | perl-Thread-Queue        | ?                        | virtual/perl-Thread-Queue        
-| ? | python3-dev | ? | ? | | ? | ? | ? | +| python2-dev                        | python2-dev               | python-devel             | ?                        python27               | ?                        | python2                  | dev-lang/python:               
-| unzip | unzip| unzip| unzip| unzip| unzip| unzip | app-arch/unzip | +| ?                                  | python3-dev               | ?                        | ?                        python310              | ?                        | ?                        | ?                                | 
-| [[wp>GNU Wget]] | wget | wget| wget| wget| wget| wget | net-misc/wget | +| [[wp>SWIG]]                        | swig                      | swig                     | swig                     | swig                   | swig                     | swig                     | dev-lang/swig                    
-| xgettext | gettext| gettext-tools| gettext | gettext| gettext| gettext | sys-devel/gettext | +| unzip                              | unzip                     | unzip                    | unzip                    | unzip                  | unzip                    | unzip                    | app-arch/unzip                   
-| xsltproc | xsltproc| libxslt-tools| ?| libxslt| libxslt| libxslt | dev-libs/libxslt | +| [[wp>GNU Wget]]                    | wget                      | wget                     | wget                     | wget                   | wget                     | wget                     | net-misc/wget                    
-| zlib, zlib-static| zlib1g-dev| zlib-devel-static | zlib-devel | zlib-devel| zlib-devel,zlib-static | zlib | sys-libs/zlib (USE=static-libs)|+| xgettext                           | gettext                   | gettext-tools            | gettext                  | gettext                | gettext                  | gettext                  | sys-devel/gettext                
 +| xsltproc                           | xsltproc                  | libxslt-tools            | ?                        | libxslt                | libxslt                  | libxslt                  | dev-libs/libxslt                 
 +| zlib, zlib-static                  | zlib1g-dev                | zlib-devel-static        | zlib-devel               | zlib                   | zlib-devel,zlib-static   | zlib                     | sys-libs/zlib (USE=static-libs)  |
 </sortable> </sortable>
 +
 +Note that the advice above may be somewhat outdated. E.g. python3 is currently the default in OpenWrt master, 22.03 and 21.02, while python2.7 has been removed due its end-of-life.
  
 ===== Package prerequisites ===== ===== Package prerequisites =====
Line 49: Line 53:
  
 <sortable> <sortable>
-^ Package ^ Prerequisite ^ Debian ^ SUSE ^ Red Hat ^ macOS ^ Fedora ^ Arch ^ Gentoo ^ +^ Package ^ Prerequisite ^ Debian ^ SUSE ^ Red Hat ^ macOS (via MacPorts) ^ Fedora ^ Arch ^ Gentoo ^ 
-| boost | bjam / boost-jam | libboost-dev | | | | boost-jam | boost | dev-util/boost-build | +| boost | bjam / boost-jam | libboost-dev | | | boost-jam boost-build | boost-jam | boost | dev-util/boost-build | 
-| intltool | [Perl] XML::Parser | libxml-parser-perl | | perl-XML-Parser | | perl-XML-Parser | intltool | dev-perl/XML-Parser | +| intltool | [Perl] XML::Parser | libxml-parser-perl | | perl-XML-Parser | p5.28-xml-parser p5.30-xml-parser | perl-XML-Parser | intltool | dev-perl/XML-Parser | 
-| libftdi | libusb-config | libusb-dev | | | | libusb-devel | libusb | dev-libs/libusb-compat | +| libftdi (aka: libftdi0) | libusb-config | libusb-dev | | | libusb | libusb-devel | libusb | dev-libs/libusb-compat | 
-| lilo | as86,ld86 | bin86 | | | | dev86 | bin86 | sys-devel/bin86 | +| lilo | as86,ld86 | bin86 | | | binutils | dev86 | bin86 | sys-devel/bin86 | 
-| lilo | bcc | bcc | | | | dev86 | [[https://aur.archlinux.org/packages/bcc/|aur/bcc]] | sys-devel/dev86 | +| lilo | bcc<sup>[[http://v3.sk/~lkundrak/dev86/|1]]</sup> | bcc | | | | dev86 | [[https://aur.archlinux.org/packages/bcc/|aur/bcc]] | sys-devel/dev86 | 
-| lilo | uudecode | sharutils | | | | sharutils | sharutils | app-arch/sharutils | +| lilo | uudecode | sharutils | | | sharutils | sharutils | sharutils | app-arch/sharutils | 
-| luajit | x86 %%g++%% libs on amd64 hosts| %%gcc-multilib%% | | | | | | | +| luajit,xdp-tools | x86 %%g++%% libs on amd64 hosts| %%gcc-multilib%% | | | | | | | 
-| classpath| javac, gcj | openjdk-7-jdk | | | | java-1.7.0-openjdk-devel | jdk7-openjdk | dev-java/oracle-jdk-bin, sys-devel/gcc[gcj], and one (or both) of dev-java/icedtea-bin:7 and dev-java/icedtea:7 | +| classpath (aka: gnu-classpath) <sup>[[wp>GNU_Classpath|1]]</sup> | javac, gcj | openjdk-7-jdk-headless | | | openjdk7-zulu | java-1.8.0-openjdk-devel | jdk7-openjdk | dev-java/oracle-jdk-bin, sys-devel/gcc[gcj], and one (or both) of dev-java/icedtea-bin:7 and dev-java/icedtea:7 | 
-| mac80211 | b43-fwcutter | | | | | b43-fwcutter | b43-fwcutter | net-wireless/b43-fwcutter | +| mac80211 | b43-fwcutter<sup>[[https://wireless.wiki.kernel.org/en/users/drivers/b43|1]]</sup> (Broadcom/BCM) | b43-fwcutter | | | | b43-fwcutter | b43-fwcutter | net-wireless/b43-fwcutter | 
-| jamvm | zip | | | | | zip | | app-arch/zip |+| jamvm<sup>[[wp>JamVM|1]]</sup> | zip | zip | | | zip | zip | | app-arch/zip |
 </sortable> </sortable>
  
-===== Linux distributions =====+===== Linux (GNU-Linux) distributions=====
 Distribution-specific instructions. Distribution-specific instructions.
 +
 +<WRAP info> Please note that OpenWrt master, 22.03 and 21.02 branches do not need python2.7 any more. Python3 should be your default.</WRAP>
  
 ==== Alpine ==== ==== Alpine ====
 <code bash> <code bash>
-apk add asciidoc bash bc binutils bzip2 cdrkit coreutils diffutils +apk add argp-standalone asciidoc bash bc binutils bzip2 cdrkit coreutils \ 
-findutils flex g++ gawk gcc gettext git grep intltool libxslt +  diffutils elfutils-dev findutils flex musl-fts-dev g++ gawk gcc gettext git 
-linux-headers make ncurses-dev openssl-dev patch perl python2-dev \ +  grep gzip intltool libxslt linux-headers make musl-libintl musl-obstack-dev \ 
-python3-dev rsync tar unzip util-linux wget zlib-dev+  ncurses-dev openssl-dev patch perl python3-dev rsync tar 
 +  unzip util-linux wget zlib-dev 
 +   
 +# python2-dev required for OpenWrt 19.07 and earlier is not available on Alpine Linux 3.16 and newer  
 + 
 +# missing dependency workaround (libtinfo is not installable by any APK package, 
 +# but can be simulated via libncurses (see: https://stackoverflow.com/a/41517423 ) 
 +# w/o this - ERROR: package/boot/uboot-mvebu failed to build (build variant: clearfog) 
 +ln -s /usr/lib/libncurses.so /usr/lib/libtinfo.so 
 </code> </code>
  
-==== Arch / Manjaro ====+==== Arch / Manjaro / EndeavourOS ====
 Arch users may install the [[https://aur.archlinux.org/packages/openwrt-devel/|openwrt-devel]] meta-package from the [[https://wiki.archlinux.org/index.php/Arch_User_Repository|AUR]] or alternatively, manually install the build dependencies as follows: Arch users may install the [[https://aur.archlinux.org/packages/openwrt-devel/|openwrt-devel]] meta-package from the [[https://wiki.archlinux.org/index.php/Arch_User_Repository|AUR]] or alternatively, manually install the build dependencies as follows:
  
 <code bash> <code bash>
 # Essential prerequisites # Essential prerequisites
-pacman -S --needed base-devel autoconf automake bash binutils bison bzip2 fakeroot +pacman -S --needed base-devel autoconf automake bash binutils bison \ 
-file findutils flex gawk gcc gettext git grep groff gzip libelf libtool libxslt m4 +bzip2 fakeroot file findutils flex gawk gcc gettext git grep groff 
-make ncurses openssl patch pkgconf python rsync sed texinfo time unzip util-linux +gzip libelf libtool libxslt m4 make ncurses openssl patch pkgconf 
-wget which zlib+python python-distutils-extra rsync sed texinfo time unzip util-linux wget which zlib
  
 # Optional prerequisites, depend on the package selection # Optional prerequisites, depend on the package selection
-pacman -S --needed asciidoc help2man intltool perl-extutils-makemaker+pacman -S --needed asciidoc help2man intltool perl-extutils-makemaker swig
 </code> </code>
  
-==== CentOS / Fedora ====+==== Fedora / Nobara ====
 <code bash> <code bash>
-sudo dnf --skip-broken install bash-completion bzip2 gcc gcc-c++ git +sudo dnf --setopt install_weak_deps=False --skip-broken install 
-make ncurses-devel patch perl-Data-Dumper perl-Thread-Queue python2 +bash-completion bzip2 gcc gcc-c++ git make ncurses-devel patch \ 
-python3 rsync tar unzip wget perl-base perl-File-Compare +rsync tar unzip wget which diffutils python2 python3 perl-base 
-perl-File-Copy perl-FindBin diffutils which+perl-Data-Dumper perl-File-Compare perl-File-Copy perl-FindBin 
 +perl-IPC-Cmd perl-JSON-PP perl-Thread-Queue perl-Time-Piece 
 +</code>
  
-# Fedora 34 +==== Debian / Ubuntu / Mint ==== 
-unset -f which; cd openwrt; mkdir -p staging_dir/host/bin; + 
-ln --s $(type -P which) staging_dir/host/bin+ 
 +Modernized set for Ubuntu 24.04 that has Python 3.12 without python3-distutils: 
 +(OpenWrt main/master in Apr 2024) 
 + 
 +<code bash> 
 +sudo apt update 
 +sudo apt install build-essential clang flex bison g++ gawk 
 +gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \ 
 +python3-setuptools rsync swig unzip zlib1g-dev file wget
 </code> </code>
  
-==== Debian / Ubuntu ====+ 
 +set for Ubuntu 22.04 (that has older Python 3.xx): 
 + 
 +<code bash> 
 +sudo apt update 
 +sudo apt install build-essential clang flex bison g++ gawk \ 
 +gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev \ 
 +python3-distutils python3-setuptools rsync swig unzip zlib1g-dev file wget 
 +</code> 
 + 
 +Older advice (for 19.07 and earlier that need python2.7): 
 <code bash> <code bash>
 sudo apt update sudo apt update
Line 138: Line 173:
 coreutils diffutils findutils flex gawk gcc gettext git grep intltool \ coreutils diffutils findutils flex gawk gcc gettext git grep intltool \
 libxslt linux-headers make ncurses-devel openssl-devel patch perl \ libxslt linux-headers make ncurses-devel openssl-devel patch perl \
-pkg-config python-devel python3-devel rsync tar unzip util-linux \ +pkg-config python3-devel rsync tar unzip util-linux wget 
-wget zlib-devel+zlib-devel time libelf perl-ExtUtils-MakeMaker-CPANfile \ 
 +help2man swig 
 + 
 +# for musl version, also install: argp-standalone musl-fts-devel musl-obstack-devel 
 +</code> 
 + 
 +===== macOS distributions: ===== 
 +macOS distribution-specific instructions. macOS uses Darwin unix as its core. Xcode/CLT toolchain, & 3rd-party package-manager tool allows to load various common build tools.\\ 
 +More info: [[https://openwrt.org/docs/guide-developer/toolchain/buildroot.exigence.macosx|buildroot.exigence.macosx]]. 
 + 
 +==== macOS / Darwin (x86_64) + MacPorts ==== 
 +<code bash> 
 +sudo port install libiconv gettext-runtime coreutils findutils gwhich \ 
 +gawk zlib pcre bzip2 ncurses grep getopt gettext-tools-libs gettext \ 
 +diffutils sharutils util-linux libxslt libxml2 help2man readline gtime \ 
 +gnutar unzip zip lzma xz libelf fastjar libusb libftdi0 expat sqlite3 \ 
 +openssl3 openssl kerberos5 dbus lz4 libunistring nettle icu gnutls \ 
 +p11-kit wget quilt subversion gmake pkgconfig libzip cdrtools ccache \ 
 +curl xxhashlib rsync libidn perl5 p5.28-xml-parser p5.30-xml-parser \ 
 +p5-extutils-makemaker p5-data-dumper boost-jam boost boost-build bash \ 
 +bash-completion binutils m4 flex intltool patchutils swig git-extras \ 
 +git openjdk17 openjdk7-zulu luajit libtool glib2 file python27 \ 
 +python310 libzzip mercurial asciidoc sdcc gnu-classpath</code> 
 + 
 +===== Unix distributions: ===== 
 +Distribution-specific instructions. 
 + 
 +==== FreeBSD ==== 
 +<code bash> 
 +...
 </code> </code>
  
  • Last modified: 2021/10/15 10:15
  • by vgaetera