Skip to content
Snippets Groups Projects
Commit 1a704bbb authored by Alexander Schlarb's avatar Alexander Schlarb
Browse files

make-ring: Allow passing in custom prefix path for Unix build

Change-Id: I446c8d9650efc97c5a8a1b56357c63f74af2fc35
parent 62004f28
No related branches found
No related tags found
No related merge requests found
...@@ -296,6 +296,8 @@ def run_install(args): ...@@ -296,6 +296,8 @@ def run_install(args):
install_args.append('-s') install_args.append('-s')
if args.global_install: if args.global_install:
install_args.append('-g') install_args.append('-g')
if args.prefix is not None:
install_args += ('-P', args.prefix)
if not args.priv_install: if not args.priv_install:
install_args.append('-u') install_args.append('-u')
...@@ -451,6 +453,7 @@ def parse_args(): ...@@ -451,6 +453,7 @@ def parse_args():
help='Stop the Ring processes') help='Stop the Ring processes')
ap.add_argument('--distribution') ap.add_argument('--distribution')
ap.add_argument('--prefix')
ap.add_argument('--static', default=False, action='store_true') ap.add_argument('--static', default=False, action='store_true')
ap.add_argument('--global-install', default=False, action='store_true') ap.add_argument('--global-install', default=False, action='store_true')
ap.add_argument('--debug', default=False, action='store_true') ap.add_argument('--debug', default=False, action='store_true')
......
...@@ -18,7 +18,7 @@ static='' ...@@ -18,7 +18,7 @@ static=''
client='' client=''
proc='1' proc='1'
priv_install=true priv_install=true
while getopts gsc:p:u OPT; do while getopts gsc:P:p:u OPT; do
case "$OPT" in case "$OPT" in
g) g)
global='true' global='true'
...@@ -29,6 +29,9 @@ while getopts gsc:p:u OPT; do ...@@ -29,6 +29,9 @@ while getopts gsc:p:u OPT; do
c) c)
client="${OPTARG}" client="${OPTARG}"
;; ;;
P)
prefix="${OPTARG}"
;;
p) p)
proc="${OPTARG}" proc="${OPTARG}"
;; ;;
...@@ -66,7 +69,11 @@ DAEMON="$(pwd)" ...@@ -66,7 +69,11 @@ DAEMON="$(pwd)"
cd contrib cd contrib
mkdir -p native mkdir -p native
cd native cd native
../bootstrap if [ "${prefix+set}" ]; then
../bootstrap --prefix="${prefix}"
else
../bootstrap
fi
make make
cd "${DAEMON}" cd "${DAEMON}"
./autogen.sh ./autogen.sh
...@@ -77,7 +84,11 @@ if [[ "$OSTYPE" != "darwin"* ]]; then ...@@ -77,7 +84,11 @@ if [[ "$OSTYPE" != "darwin"* ]]; then
fi fi
if [ "${global}" = "true" ]; then if [ "${global}" = "true" ]; then
./configure $sharedLib $CONFIGURE_FLAGS if [ "${prefix+set}" ]; then
./configure $sharedLib $CONFIGURE_FLAGS --prefix="${prefix}"
else
./configure $sharedLib $CONFIGURE_FLAGS
fi
else else
./configure $sharedLib $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon" ./configure $sharedLib $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon"
fi fi
...@@ -88,7 +99,11 @@ cd "${TOP}/lrc" ...@@ -88,7 +99,11 @@ cd "${TOP}/lrc"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}" cd "${BUILDDIR}"
if [ "${global}" = "true" ]; then if [ "${global}" = "true" ]; then
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_BUILD_TYPE=Debug $static if [ "${prefix+set}" ]; then
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${prefix}" $static
else
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_BUILD_TYPE=Debug $static
fi
else else
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \ cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_BUILD_TYPE=Debug \
...@@ -102,7 +117,11 @@ cd "${TOP}/${client}" ...@@ -102,7 +117,11 @@ cd "${TOP}/${client}"
mkdir -p "${BUILDDIR}" mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}" cd "${BUILDDIR}"
if [ "${global}" = "true" ]; then if [ "${global}" = "true" ]; then
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" $static if [ "${prefix+set}" ]; then
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_INSTALL_PREFIX="${prefix}" $static
else
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" $static
fi
else else
cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \ cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment