You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
compile_meson() {
|
|
local olddir="$PWD"
|
|
local builddir='build'
|
|
local noinstall=false
|
|
|
|
local OPTIND=1
|
|
local opt
|
|
while getopts 'b:I' opt; do case "$opt" in
|
|
b) local builddir="$OPTARG" ;;
|
|
I) local noinstall=true ;;
|
|
esac; done
|
|
shift $(expr $OPTIND - 1)
|
|
[ "$#" -ge 1 ] && [ "$1" = '--' ] && shift || true
|
|
|
|
mkdir -p "$builddir"; cd "$builddir"
|
|
meson "$olddir" \
|
|
--buildtype=release \
|
|
--prefix="/$dir_prefix" \
|
|
--libdir="/$dir_prefix/$dir_lib" \
|
|
--libexecdir="/$dir_prefix/$dir_libexec" \
|
|
--bindir="/$dir_prefix/$dir_bin" \
|
|
--sbindir="/$dir_prefix/$dir_sbin" \
|
|
--includedir="/$dir_prefix/$dir_include" \
|
|
--datadir="/$dir_prefix/$dir_data" \
|
|
--mandir="/$dir_prefix/$dir_man" \
|
|
--infodir="/$dir_prefix/$dir_info" \
|
|
--localedir="/$dir_prefix/$dir_locale" \
|
|
--sysconfdir="/$dir_prefix/$dir_sysconf" \
|
|
"$@"
|
|
|
|
ninja $NINJAFLAGS
|
|
|
|
if [ "$noinstall" = false ]; then
|
|
DESTDIR="$dir_install" ninja $NINJAFLAGS install
|
|
fi
|
|
|
|
cd "$olddir"
|
|
}
|
|
|