소스 검색

g.extension: fix make command on FreeBSD (#2075)

* g.extension: fix make command on FreeBSD

GRASS Makefile are type of GNU Make and not BSD Make.
On FreeBSD (and other BSD and maybe unix) we have to
use GNU Make program often "gmake" to distinct with the (bsd) "make"
Loïc Bartoletti 3 년 전
부모
커밋
fbbf6c01ac
1개의 변경된 파일12개의 추가작업 그리고 3개의 파일을 삭제
  1. 12 3
      scripts/g.extension/g.extension.py

+ 12 - 3
scripts/g.extension/g.extension.py

@@ -193,6 +193,15 @@ HEADERS = {
 HTTP_STATUS_CODES = list(http.HTTPStatus)
 GIT_URL = "https://github.com/OSGeo/grass-addons"
 
+# MAKE command
+# GRASS Makefile are type of GNU Make and not BSD Make
+# On FreeBSD (and other BSD and maybe unix) we have to
+# use GNU Make program often "gmake" to distinct with the (bsd) "make"
+if sys.platform.startswith("freebsd"):
+    MAKE = "gmake"
+else:
+    MAKE = "make"
+
 
 def replace_shebang_win(python_file):
     """
@@ -398,7 +407,7 @@ def etree_fromurl(url):
 def check_progs():
     """Check if the necessary programs are available"""
     # git to be tested once supported instead of `svn`
-    for prog in ("make", "gcc", "svn"):
+    for prog in (MAKE, "gcc", "svn"):
         if not grass.find_program(prog, "--help"):
             grass.fatal(_("'%s' required. Please install '%s' first.") % (prog, prog))
 
@@ -1764,7 +1773,7 @@ def install_extension_std_platforms(name, source, url, branch):
     }
 
     make_cmd = [
-        "make",
+        MAKE,
         "MODULE_TOPDIR=%s" % gisbase.replace(" ", r"\ "),
         "RUN_GISRC=%s" % os.environ["GISRC"],
         "BIN=%s" % dirs["bin"],
@@ -1778,7 +1787,7 @@ def install_extension_std_platforms(name, source, url, branch):
     ]
 
     install_cmd = [
-        "make",
+        MAKE,
         "MODULE_TOPDIR=%s" % gisbase,
         "ARCH_DISTDIR=%s" % os.path.join(TMPDIR, name),
         "INST_DIR=%s" % options["prefix"],