mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
LINUX: Fix build with libtorrent 1.0.x. Closes #1878.
This commit is contained in:
parent
d6f309b7a6
commit
441f63d9af
3 changed files with 67 additions and 3 deletions
30
configure.ac
30
configure.ac
|
@ -172,7 +172,37 @@ AX_DEFINE_DIR([EXPAND_BINDIR], [bindir])
|
|||
AX_DEFINE_DIR([EXPAND_DATADIR], [datadir])
|
||||
AX_DEFINE_DIR([EXPAND_MANDIR], [mandir])
|
||||
|
||||
# Original extract() function contributed by pmzqla
|
||||
# $*: Strings to parse
|
||||
# Set $DEFINES, $INCLUDES, $OTHER
|
||||
extract() {
|
||||
if [[ -z "$*" ]]; then
|
||||
echo "Input string required"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Convert " -" to "\n" if not between quotes
|
||||
string=$(echo " $*" | sed -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g")
|
||||
SAVEIFS=$IFS
|
||||
IFS=$(printf "\n\b")
|
||||
for i in $string; do
|
||||
case "$(echo "$i" | cut -c1)" in
|
||||
'') ;;
|
||||
D) QBT_CONF_DEFINES="$(echo $i | cut -c2-) $QBT_CONF_DEFINES";;
|
||||
I) QBT_CONF_INCLUDES="$(echo $i | cut -c2-) $QBT_CONF_INCLUDES";;
|
||||
*) QBT_CONF_EXTRA_CFLAGS="-$i $QBT_CONF_EXTRA_CFLAGS";;
|
||||
esac
|
||||
done
|
||||
IFS=$SAVEIFS
|
||||
}
|
||||
|
||||
extract $CPPFLAGS
|
||||
QBT_ADD_DEFINES="$QBT_ADD_DEFINES $QBT_CONF_DEFINES"
|
||||
QBT_CONF_EXTRA_CFLAGS="$QBT_CONF_EXTRA_CFLAGS $CXXFLAGS"
|
||||
|
||||
# Substitute the values of these vars in conf.pri.in
|
||||
AC_SUBST(QBT_CONF_INCLUDES)
|
||||
AC_SUBST(QBT_CONF_EXTRA_CFLAGS)
|
||||
AC_SUBST(QBT_ADD_CONFIG)
|
||||
AC_SUBST(QBT_REMOVE_CONFIG)
|
||||
AC_SUBST(QBT_ADD_DEFINES)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue