aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure58
1 files changed, 28 insertions, 30 deletions
diff --git a/configure b/configure
index 52aa863a..10d7c1bd 100755
--- a/configure
+++ b/configure
@@ -40,6 +40,8 @@ skype=0
events=glib
ssl=auto
+pie=1
+
arch=`uname -s`
cpu=`uname -m`
@@ -78,6 +80,7 @@ Option Description Default
--debug=0/1 Disable/enable debugging $debug
--strip=0/1 Disable/enable binary stripping $strip
+--pie=0/1 Build position independent executable $pie
--gcov=0/1 Disable/enable test coverage reporting $gcov
--plugins=0/1 Disable/enable plugins support $plugins
--otr=0/1/auto/plugin
@@ -86,9 +89,10 @@ Option Description Default
Disable/enable Skype support $skype
--events=... Event handler (glib, libevent) $events
---ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto)
+--ssl=... SSL library to use (gnutls, nss, openssl, auto)
$ssl
+
--target=... Cross compilation target same as host
EOF
exit;
@@ -198,6 +202,11 @@ else
[ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
fi
+if [ "$pie" = "1" ]; then
+ echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings
+ echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings
+fi
+
echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings
echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
@@ -384,20 +393,20 @@ elif [ "$ssl" = "sspi" ]; then
elif [ "$ssl" = "openssl" ]; then
echo
echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
- echo 'install of OpenSSL (including devel/header files) before reporting'
+ echo 'installation of OpenSSL (including devel/header files) before reporting'
echo 'compilation problems.'
echo
echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
- echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
- echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
- echo 'part of the operating system, which makes it GPL-compatible.'
+ echo 'completely GPL-compatible. Using GnuTLS is recommended and better supported'
+ echo 'by us. However, on many BSD machines, OpenSSL can be considered part of the'
+ echo 'operating system, which makes it GPL-compatible.'
echo
echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
echo ' http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
echo
echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
echo 'probably illegal. If you want to create and distribute a binary BitlBee'
- echo 'package, you really should use GnuTLS or NSS instead.'
+ echo 'package, you really should use GnuTLS instead.'
echo
echo 'Also, the OpenSSL license requires us to say this:'
echo ' * "This product includes software developed by the OpenSSL Project'
@@ -406,19 +415,6 @@ elif [ "$ssl" = "openssl" ]; then
echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
ret=1
-elif [ "$ssl" = "bogus" ]; then
- echo
- echo 'Using bogus SSL code. This means some features will not work properly.'
-
- ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
- if [ "$msn" = "1" -o "$yahoo" = "1" ]; then
- echo
- echo 'WARNING: The MSN and Yahoo! modules will not work without SSL. Disabling.'
- msn=0
- yahoo=0
- fi
-
- ret=1
else
echo
echo 'ERROR: Unknown SSL library specified.'
@@ -429,20 +425,11 @@ if [ "$ret" = "0" ]; then
echo
echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
echo ' Please note that this script doesn'\''t have detection code for OpenSSL,'
- echo ' so if you want to use that, you have to select it by hand. If you don'\''t'
- echo ' need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
+ echo ' so if you want to use that, you have to select it by hand.'
exit 1
fi;
-if [ "$msn" = "1" -a "$ssl" != "openssl" -a "$ssl" != "gnutls" ]; then
- # Needed for MSN only. OpenSSL exports nice cipher functions already,
- # in case of GnuTLS we should be able to use gcrypt. Otherwise, use
- # built-in stuff. (Since right now those are the only two supported
- # SSL modules anyway, this is mostly unnecessary.)
- echo 'DES=des.o' >> Makefile.settings
-fi
-
echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
if detect_resolv_dynamic || detect_resolv_static; then
@@ -526,6 +513,11 @@ elif [ "$otr" = "plugin" ]; then
fi
if [ "$skype" = "1" -o "$skype" = "plugin" ]; then
+ if [ "$arch" = "Darwin" ]; then
+ echo "SKYPEFLAGS=-dynamiclib -undefined dynamic_lookup" >> Makefile.settings
+ else
+ echo "SKYPEFLAGS=-fPIC -shared" >> Makefile.settings
+ fi
echo 'SKYPE_PI=skype.so' >> Makefile.settings
protocols_mods="$protocol_mods skype(plugin)"
fi
@@ -623,7 +615,7 @@ fi
case "$CC" in
*gcc* )
echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings
- for i in . lib protocols protocols/*/; do
+ for i in . lib tests protocols protocols/*/; do
mkdir -p $i/.depend
done
esac
@@ -721,6 +713,12 @@ else
echo ' Debugging disabled.'
fi
+if [ "$pie" = "1" ]; then
+ echo ' Building PIE executable'
+else
+ echo ' Building non-PIE executable'
+fi
+
if [ "$strip" = "1" ]; then
echo ' Binary stripping enabled.'
else