osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-dev/+/37342?usp=email )

Change subject: gen_makefile: add --install-prefix argument
......................................................................

gen_makefile: add --install-prefix argument

Make it feasible to set installation prefixes for both autotools and
meson projects (open5gs) when building them with osmo-dev. This will be
used by the new testenv script for osmo-ttcn3-hacks.

Related: OS#6494
Change-Id: I1788a9a1e6c83f108e03968f797c258da20863b0
---
M gen_makefile.py
1 file changed, 23 insertions(+), 2 deletions(-)

Approvals:
  osmith: Looks good to me, approved; Verified




diff --git a/gen_makefile.py b/gen_makefile.py
index ff8ab78..ca9003a 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -50,6 +50,7 @@
 import os
 import argparse
 import multiprocessing
+import shlex

 topdir = os.path.dirname(os.path.realpath(__file__))
 all_deps_file = os.path.join(topdir, "all.deps")
@@ -118,6 +119,9 @@
 parser.add_argument('-a', '--auto-distclean', action='store_true',
     help='''run "make distclean" automatically if source directory already 
configured''')

+parser.add_argument('-i', '--install-prefix', default='/usr/local',
+                    help='''install there instead of /usr/local''')
+
 args = parser.parse_args()

 class listdict(dict):
@@ -252,7 +256,9 @@
        -chmod -R ug+w {build_proj}
        -rm -rf {build_proj}
        mkdir -p {build_proj}
-       cd {build_proj}; {cflags}{docker_cmd}{build_to_src}/configure 
{configure_opts}
+       cd {build_proj}; {cflags}{docker_cmd}{build_to_src}/configure \\
+               --prefix {shlex.quote(args.install_prefix)} \\
+               {configure_opts}
        sync
        touch $@
     '''
@@ -263,7 +269,8 @@
        -chmod -R ug+w {build_proj}
        -rm -rf {build_proj}
        mkdir -p {build_proj}
-       cd {build_proj}; {cflags}{docker_cmd}meson setup {build_to_src} .
+       cd {build_proj}; {cflags}{docker_cmd}meson setup {build_to_src} . \\
+               --prefix {shlex.quote(args.install_prefix)}
        sync
        touch $@
     '''

--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/37342?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I1788a9a1e6c83f108e03968f797c258da20863b0
Gerrit-Change-Number: 37342
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to