From b175bd85a528bdee5029a1ef71bc1a5515c27c4f Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 25 Mar 2024 05:21:02 +0100 Subject: [PATCH] Add topdir ./configure. The goal here is to be able to add configure options later on. Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien 'neox' Bourmault --- .gitignore | 9 ++++++++ Makefile => Makefile.am | 0 autogen.sh | 17 ++++++++++++++ build | 4 ++++ configure.ac | 19 +++++++++++++++ download | 4 ++++ .../misc/generate-configure-makefiles.sh | 23 +++++++++++++++++++ site/docs/build/index.md | 18 ++++++++++++--- tests/lint | 1 + 9 files changed, 92 insertions(+), 3 deletions(-) rename Makefile => Makefile.am (100%) create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100755 resources/scripts/misc/generate-configure-makefiles.sh diff --git a/.gitignore b/.gitignore index 94e1e77..b5f6a39 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,12 @@ /tmp/ /version /versiondate +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +config.log +config.status +configure +install-sh +missing diff --git a/Makefile b/Makefile.am similarity index 100% rename from Makefile rename to Makefile.am diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..94382da --- /dev/null +++ b/autogen.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +# Copyright (C) 2023 Denis 'GNUtoo' Carikli +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +autoreconf -vfi "$@" diff --git a/build b/build index 94e70ff..a952f07 100755 --- a/build +++ b/build @@ -29,6 +29,10 @@ projectname="$(cat projectname)" . resources/scripts/misc/sysexits.sh +# Some scripts like the ones in resources/packages/flashrom need +# Makefiles to be generated +. resources/scripts/misc/generate-configure-makefiles.sh + # This is for backward compatibility: before the list of "modes" was # auto-detected, but there isn't a 1:1 matching between modes and # packages tasks (build, clean, etc). diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a2f61f0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,19 @@ +# Copyright (C) 2024 Denis 'GNUtoo' Carikli +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AC_INIT([gnuboot],[0.1],[gnuboot@gnu.org]) +AM_INIT_AUTOMAKE([foreign]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/download b/download index 732e6b9..b271f43 100755 --- a/download +++ b/download @@ -31,6 +31,10 @@ set -u -e . resources/scripts/misc/sysexits.sh +# Some scripts like the ones in resources/packages/flashrom need +# Makefiles to be generated +. resources/scripts/misc/generate-configure-makefiles.sh + # set this when you want to modify each coreboot tree # for example, you want to test custom patches # NODELETE='' ./download coreboot diff --git a/resources/scripts/misc/generate-configure-makefiles.sh b/resources/scripts/misc/generate-configure-makefiles.sh new file mode 100755 index 0000000..aadc674 --- /dev/null +++ b/resources/scripts/misc/generate-configure-makefiles.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2024 Denis 'GNUtoo' Carikli +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +if [ ! -f configure ] || \ + [ ! -f Makefile ] || \ + [ ! -f resources/packages/flashrom/Makefile ] ; then + ./autogen.sh + ./configure +fi diff --git a/site/docs/build/index.md b/site/docs/build/index.md index 78be395..66d59f8 100644 --- a/site/docs/build/index.md +++ b/site/docs/build/index.md @@ -107,9 +107,21 @@ You may also want to follow more of the steps here: Building GNU Boot binaries ========================== -GNU Boot includes a file called `Makefile` that you can use . This -Makefile calls some scripts like download or build that are in the -same directory, that you can also also use directly if you want. +The GNU Boot build system has some configuration options. While the +defaults are good for most users, the way it is implemented requires +you to run the following command first: + ./autogen.sh + +And if you don't need to change the defaults, you can then run the +following command: + ./configure + +If you want to look at which settings can be changed you can use the +following command which explains various options and how to do that: + ./configure --help + +Once this is done, you can either use the `Makefile` or some shell +scripts to build GNU Boot. The `Makefile` is much more simple to use but offers less flexibility (for instance there is a single command to build all images but no way diff --git a/tests/lint b/tests/lint index 9218cb4..a2df42a 100755 --- a/tests/lint +++ b/tests/lint @@ -41,6 +41,7 @@ printf "+---------------------+\n" printf "| Running lint tests: |\n" printf "+---------------------+\n" run_shellcheck \ + autogen.sh \ build \ download \ modify \