osmith submitted this change.

View Change


Approvals: osmith: Looks good to me, approved; Verified
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(-)

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 change 37342. To unsubscribe, or for help writing mail filters, visit settings.

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