gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 12/14] Add topdir ./configure.


From: Denis 'GNUtoo' Carikli
Subject: [PATCH v1 12/14] Add topdir ./configure.
Date: Fri, 19 Apr 2024 19:06:29 +0200

The goal here is to be able to add configure options later on.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 .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                                    |  2 ++
 9 files changed, 93 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 <GNUtoo@cyberdimension.org>
+#
+# 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 <https://www.gnu.org/licenses/>.
+
+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 <GNUtoo@cyberdimension.org>
+#
+# 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 <https://www.gnu.org/licenses/>.
+
+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 <GNUtoo@cyberdimension.org>
+#
+# 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 <https://www.gnu.org/licenses/>.
+
+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 ae5748d..04fa281 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 \
@@ -59,6 +60,7 @@ run_shellcheck \
     resources/packages/u-boot-libre/distclean \
     resources/packages/website/distclean \
     resources/scripts/misc/errno-base.sh \
+    resources/scripts/misc/generate-configure-makefiles.sh \
     resources/scripts/misc/guix.sh \
     resources/scripts/misc/resources.sh \
     resources/scripts/tasks/distclean.sh \
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]