[openwrt/openwrt] include/prereq-build.mk: macOS cross build improvements

LEDE Commits lede-commits at lists.infradead.org
Fri Jun 24 08:11:19 PDT 2022


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f614332197b7b09d21007af59a31920198cd4885

commit f614332197b7b09d21007af59a31920198cd4885
Author: Mark Mentovai <mark at moxienet.com>
AuthorDate: Thu Jun 9 11:00:58 2022 -0400

    include/prereq-build.mk: macOS cross build improvements
    
    This updates prereq-build.mk to find a suitable realpath utility, and
    adds another place to look for a suitable getopt utility.
    
    realpath has been used most notably by scripts/ipkg-build since
    commit bb95be9265a9 ("scripts,ipkg-build: use realpath for pkg_dir")
    and there are assorted other uses of it during a build.
    It is ordinarily provided by GNU coreutils. This adds a SetupHostCommand
    to locate it either under its own name or under grealpath, the name that
    it will be available as under MacPorts or Homebrew, which use
    --program-prefix=g.
    
    Similarly, update the SetupHostCommand for getopt to be able to locate a
    util-linux getopt at the default path used by MacPorts, in the same
    fashion that
    commit cc16f5d73e77 ("build: try to find getopt in macOS homebrew's standard location")'
    did for Homebrew. As there is no standard alternative --program-prefix
    for util-linux utilities in the way that GNU packages often use a "g"
    prefix, this path-based approach is required in case a non-util-linux
    getopt (such as one provided by an OS) shadows the util-linux getopt
    in the PATH.
    
    Signed-off-by: Mark Mentovai <mark at moxienet.com>
---
 include/prereq-build.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 4a8c2b063a..80d549af39 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -130,7 +130,12 @@ $(eval $(call SetupHostCommand,getopt, \
 	Please install an extended getopt version that supports --long, \
 	gnugetopt -o t --long test -- --test | grep '^ *--test *--', \
 	getopt -o t --long test -- --test | grep '^ *--test *--', \
-	/usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))
+	/usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- --test | grep '^ *--test *--', \
+	/opt/local/bin/getopt -o t --long test -- --test | grep '^ *--test *--'))
+
+$(eval $(call SetupHostCommand,realpath,Please install a 'realpath' utility, \
+	grealpath /, \
+	realpath /))
 
 $(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
 	gnustat -c%s $(TOPDIR)/Makefile, \




More information about the lede-commits mailing list