1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 01:54:26 +00:00

Fix build errors on BSD (in BSDMakefile) (#27594) (#27608)

Backport #27594 by @sryze

1. `make build` fails because `||` and `&&` have the same precedence in
sh/bash, so the `false` command always evaluated (leading to an error).

   ```
   + which gmake /usr/local/bin/gmake
   + false

   *** Failed target:  .BEGIN
*** Failed command: which "gmake" || printf "Error: GNU Make is
required!\n\n" 1>&2 && false
   *** Error code 1
   ```

2. When `GPREFIX` is set to an empty string with quotation marks,
`gmake` mistakenly thinks that it's a file name:

   ``` gmake: *** empty string invalid as file name.  Stop. ```

Co-authored-by: Sergey Zolotarev <sryze@protonmail.com>
This commit is contained in:
Giteabot 2023-10-14 15:29:55 +08:00 committed by GitHub
parent 9f228704a3
commit 54dccbeb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,13 +42,13 @@ GARGS = "--no-print-directory"
# The GNU convention is to use the lowercased `prefix` variable/macro to # The GNU convention is to use the lowercased `prefix` variable/macro to
# specify the installation directory. Humor them. # specify the installation directory. Humor them.
GPREFIX = "" GPREFIX =
.if defined(PREFIX) && ! defined(prefix) .if defined(PREFIX) && ! defined(prefix)
GPREFIX = 'prefix = "$(PREFIX)"' GPREFIX = 'prefix = "$(PREFIX)"'
.endif .endif
.BEGIN: .SILENT .BEGIN: .SILENT
which $(GMAKE) || printf "Error: GNU Make is required!\n\n" 1>&2 && false which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
.PHONY: FRC .PHONY: FRC
$(.TARGETS): FRC $(.TARGETS): FRC