From c4aff422952d0edfe2b118727d8260348dab78db Mon Sep 17 00:00:00 2001 From: Max Barraclough Date: Sat, 14 May 2022 21:13:47 +0100 Subject: [PATCH 3/3] Improve README-hacking especially re. dependencies * More detail on dependencies and build steps * Additional example package-management commands for Debian/Ubuntu * Detail on the differences when building from git repo vs when building from release tarball * Tweak headings and their hierarchy levels * More explanation of Gnulib * Mention 'make uninstall' * Replace FTP link with modern HTTPS link Signed-off-by: Max Barraclough --- README-hacking | 97 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 25 deletions(-) diff --git a/README-hacking b/README-hacking index cc61598..f276a36 100644 --- a/README-hacking +++ b/README-hacking @@ -4,61 +4,108 @@ Everything related to the development of GNU lightning is on Savannah: https://savannah.gnu.org/projects/lightning/. -* Working from the Repository +* Build Dependencies -** Autotools +To compile GNU lightning of course requires the typical C development +toolchain, such as a C compiler, linker, and make. -This distribution uses the latest stable versions of Automake, Autoconf. If -you are getting the sources from git (or change configure.ac), you'll need -to have these tools installed to (re)build. All -of these programs are available from ftp://ftp.gnu.org/gnu. +lightning uses GNU TexInfo for documentation, so it's best to have it +installed. -If you're using a GNU/Linux distribution, the easiest way to install these -packages depends on your system. The following shell command should work -for Debian-based systems such as Ubuntu: +To install all of these on Debian-based systems such as Ubuntu: - $ sudo apt-get install autoconf automake - - -** Building + $ sudo apt-get install build-essential texinfo If you intend to do development work with lightning, it's useful to build lightning with its disassembler feature enabled. This optional feature -requires additional dependencies. On Ubuntu, this command should work: +requires additional dependencies. To install them all on Debian-based +systems such as Ubuntu: $ sudo apt-get install binutils-dev libiberty-dev zlib1g-dev -After getting the git sources, and installing the tools above, you can run + +* Additional Dependencies if Building from Git Repository + +This distribution uses the latest stable versions of Automake and Autoconf. +In addition, to run the bootstrap.sh script you will need Libtool installed. +If you are getting lightning's sources from git (as opposed to from a +release tarball), you'll need these tools installed in order to build. +You will also need them if you mean to change the configure.ac file. +Typically it should be possible to install them using your distro's +package manager. Alternatively they are available from +https://www.gnu.org/software/ + +To install all 3 tools on Debian-based systems such as Ubuntu: + + $ sudo apt-get install autoconf automake libtool + +(lightning's bootstrap.sh script uses git to fetch gnulib, so if compiling +from lightning's git repo, you will need git installed. Of course, in this +circumstance, you presumably already have git installed.) + + +* Building + +After getting lightning's sources and installing the dependencies as +described, it's time to prepare and run the build. The steps differ +slightly depending on whether you are building from lightning's git repo, +or from a release tarball. + + +** Building from Git Repo + +Run the following commands: $ ./bootstrap $ ./configure $ make $ make check -to do a fresh build. At this point, there should be no difference between -your local copy, and the master copy: +At this point, there should be no difference between your local +copy, and git's master branch. This command should show empty output: $ git diff -should output no difference. +After your first successful build, running 'make' should suffice. + -After that first time, running make should suffice. +** Building from Release Tarball -To install lightning: +Run the following commands: + + $ ./configure + $ make + $ make check + +After your first successful build, running 'make' should suffice. + + +* Installing lightning + +To install lightning, run the following command after a successful build: $ sudo make install -** Gnulib +To uninstall lightning: + + $ sudo make uninstall + -This distribution also uses Gnulib (https://www.gnu.org/software/gnulib) to -share common files, stored as a submodule in git. +* Gnulib -** Updating +lightning uses Gnulib (https://www.gnu.org/software/gnulib), which takes +the form of a git submodule. It does not need to be installed ahead of +time by the user as a build dependency. When building from the git repo, +the bootstrap.sh script downloads Gnulib for you. + + +* Updating $ git pull $ git submodule update -** Updating a submodule + +* Updating a submodule To update a submodule, say gnulib, do as follows: -- 2.32.0