1
0
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:
Dubslow 2014-12-16 18:50:28 -06:00
parent fc749880eb
commit 5cbe175ddc
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
3 changed files with 56 additions and 21 deletions

View File

@ -15,6 +15,7 @@ SODIUM_VER=1.0.0
# directory names of cloned repositories # directory names of cloned repositories
SODIUM_DIR=libsodium-$SODIUM_VER SODIUM_DIR=libsodium-$SODIUM_VER
TOX_CORE_DIR=libtoxcore-latest TOX_CORE_DIR=libtoxcore-latest
FILTER_AUDIO_DIR=filter_audio
# this boolean describes whether the installation of # this boolean describes whether the installation of
# libsodium should be skipped or not # libsodium should be skipped or not
@ -42,6 +43,11 @@ if [ -z "$TOX_CORE_DIR" ]; then
exit 1 exit 1
fi 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 ########## ########## check input parameters ##########
@ -95,7 +101,7 @@ mkdir -p ${BASE_DIR}
# if exists, otherwise cloning them may fail # if exists, otherwise cloning them may fail
rm -rf ${BASE_DIR}/${SODIUM_DIR} rm -rf ${BASE_DIR}/${SODIUM_DIR}
rm -rf ${BASE_DIR}/${TOX_CORE_DIR} rm -rf ${BASE_DIR}/${TOX_CORE_DIR}
rm -rf ${BASE_DIR}/${FILTER_AUDIO_DIR}
############### install step ############### ############### install step ###############
@ -122,6 +128,12 @@ if [[ $TOX_ONLY = "false" ]]; then
fi fi
popd 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 fi
# clone current master of libtoxcore # clone current master of libtoxcore

39
install_libfilteraudio.sh Normal file → Executable file
View File

@ -1,31 +1,40 @@
#!/bin/sh #!/bin/sh
CURRENT_DIR=$DIRSTACK
if [ -z $1 ]; then
SOURCE_DIR="filter_audio/" SOURCE_DIR="filter_audio/"
SOURCE_PATH="./../" else
SOURCE_DIR="$1/"
fi
if [ -z "$2" ]; then
LIB_DIR="/usr/local/lib/" LIB_DIR="/usr/local/lib/"
INCLUDE_DIR="/usr/local/include/" INCLUDE_DIR="/usr/local/include/"
else
LIB_DIR="$2/lib/"
INCLUDE_DIR="$2/include/"
fi
echo "Clone filter_audio from GitHub.com" echo "Cloning filter_audio from GitHub.com"
cd $SOURCE_PATH git clone https://github.com/irungentoo/filter_audio.git $SOURCE_DIR
git clone --quiet https://github.com/irungentoo/filter_audio.git $SOURCE_DIR
echo "Compile filter_audio" echo "Compiling filter_audio"
cd $SOURCE_DIR cd $SOURCE_DIR
gcc -c -fPIC filter_audio.c aec/*.c agc/*.c ns/*.c other/*.c -lm -lpthread 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 gcc *.o -shared -o libfilteraudio.so
echo "Clean up" echo "Cleaning up"
rm *.o rm *.o
echo "Install libfilteraudio.so" muhcmd="cp libfilteraudio.so $LIB_DIR"
sudo cp libfilteraudio.so $LIB_DIR [ -z "$2" ] && muhcmd="sudo $muhcmd"
echo "Installing libfilteraudio.so with $muhcmd"
$muhcmd
echo "Install include files" muhcmd="cp *.h $INCLUDE_DIR"
sudo cp *.h $INCLUDE_DIR [ -z "$2" ] && muhcmd="sudo $muhcmd"
echo "Installing include files with $muhcmd"
$muhcmd
echo "Finished." echo "Finished."
cd $CURRENT_DIR
exit 1

View File

@ -59,6 +59,12 @@ contains(DISABLE_PLATFORM_EXT, YES) {
DEFINES += QTOX_PLATFORM_EXT DEFINES += QTOX_PLATFORM_EXT
} }
contains(DISABLE_FILTER_AUDIO, YES) {
} else {
DEFINES += QTOX_FILTER_AUDIO
}
contains(JENKINS,YES) { contains(JENKINS,YES) {
INCLUDEPATH += ./libs/include/ INCLUDEPATH += ./libs/include/
} else { } else {
@ -78,6 +84,7 @@ win32 {
QMAKE_INFO_PLIST = osx/info.plist QMAKE_INFO_PLIST = osx/info.plist
LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lsodium -lvpx -framework OpenAL -lopencv_core -lopencv_highgui 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_PLATFORM_EXT) { LIBS += -framework IOKit -framework CoreFoundation }
contains(DEFINES, QTOX_FILTER_AUDIO) { }
} else { } else {
# If we're building a package, static link libtox[core,av] and libsodium, since they are not provided by any package # If we're building a package, static link libtox[core,av] and libsodium, since they are not provided by any package
contains(STATICPKG, YES) { contains(STATICPKG, YES) {
@ -94,8 +101,16 @@ win32 {
LIBS += -lX11 -lXss LIBS += -lX11 -lXss
} }
contains(DEFINES, QTOX_FILTER_AUDIO) {
contains(STATICPKG, YES) {
LIBS += -Wl,-Bstatic -lfilteraudio
} else {
LIBS += -lfilteraudio
}
}
contains(JENKINS, YES) { 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) { contains(DEFINES, QTOX_FILTER_AUDIO) {
HEADERS += src/audiofilterer.h HEADERS += src/audiofilterer.h
SOURCES += src/audiofilterer.cpp SOURCES += src/audiofilterer.cpp
unix|win32: LIBS += -lfilteraudio
} }
contains(DEFINES, QTOX_PLATFORM_EXT) { contains(DEFINES, QTOX_PLATFORM_EXT) {