From c924d7b7e5eece7f6fd00fb406b0f3b9766115cb Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 19 Feb 2023 10:07:21 +0100 Subject: [PATCH] build: Misc quality-of-life fixes --- GNUmakefile.in | 2 ++ common/GNUmakefile | 2 ++ configure.ac | 57 ++++++++++++++++++++-------------------- decompressor/GNUmakefile | 2 ++ host/Makefile | 6 ++--- 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index 97829222..6ff3ed48 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -1,3 +1,5 @@ +override MAKEFLAGS += -rR + override prefix := @prefix@ override exec_prefix := @exec_prefix@ diff --git a/common/GNUmakefile b/common/GNUmakefile index 1860aa54..973a21f0 100644 --- a/common/GNUmakefile +++ b/common/GNUmakefile @@ -1,3 +1,5 @@ +override MAKEFLAGS += -rR + include $(CROSS_FILE) TARGET ?= diff --git a/configure.ac b/configure.ac index 279403a5..6410e93f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_INIT([Limine], m4_esyscmd([./version.sh]), [https://github.com/limine-bootloader/limine/issues], [limine], [https://limine-bootloader.org/]) -AC_PREREQ(2.69) +AC_PREREQ([2.69]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SUBDIRS([cross-detect]) @@ -8,23 +8,23 @@ AC_CONFIG_SUBDIRS([cross-detect]) SRCDIR="$(cd "$srcdir" && pwd -P)" BUILDDIR="$(pwd -P)" -AC_SUBST(SRCDIR) -AC_SUBST(BUILDDIR) +AC_SUBST([SRCDIR]) +AC_SUBST([BUILDDIR]) test "x$CFLAGS" = "x" && CFLAGS='-g -O2 -pipe -Wall -Wextra' -AC_LANG(C) +AC_LANG([C]) AC_PROG_CC -AC_CHECK_HEADERS([stdint.h stddef.h stdbool.h limits.h inttypes.h stdio.h stdlib.h string.h]) +AC_CHECK_HEADERS([stdint.h stddef.h stdbool.h limits.h inttypes.h stdio.h stdlib.h string.h], + [], AC_MSG_ERROR([required header not found])) werror_state="no" AC_ARG_ENABLE([werror], AS_HELP_STRING([--enable-werror], [treat warnings as errors]), werror_state="$enableval") - if test "$werror_state" = "yes"; then - AC_SUBST(WERROR, [-Werror]) + AC_SUBST([WERROR], [-Werror]) CFLAGS="$CFLAGS -Werror" fi @@ -46,12 +46,11 @@ if ! test "x$FIND_FOUND" = "xyes"; then fi NATIVE_STRIP="$($CC -dumpmachine)"-strip -AC_CHECK_PROG([NATIVE_STRIP_FOUND], $NATIVE_STRIP, [yes]) +AC_CHECK_PROG([NATIVE_STRIP_FOUND], [$NATIVE_STRIP], [yes]) if ! test "x$NATIVE_STRIP_FOUND" = "xyes"; then NATIVE_STRIP=strip fi - -AC_SUBST(NATIVE_STRIP) +AC_SUBST([NATIVE_STRIP]) rm -rf "$BUILDDIR/cross-files" @@ -67,7 +66,7 @@ AC_ARG_ENABLE([bios-cd], AS_HELP_STRING([--enable-bios-cd], [enable building the x86 BIOS CD image]), BUILD_CD="$enableval") -AC_SUBST(BUILD_CD) +AC_SUBST([BUILD_CD]) BUILD_PXE="$BUILD_ALL" @@ -75,7 +74,7 @@ AC_ARG_ENABLE([bios-pxe], AS_HELP_STRING([--enable-bios-pxe], [enable building the x86 BIOS PXE image]), BUILD_PXE="$enableval") -AC_SUBST(BUILD_PXE) +AC_SUBST([BUILD_PXE]) BUILD_BIOS="$BUILD_ALL" @@ -107,8 +106,8 @@ else NEED_GZIP=yes fi -AC_SUBST(BUILD_BIOS) -AC_SUBST(BUILD_LIMINE_DEPLOY) +AC_SUBST([BUILD_BIOS]) +AC_SUBST([BUILD_LIMINE_DEPLOY]) BUILD_UEFI_IA32="$BUILD_ALL" @@ -128,7 +127,7 @@ else NEED_NASM=yes fi -AC_SUBST(BUILD_UEFI_IA32) +AC_SUBST([BUILD_UEFI_IA32]) BUILD_UEFI_X86_64="$BUILD_ALL" @@ -148,7 +147,7 @@ else NEED_NASM=yes fi -AC_SUBST(BUILD_UEFI_X86_64) +AC_SUBST([BUILD_UEFI_X86_64]) BUILD_UEFI_AARCH64="$BUILD_ALL" @@ -167,7 +166,7 @@ else BUILD_UEFI_AARCH64="limine-uefi-aarch64" fi -AC_SUBST(BUILD_UEFI_AARCH64) +AC_SUBST([BUILD_UEFI_AARCH64]) BUILD_CD_EFI="$BUILD_ALL" @@ -186,7 +185,7 @@ if ! test "x$BUILD_CD_EFI" = "xno"; then fi fi -AC_SUBST(BUILD_CD_EFI) +AC_SUBST([BUILD_CD_EFI]) if test "x$NEED_NASM" = "xyes"; then AC_CHECK_PROG([NASM_FOUND], [nasm], [yes]) @@ -202,25 +201,25 @@ if test "x$NEED_GZIP" = "xyes"; then fi fi -AC_ARG_VAR(CROSS_TOOLCHAIN, [alternative toolchain prefix for Limine (or 'llvm')]) -AC_ARG_VAR(CROSS_CC, [C compiler command for Limine]) -AC_ARG_VAR(CROSS_LD, [linker command for Limine]) -AC_ARG_VAR(CROSS_OBJCOPY, [objcopy command for Limine]) -AC_ARG_VAR(CROSS_OBJDUMP, [objdump command for Limine]) -AC_ARG_VAR(CROSS_READELF, [readelf command for Limine]) +AC_ARG_VAR([CROSS_TOOLCHAIN], [alternative toolchain prefix for Limine (or 'llvm')]) +AC_ARG_VAR([CROSS_CC], [C compiler command for Limine]) +AC_ARG_VAR([CROSS_LD], [linker command for Limine]) +AC_ARG_VAR([CROSS_OBJCOPY], [objcopy command for Limine]) +AC_ARG_VAR([CROSS_OBJDUMP], [objdump command for Limine]) +AC_ARG_VAR([CROSS_READELF], [readelf command for Limine]) m4_define([DEFAULT_CROSS_CFLAGS], [-g -O2 -pipe -Wall -Wextra]) -AC_ARG_VAR(CROSS_CFLAGS, [C flags for Limine @<:@default: ]DEFAULT_CROSS_CFLAGS[@:>@]) +AC_ARG_VAR([CROSS_CFLAGS], [C flags for Limine @<:@default: ]DEFAULT_CROSS_CFLAGS[@:>@]) test "x$CROSS_CFLAGS" = "x" && CROSS_CFLAGS="DEFAULT_CROSS_CFLAGS" m4_define([DEFAULT_CROSS_LDFLAGS], []) -AC_ARG_VAR(CROSS_LDFLAGS, [Linker flags for Limine @<:@default: ]DEFAULT_CROSS_LDFLAGS[@:>@]) +AC_ARG_VAR([CROSS_LDFLAGS], [Linker flags for Limine @<:@default: ]DEFAULT_CROSS_LDFLAGS[@:>@]) test "x$CROSS_LDFLAGS" = "x" && CROSS_LDFLAGS="DEFAULT_CROSS_LDFLAGS" LIMINE_COPYRIGHT=$($GREP Copyright "$SRCDIR/LICENSE.md") -AC_SUBST(LIMINE_COPYRIGHT) +AC_SUBST([LIMINE_COPYRIGHT]) -AC_PREFIX_DEFAULT(/usr/local) +AC_PREFIX_DEFAULT([/usr/local]) -AC_CONFIG_FILES(GNUmakefile config.h) +AC_CONFIG_FILES([GNUmakefile config.h]) AC_OUTPUT diff --git a/decompressor/GNUmakefile b/decompressor/GNUmakefile index 0684c47e..0d0f989a 100644 --- a/decompressor/GNUmakefile +++ b/decompressor/GNUmakefile @@ -1,3 +1,5 @@ +override MAKEFLAGS += -rR + include $(CROSS_FILE) BUILDDIR ?= diff --git a/host/Makefile b/host/Makefile index 43406099..ee46700f 100644 --- a/host/Makefile +++ b/host/Makefile @@ -39,10 +39,10 @@ clean: rm -f limine-enroll-config limine-enroll-config.exe limine-deploy: limine-deploy.c limine-hdd.h - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-deploy.c $(LIBS) -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-deploy.c $(LIBS) -o $@ limine-version: limine-version.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-version.c $(LIBS) -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-version.c $(LIBS) -o $@ limine-enroll-config: limine-enroll-config.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-enroll-config.c $(LIBS) -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-enroll-config.c $(LIBS) -o $@