Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
detect native libotr during installation
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
export otr_version=`./check-otr-version.sh` | ||
|
||
if [ "${otr_version}" == '' ] | ||
then | ||
echo "No libotr found on the system." | ||
echo "On Debian/Ubuntu you can install it with the following command:" | ||
echo "sudo apt-get install libotr2 libotr2-dev" | ||
exit | ||
fi | ||
|
||
echo "Found local version of libotr: ${otr_version}" | ||
|
||
if [ "${otr_version}" == '3' ] | ||
then | ||
make module | ||
fi | ||
|
||
if [ "${otr_version}" == '4' ] | ||
then | ||
echo "module 'otr3' requires native libotr 3.2.1 on the system." | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# use the C pre-processor to get the version of libotr on the system | ||
|
||
cat >tmp.h <<EOF | ||
#include <libotr/version.h> | ||
#ifdef OTRL_VERSION_MAJOR | ||
otrl-version OTRL_VERSION_MAJOR OTRL_VERSION_MINOR OTRL_VERSION_SUB | ||
#else | ||
otrl-version 0 0 0 | ||
#endif | ||
EOF | ||
|
||
if [ -e tmp.h ] | ||
then | ||
#prints the major version or 0 if libotr dev headers not found | ||
cc -E tmp.h 2>/dev/null | grep "otrl-version" | awk '{print $2}' | ||
rm tmp.h | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters