2018-08-28 12:03:42 +00:00
|
|
|
#!/bin/sh
|
2017-03-02 14:37:32 +00:00
|
|
|
|
2017-03-30 13:29:21 +00:00
|
|
|
OPTS=`getopt -o "h" --long \
|
2024-04-15 09:21:10 +00:00
|
|
|
help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsoup3,without-webrtcdsp,\
|
2024-04-24 12:39:55 +00:00
|
|
|
enable-select-lang,\
|
2017-03-30 13:29:21 +00:00
|
|
|
enable-plugin:,disable-plugin:,\
|
|
|
|
prefix:,program-prefix:,exec-prefix:,lib-suffix:,\
|
|
|
|
bindir:,libdir:,includedir:,datadir:,\
|
|
|
|
host:,build:,\
|
|
|
|
sbindir:,sysconfdir:,libexecdir:,localstatedir:,sharedstatedir:,mandir:,infodir:,\
|
|
|
|
-n './configure' -- "$@"`
|
2021-01-18 18:01:30 +00:00
|
|
|
if [ $? != 0 ] ; then echo "-- Ignoring unrecognized options." >&2 ; fi
|
2017-03-23 16:10:45 +00:00
|
|
|
|
|
|
|
eval set -- "$OPTS"
|
|
|
|
|
|
|
|
PREFIX=${PREFIX:-/usr/local}
|
|
|
|
ENABLED_PLUGINS=
|
|
|
|
DISABLED_PLUGINS=
|
2024-04-08 13:47:06 +00:00
|
|
|
BUILD_TESTS=no
|
2019-12-25 19:28:07 +00:00
|
|
|
BUILD_TYPE=Debug
|
2017-03-23 16:10:45 +00:00
|
|
|
DISABLE_FAST_VAPI=
|
2024-04-24 12:39:55 +00:00
|
|
|
ENABLE_SELECT_LANG=no
|
2017-03-23 16:10:45 +00:00
|
|
|
LIB_SUFFIX=
|
|
|
|
NO_DEBUG=
|
2022-11-03 15:46:07 +00:00
|
|
|
USE_SOUP3=
|
2024-04-15 09:21:10 +00:00
|
|
|
PLUGIN_RTP_WEBRTC_AUDIO_PROCESSING=yes
|
2017-03-23 16:10:45 +00:00
|
|
|
|
2017-03-30 13:29:21 +00:00
|
|
|
EXEC_PREFIX=
|
|
|
|
BINDIR=
|
|
|
|
SBINDIR=n
|
|
|
|
SYSCONFDIR=
|
|
|
|
DATADIR=
|
|
|
|
INCLUDEDIR=
|
|
|
|
LIBDIR=
|
|
|
|
LIBEXECDIR=
|
|
|
|
LOCALSTATEDIR=
|
|
|
|
SHAREDSTATEDIR=
|
|
|
|
MANDIR=
|
|
|
|
INFODIR=
|
|
|
|
|
2017-03-23 16:10:45 +00:00
|
|
|
help() {
|
|
|
|
cat << EOF
|
|
|
|
Usage:
|
2017-03-30 13:29:21 +00:00
|
|
|
./configure [OPTION]...
|
|
|
|
|
|
|
|
Defaults for the options (based on current environment) are specified in
|
|
|
|
brackets.
|
2017-03-23 16:10:45 +00:00
|
|
|
|
2017-03-30 13:29:21 +00:00
|
|
|
Configuration:
|
2017-03-23 16:10:45 +00:00
|
|
|
-h, --help Print this help and exit
|
2017-03-30 13:29:21 +00:00
|
|
|
--disable-fast-vapi Disable the usage of Vala compilers fast-vapi
|
|
|
|
feature. fast-vapi mode is slower when doing
|
|
|
|
clean builds, but faster when doing incremental
|
|
|
|
builds (during development).
|
2019-12-25 19:28:07 +00:00
|
|
|
--fetch-only Only fetch the files required to run ./configure
|
2020-01-21 20:30:21 +00:00
|
|
|
without network access later and exit.
|
2024-04-24 12:39:55 +00:00
|
|
|
--enable-select-lang enable language switching for the settings menu
|
2019-12-25 19:28:07 +00:00
|
|
|
--no-debug Build without debug symbols
|
|
|
|
--release Configure to build an optimized release version
|
2022-11-03 15:46:07 +00:00
|
|
|
--with-libsoup3 Build with libsoup-3.0
|
2024-04-15 09:21:10 +00:00
|
|
|
--without-webrtcdsp Build without WebRTC audio processing
|
2017-05-13 15:43:51 +00:00
|
|
|
--with-tests Also build tests.
|
2017-03-23 16:10:45 +00:00
|
|
|
|
2017-03-30 13:29:21 +00:00
|
|
|
Plugin configuration:
|
2017-03-23 16:10:45 +00:00
|
|
|
--enable-plugin=PLUGIN Enable compilation of plugin PLUGIN.
|
|
|
|
--disable-plugin=PLUGIN Disable compilation of plugin PLUGIN.
|
|
|
|
|
2017-03-30 13:29:21 +00:00
|
|
|
Installation directories:
|
|
|
|
--prefix=PREFIX Install architecture-independent files in PREFIX
|
|
|
|
[$PREFIX]
|
|
|
|
--program-prefix=PREFIX Same as --prefix
|
|
|
|
--exec-prefix= Install architecture-dependent files in EPREFIX
|
|
|
|
[PREFIX]
|
|
|
|
--lib-suffix=SUFFIX Append SUFFIX to the directory name for libraries
|
|
|
|
|
|
|
|
By default, \`make install' will install all the files in
|
|
|
|
\`/usr/local/bin', \`/usr/local/lib' etc. You can specify
|
|
|
|
an installation prefix other than \`/usr/local' using \`--prefix',
|
|
|
|
for instance \`--prefix=\$HOME'.
|
|
|
|
|
|
|
|
For better control, use the options below.
|
|
|
|
|
|
|
|
Fine tuning of the installation directories:
|
|
|
|
--bindir=DIR user executables [EPREFIX/bin]
|
|
|
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
|
|
|
--includedir=DIR C header files [PREFIX/include]
|
|
|
|
--datadir=DIR read-only data [PREFIX/share]
|
|
|
|
|
|
|
|
For compatibility with autotools, these options will be silently ignored:
|
|
|
|
--host, --build, --sbindir, --sysconfdir, --libexecdir, --sharedstatedir,
|
2021-01-18 18:01:30 +00:00
|
|
|
--localstatedir, --mandir, --infodir
|
2017-03-30 13:29:21 +00:00
|
|
|
|
|
|
|
Some influential environment variables:
|
|
|
|
CC C compiler command
|
|
|
|
CFLAGS C compiler flags
|
|
|
|
PKG_CONFIG_PATH directories to add to pkg-config's search path
|
|
|
|
PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path
|
|
|
|
USE_CCACHE decide to use ccache when compiling C objects
|
|
|
|
VALAC Vala compiler command
|
|
|
|
VALACFLAGS Vala compiler flags
|
|
|
|
|
|
|
|
Use these variables to override the choices made by \`configure' or to help
|
|
|
|
it to find libraries and programs with nonstandard names/locations.
|
2017-03-23 16:10:45 +00:00
|
|
|
|
|
|
|
EOF
|
2017-03-02 14:37:32 +00:00
|
|
|
}
|
|
|
|
|
2017-03-23 16:10:45 +00:00
|
|
|
while true; do
|
2017-03-23 16:30:15 +00:00
|
|
|
case "$1" in
|
|
|
|
--prefix ) PREFIX="$2"; shift; shift ;;
|
2018-09-02 22:29:27 +00:00
|
|
|
--enable-plugin ) if [ -z "$ENABLED_PLUGINS" ]; then ENABLED_PLUGINS="$2"; else ENABLED_PLUGINS="$ENABLED_PLUGINS;$2"; fi; shift; shift ;;
|
|
|
|
--disable-plugin ) if [ -z "$DISABLED_PLUGINS" ]; then DISABLED_PLUGINS="$2"; else DISABLED_PLUGINS="$DISABLED_PLUGINS;$2"; fi; shift; shift ;;
|
2017-03-23 16:30:15 +00:00
|
|
|
--valac ) VALA_EXECUTABLE="$2"; shift; shift ;;
|
2024-03-02 12:30:25 +00:00
|
|
|
--valac-flags ) VALACFLAGS="$2"; shift; shift ;;
|
2017-03-23 16:30:15 +00:00
|
|
|
--lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;;
|
2022-11-03 15:46:07 +00:00
|
|
|
--with-libsoup3 ) USE_SOUP3=yes; shift ;;
|
2024-04-15 09:21:10 +00:00
|
|
|
--without-webrtcdsp ) PLUGIN_RTP_WEBRTC_AUDIO_PROCESSING=no; shift ;;
|
2017-03-23 16:30:15 +00:00
|
|
|
--disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;;
|
2024-04-24 12:39:55 +00:00
|
|
|
--enable-select-lang) ENABLE_SELECT_LANG=yes; shift ;;
|
2017-03-23 16:30:15 +00:00
|
|
|
--no-debug ) NO_DEBUG=yes; shift ;;
|
2019-12-25 19:28:07 +00:00
|
|
|
--release ) BUILD_TYPE=RelWithDebInfo; shift ;;
|
2017-05-13 15:43:51 +00:00
|
|
|
--with-tests ) BUILD_TESTS=yes; shift ;;
|
2017-03-30 13:29:21 +00:00
|
|
|
# Autotools paths
|
|
|
|
--program-prefix ) PREFIX="$2"; shift; shift ;;
|
|
|
|
--exec-prefix ) EXEC_PREFIX="$2"; shift; shift ;;
|
|
|
|
--bindir ) BINDIR="$2"; shift; shift ;;
|
|
|
|
--datadir ) DATADIR="$2"; shift; shift ;;
|
|
|
|
--includedir ) INCLUDEDIR="$2"; shift; shift ;;
|
|
|
|
--libdir ) LIBDIR="$2"; shift; shift ;;
|
|
|
|
# Autotools paths not used
|
|
|
|
--sbindir ) SBINDIR="$2"; shift; shift ;;
|
|
|
|
--sysconfdir ) SYSCONFDIR="$2"; shift; shift ;;
|
|
|
|
--libexecdir ) LIBEXECDIR="$2"; shift; shift ;;
|
|
|
|
--localstatedir ) LOCALSTATEDIR="$2"; shift; shift ;;
|
|
|
|
--sharedstatedir ) SHAREDSTATEDIR="$2"; shift; shift ;;
|
|
|
|
--mandir ) MANDIR="$2"; shift; shift ;;
|
|
|
|
--infodir ) INFODIR="$2"; shift; shift ;;
|
|
|
|
--host | --build ) shift; shift ;;
|
2017-03-23 16:30:15 +00:00
|
|
|
-h | --help ) help; exit 0 ;;
|
|
|
|
-- ) shift; break ;;
|
|
|
|
* ) break ;;
|
|
|
|
esac
|
2017-03-23 16:10:45 +00:00
|
|
|
done
|
|
|
|
|
2017-03-11 10:16:01 +00:00
|
|
|
if [ ! -x "$(which cmake 2>/dev/null)" ]
|
2017-03-02 14:37:32 +00:00
|
|
|
then
|
2017-03-23 16:30:15 +00:00
|
|
|
echo "-!- CMake required."
|
|
|
|
exit 1
|
2017-03-02 14:37:32 +00:00
|
|
|
fi
|
|
|
|
|
2017-03-11 10:16:01 +00:00
|
|
|
ninja_bin="$(which ninja-build 2>/dev/null)"
|
|
|
|
if ! [ -x "$ninja_bin" ]; then
|
2017-03-23 16:30:15 +00:00
|
|
|
ninja_bin="$(which ninja 2>/dev/null)"
|
2017-03-11 10:16:01 +00:00
|
|
|
fi
|
|
|
|
if [ -x "$ninja_bin" ]; then
|
2019-12-17 22:52:05 +00:00
|
|
|
ninja_version=`$ninja_bin --version 2>/dev/null`
|
2017-03-23 16:30:15 +00:00
|
|
|
if [ $? -eq 0 ]; then
|
2019-12-17 22:52:05 +00:00
|
|
|
if [ -d build ]; then
|
|
|
|
last_ninja_version=`cat build/.ninja_version 2>/dev/null`
|
|
|
|
else
|
|
|
|
last_ninja_version=0
|
|
|
|
fi
|
|
|
|
if [ "$ninja_version" != "$last_ninja_version" ]; then
|
|
|
|
echo "-- Found Ninja: $ninja_bin (found version \"$ninja_version\")"
|
|
|
|
fi
|
2017-03-23 16:30:15 +00:00
|
|
|
cmake_type="Ninja"
|
|
|
|
exec_bin="$ninja_bin"
|
|
|
|
exec_command="$exec_bin"
|
2018-08-28 12:03:42 +00:00
|
|
|
elif [ "/usr/sbin/ninja" = "$ninja_bin" ]; then
|
2017-03-23 16:30:15 +00:00
|
|
|
echo "-- Ninja at $ninja_bin is not usable. Did you install 'ninja' instead of 'ninja-build'?"
|
|
|
|
fi
|
2017-03-11 10:16:01 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ! [ -x "$exec_bin" ]; then
|
2017-03-23 16:30:15 +00:00
|
|
|
make_bin="$(which make 2>/dev/null)"
|
|
|
|
if [ -x "$make_bin" ]; then
|
|
|
|
echo "-- Found Make: $make_bin"
|
|
|
|
cmake_type="Unix Makefiles"
|
|
|
|
exec_bin="$make_bin"
|
|
|
|
exec_command="$exec_bin"
|
|
|
|
echo "-- Running with make. Using Ninja (ninja-build) might improve build experience."
|
|
|
|
fi
|
2017-03-11 10:16:01 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ! [ -x "$exec_bin" ]; then
|
2017-03-23 16:30:15 +00:00
|
|
|
echo "-!- No compatible build system (Ninja, Make) found."
|
|
|
|
exit 4
|
2017-03-02 14:37:32 +00:00
|
|
|
fi
|
|
|
|
|
2017-03-11 00:29:38 +00:00
|
|
|
|
2019-12-17 22:52:05 +00:00
|
|
|
if [ -f ./build ]; then
|
2017-03-23 16:30:15 +00:00
|
|
|
echo "-!- ./build file exists. ./configure can't continue"
|
|
|
|
exit 2
|
2017-03-02 14:37:32 +00:00
|
|
|
fi
|
|
|
|
|
2019-12-17 22:52:05 +00:00
|
|
|
if [ -d build ]; then
|
2017-03-23 16:30:15 +00:00
|
|
|
last_type=`cat build/.cmake_type`
|
|
|
|
if [ "$cmake_type" != "$last_type" ]
|
|
|
|
then
|
|
|
|
echo "-- Using different build system, cleaning build system files"
|
|
|
|
cd build
|
|
|
|
rm -r CMakeCache.txt CMakeFiles
|
|
|
|
cd ..
|
|
|
|
fi
|
2017-03-02 14:37:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
|
|
|
|
echo "$cmake_type" > .cmake_type
|
2019-12-17 22:52:05 +00:00
|
|
|
echo "$ninja_version" > .ninja_version
|
2017-03-30 13:29:21 +00:00
|
|
|
cmake -G "$cmake_type" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
2019-12-25 19:28:07 +00:00
|
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
2017-03-30 13:29:21 +00:00
|
|
|
-DENABLED_PLUGINS="$ENABLED_PLUGINS" \
|
|
|
|
-DDISABLED_PLUGINS="$DISABLED_PLUGINS" \
|
2024-04-08 13:47:06 +00:00
|
|
|
-DBUILD_TESTING="$BUILD_TESTS" \
|
2022-11-03 15:46:07 +00:00
|
|
|
-DUSE_SOUP3="$USE_SOUP3" \
|
2017-03-30 13:29:21 +00:00
|
|
|
-DVALA_EXECUTABLE="$VALAC" \
|
|
|
|
-DCMAKE_VALA_FLAGS="$VALACFLAGS" \
|
|
|
|
-DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" \
|
|
|
|
-DLIB_SUFFIX="$LIB_SUFFIX" \
|
|
|
|
-DNO_DEBUG="$NO_DEBUG" \
|
|
|
|
-DEXEC_INSTALL_PREFIX="$EXEC_PREFIX" \
|
|
|
|
-DSHARE_INSTALL_PREFIX="$DATADIR" \
|
|
|
|
-DBIN_INSTALL_DIR="$BINDIR" \
|
|
|
|
-DINCLUDE_INSTALL_DIR="$INCLUDEDIR" \
|
|
|
|
-DLIB_INSTALL_DIR="$LIBDIR" \
|
2024-04-15 09:21:10 +00:00
|
|
|
-DPLUGIN_RTP_WEBRTC_AUDIO_PROCESSING="$PLUGIN_RTP_WEBRTC_AUDIO_PROCESSING" \
|
2024-04-24 12:39:55 +00:00
|
|
|
-DENABLE_SELECT_LANG="$ENABLE_SELECT_LANG" \
|
2019-12-17 22:52:05 +00:00
|
|
|
-Wno-dev \
|
2017-03-30 13:29:21 +00:00
|
|
|
.. || exit 9
|
2017-03-02 14:37:32 +00:00
|
|
|
|
2019-12-17 22:52:05 +00:00
|
|
|
if [ "$cmake_type" = "Ninja" ]; then
|
2017-03-02 14:37:32 +00:00
|
|
|
cat << EOF > Makefile
|
|
|
|
default:
|
2017-03-11 10:16:01 +00:00
|
|
|
@sh -c "$exec_command"
|
2017-03-02 14:37:32 +00:00
|
|
|
%:
|
2017-03-11 10:16:01 +00:00
|
|
|
@sh -c "$exec_command \"\$@\""
|
2017-03-02 14:37:32 +00:00
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cat << EOF > Makefile
|
|
|
|
default:
|
2017-03-11 10:16:01 +00:00
|
|
|
@sh -c "cd build; $exec_command"
|
2017-08-22 15:09:31 +00:00
|
|
|
distclean: clean uninstall
|
|
|
|
|
2017-03-02 14:37:32 +00:00
|
|
|
%:
|
2017-03-11 10:16:01 +00:00
|
|
|
@sh -c "cd build; $exec_command \"\$@\""
|
2017-03-02 14:37:32 +00:00
|
|
|
EOF
|
2017-03-12 18:31:02 +00:00
|
|
|
|
2017-03-23 16:30:15 +00:00
|
|
|
echo "-- Configured. Type 'make' to build, 'make install' to install."
|