mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
update the build system
This commit is contained in:
parent
fc749880eb
commit
5cbe175ddc
14
bootstrap.sh
14
bootstrap.sh
|
@ -15,6 +15,7 @@ SODIUM_VER=1.0.0
|
|||
# directory names of cloned repositories
|
||||
SODIUM_DIR=libsodium-$SODIUM_VER
|
||||
TOX_CORE_DIR=libtoxcore-latest
|
||||
FILTER_AUDIO_DIR=filter_audio
|
||||
|
||||
# this boolean describes whether the installation of
|
||||
# libsodium should be skipped or not
|
||||
|
@ -42,6 +43,11 @@ if [ -z "$TOX_CORE_DIR" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$FILTER_AUDIO_DIR" ]; then
|
||||
echo "internal error detected!"
|
||||
echo "FILTER_AUDIO_DIR should not be empty... aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
########## check input parameters ##########
|
||||
|
@ -95,7 +101,7 @@ mkdir -p ${BASE_DIR}
|
|||
# if exists, otherwise cloning them may fail
|
||||
rm -rf ${BASE_DIR}/${SODIUM_DIR}
|
||||
rm -rf ${BASE_DIR}/${TOX_CORE_DIR}
|
||||
|
||||
rm -rf ${BASE_DIR}/${FILTER_AUDIO_DIR}
|
||||
|
||||
|
||||
############### install step ###############
|
||||
|
@ -122,6 +128,12 @@ if [[ $TOX_ONLY = "false" ]]; then
|
|||
fi
|
||||
|
||||
popd
|
||||
|
||||
if [[ $GLOBAL = "false" ]]; then
|
||||
./install_libfilteraudio.sh ${BASE_DIR}/${FILTER_AUDIO_DIR} ${BASE_DIR}
|
||||
else
|
||||
./install_libfilteraudio.sh ${BASE_DIR}/${FILTER_AUDIO_DIR}
|
||||
fi
|
||||
fi
|
||||
|
||||
# clone current master of libtoxcore
|
||||
|
|
45
install_libfilteraudio.sh
Normal file → Executable file
45
install_libfilteraudio.sh
Normal file → Executable file
|
@ -1,31 +1,40 @@
|
|||
#!/bin/sh
|
||||
CURRENT_DIR=$DIRSTACK
|
||||
SOURCE_DIR="filter_audio/"
|
||||
SOURCE_PATH="./../"
|
||||
LIB_DIR="/usr/local/lib/"
|
||||
INCLUDE_DIR="/usr/local/include/"
|
||||
|
||||
echo "Clone filter_audio from GitHub.com"
|
||||
cd $SOURCE_PATH
|
||||
git clone --quiet https://github.com/irungentoo/filter_audio.git $SOURCE_DIR
|
||||
if [ -z $1 ]; then
|
||||
SOURCE_DIR="filter_audio/"
|
||||
else
|
||||
SOURCE_DIR="$1/"
|
||||
fi
|
||||
|
||||
echo "Compile filter_audio"
|
||||
if [ -z "$2" ]; then
|
||||
LIB_DIR="/usr/local/lib/"
|
||||
INCLUDE_DIR="/usr/local/include/"
|
||||
else
|
||||
LIB_DIR="$2/lib/"
|
||||
INCLUDE_DIR="$2/include/"
|
||||
fi
|
||||
|
||||
echo "Cloning filter_audio from GitHub.com"
|
||||
git clone https://github.com/irungentoo/filter_audio.git $SOURCE_DIR
|
||||
|
||||
echo "Compiling filter_audio"
|
||||
cd $SOURCE_DIR
|
||||
gcc -c -fPIC filter_audio.c aec/*.c agc/*.c ns/*.c other/*.c -lm -lpthread
|
||||
|
||||
echo "Create shared object file"
|
||||
echo "Creating shared object file"
|
||||
gcc *.o -shared -o libfilteraudio.so
|
||||
|
||||
echo "Clean up"
|
||||
echo "Cleaning up"
|
||||
rm *.o
|
||||
|
||||
echo "Install libfilteraudio.so"
|
||||
sudo cp libfilteraudio.so $LIB_DIR
|
||||
muhcmd="cp libfilteraudio.so $LIB_DIR"
|
||||
[ -z "$2" ] && muhcmd="sudo $muhcmd"
|
||||
echo "Installing libfilteraudio.so with $muhcmd"
|
||||
$muhcmd
|
||||
|
||||
echo "Install include files"
|
||||
sudo cp *.h $INCLUDE_DIR
|
||||
muhcmd="cp *.h $INCLUDE_DIR"
|
||||
[ -z "$2" ] && muhcmd="sudo $muhcmd"
|
||||
echo "Installing include files with $muhcmd"
|
||||
$muhcmd
|
||||
|
||||
echo "Finished."
|
||||
cd $CURRENT_DIR
|
||||
exit 1
|
||||
|
||||
|
|
18
qtox.pro
18
qtox.pro
|
@ -59,6 +59,12 @@ contains(DISABLE_PLATFORM_EXT, YES) {
|
|||
DEFINES += QTOX_PLATFORM_EXT
|
||||
}
|
||||
|
||||
contains(DISABLE_FILTER_AUDIO, YES) {
|
||||
|
||||
} else {
|
||||
DEFINES += QTOX_FILTER_AUDIO
|
||||
}
|
||||
|
||||
contains(JENKINS,YES) {
|
||||
INCLUDEPATH += ./libs/include/
|
||||
} else {
|
||||
|
@ -78,6 +84,7 @@ win32 {
|
|||
QMAKE_INFO_PLIST = osx/info.plist
|
||||
LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lsodium -lvpx -framework OpenAL -lopencv_core -lopencv_highgui
|
||||
contains(DEFINES, QTOX_PLATFORM_EXT) { LIBS += -framework IOKit -framework CoreFoundation }
|
||||
contains(DEFINES, QTOX_FILTER_AUDIO) { }
|
||||
} else {
|
||||
# If we're building a package, static link libtox[core,av] and libsodium, since they are not provided by any package
|
||||
contains(STATICPKG, YES) {
|
||||
|
@ -94,8 +101,16 @@ win32 {
|
|||
LIBS += -lX11 -lXss
|
||||
}
|
||||
|
||||
contains(DEFINES, QTOX_FILTER_AUDIO) {
|
||||
contains(STATICPKG, YES) {
|
||||
LIBS += -Wl,-Bstatic -lfilteraudio
|
||||
} else {
|
||||
LIBS += -lfilteraudio
|
||||
}
|
||||
}
|
||||
|
||||
contains(JENKINS, YES) {
|
||||
LIBS = ./libs/lib/libtoxav.a ./libs/lib/libvpx.a ./libs/lib/libopus.a ./libs/lib/libtoxdns.a ./libs/lib/libtoxencryptsave.a ./libs/lib/libtoxcore.a ./libs/lib/libsodium.a /usr/lib/libopencv_core.so /usr/lib/libopencv_highgui.so /usr/lib/libopencv_imgproc.so -lopenal -lX11 -lXss -s
|
||||
LIBS = ./libs/lib/libtoxav.a ./libs/lib/libvpx.a ./libs/lib/libopus.a ./libs/lib/libtoxdns.a ./libs/lib/libtoxencryptsave.a ./libs/lib/libtoxcore.a ./libs/lib/libsodium.a ./libs/lib/libfilteraudio.a /usr/lib/libopencv_core.so /usr/lib/libopencv_highgui.so /usr/lib/libopencv_imgproc.so -lopenal -lX11 -lXss -s
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +252,6 @@ SOURCES += \
|
|||
contains(DEFINES, QTOX_FILTER_AUDIO) {
|
||||
HEADERS += src/audiofilterer.h
|
||||
SOURCES += src/audiofilterer.cpp
|
||||
unix|win32: LIBS += -lfilteraudio
|
||||
}
|
||||
|
||||
contains(DEFINES, QTOX_PLATFORM_EXT) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user