5b0d2f2f83
to add a few new flags. If it causes any trouble, I will remove it. * --help * --disable-openssl (autocheck: enable by default) * --openssl-include=PATH * --openssl-lib=PATH * Add CC and CFLAGS in configure for anyone can edit it. I have submitted this patch to the author. http://people.freebsd.org/~mezz/diff/configure.diff I believe that it can be done in Jamfile instead configure, I will have to learn more abot Jamfile later for what features and what it can do. If anyone know any better way or so, let me know.
218 lines
4.4 KiB
Text
218 lines
4.4 KiB
Text
--- ../../Transmission/configure Wed Oct 12 09:31:32 2005
|
|
+++ configure Wed Oct 19 16:18:33 2005
|
|
@@ -1,4 +1,11 @@
|
|
#! /bin/sh
|
|
+#
|
|
+#-*- mode: Fundamental; tab-width: 4; -*-
|
|
+# ex:ts=4
|
|
+#
|
|
+
|
|
+CC="cc"
|
|
+CFLAGS="-g -Wall -W"
|
|
|
|
# For > 2 GB files
|
|
DEFINES="_FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE"
|
|
@@ -6,80 +13,134 @@
|
|
# For asprintf
|
|
DEFINES="$DEFINES _GNU_SOURCE"
|
|
|
|
-# System-specific flags
|
|
+## System-specific flags
|
|
SYSTEM=`uname -s`
|
|
case $SYSTEM in
|
|
- BeOS)
|
|
- DEFINES="$DEFINES SYS_BEOS"
|
|
+ BeOS)
|
|
+ DEFINES="$DEFINES SYS_BEOS"
|
|
|
|
- RELEASE=`uname -r`
|
|
- case $RELEASE in
|
|
- 6.0|5.0.4) # Zeta or R5 / BONE beta 7
|
|
- SYSTEM="$SYSTEM / BONE"
|
|
- LINKLIBS="$LINKLIBS -lbind -lsocket"
|
|
- ;;
|
|
- 5.0*) # R5 / net_server
|
|
- SYSTEM="$SYSTEM / net_server"
|
|
- DEFINES="$DEFINES BEOS_NETSERVER"
|
|
- LINKLIBS="$LINKLIBS -lnet"
|
|
- ;;
|
|
- *)
|
|
- echo "Unsupported BeOS version"
|
|
- exit 1 ;;
|
|
- esac
|
|
- ;;
|
|
-
|
|
- Darwin)
|
|
- DEFINES="$DEFINES SYS_DARWIN"
|
|
- LINKLIBS="$LINKLIBS -lpthread"
|
|
- ;;
|
|
-
|
|
- FreeBSD)
|
|
- DEFINES="$DEFINES SYS_FREEBSD"
|
|
- LINKLIBS="$LINKLIBS -pthread"
|
|
- ;;
|
|
-
|
|
- NetBSD)
|
|
- DEFINES="$DEFINES SYS_NETBSD"
|
|
- LINKLIBS="$LINKLIBS -lpthread"
|
|
- ;;
|
|
-
|
|
- Linux)
|
|
- DEFINES="$DEFINES SYS_LINUX"
|
|
- LINKLIBS="$LINKLIBS -lpthread"
|
|
- ;;
|
|
-
|
|
- *)
|
|
- echo "Unsupported operating system"
|
|
- exit 1 ;;
|
|
+ RELEASE=`uname -r`
|
|
+ case $RELEASE in
|
|
+ 6.0|5.0.4) # Zeta or R5 / BONE beta 7
|
|
+ SYSTEM="$SYSTEM / BONE"
|
|
+ LINKLIBS="$LINKLIBS -lbind -lsocket"
|
|
+ ;;
|
|
+ 5.0*) # R5 / net_server
|
|
+ SYSTEM="$SYSTEM / net_server"
|
|
+ DEFINES="$DEFINES BEOS_NETSERVER"
|
|
+ LINKLIBS="$LINKLIBS -lnet"
|
|
+ ;;
|
|
+ *)
|
|
+ echo "Unsupported BeOS version"
|
|
+ exit 1 ;;
|
|
+ esac
|
|
+ ;;
|
|
+
|
|
+ Darwin)
|
|
+ DEFINES="$DEFINES SYS_DARWIN"
|
|
+ LINKLIBS="$LINKLIBS -lpthread"
|
|
+ ;;
|
|
+
|
|
+ FreeBSD)
|
|
+ DEFINES="$DEFINES SYS_FREEBSD"
|
|
+ LINKLIBS="$LINKLIBS -pthread"
|
|
+ ;;
|
|
+
|
|
+ NetBSD)
|
|
+ DEFINES="$DEFINES SYS_NETBSD"
|
|
+ LINKLIBS="$LINKLIBS -lpthread"
|
|
+ ;;
|
|
+
|
|
+ Linux)
|
|
+ DEFINES="$DEFINES SYS_LINUX"
|
|
+ LINKLIBS="$LINKLIBS -lpthread"
|
|
+ ;;
|
|
+
|
|
+ *)
|
|
+ echo "Unsupported operating system"
|
|
+ exit 1
|
|
+ ;;
|
|
esac
|
|
echo "System: $SYSTEM"
|
|
+##
|
|
+
|
|
+## Functions
|
|
+usage () {
|
|
+ cat <<-EOF
|
|
+ OpenSSL options:
|
|
+ --disable-openssl Disable OpenSSL, use built-in SHA1 implementation
|
|
+ --openssl-include=PATH Location of OpenSSL headers
|
|
+ --openssl-lib=PATH Location of OpenSSL library
|
|
|
|
-# Check for OpenSSL
|
|
-cat > testconf.c << EOF
|
|
-#include <stdio.h>
|
|
-#include <openssl/sha.h>
|
|
-int main()
|
|
-{
|
|
- SHA1( 0, 0, 0 );
|
|
+ EOF
|
|
}
|
|
-EOF
|
|
-if cc -o testconf testconf.c -lcrypto > /dev/null 2>&1
|
|
-then
|
|
- echo "OpenSSL: yes"
|
|
- DEFINES="$DEFINES HAVE_OPENSSL"
|
|
- LINKLIBS="$LINKLIBS -lcrypto"
|
|
+
|
|
+openssl_test () {
|
|
+ cat > testssl.c <<-EOF
|
|
+ #include <stdio.h>
|
|
+ #include <openssl/sha.h>
|
|
+ int main()
|
|
+ {
|
|
+ SHA1( 0, 0, 0 );
|
|
+ }
|
|
+ EOF
|
|
+
|
|
+ if $CC -I$OPENSSL_INC -o testssl testssl.c -L$OPENSSL_LIB -lcrypto > /dev/null 2>&1; then
|
|
+ echo "OpenSSL: yes"
|
|
+ CFLAGS="$CFLAGS -I$OPENSSL_INC"
|
|
+ DEFINES="$DEFINES HAVE_OPENSSL"
|
|
+ LINKLIBS="$LINKLIBS -L$OPENSSL_LIB -lcrypto"
|
|
+ else
|
|
+ echo "OpenSSL: no, using built-in SHA1 implementation"
|
|
+ fi
|
|
+
|
|
+ rm -f testssl.c testssl
|
|
+}
|
|
+##
|
|
+
|
|
+## Options
|
|
+openssl_disable=0
|
|
+OPENSSL_INC="/usr/include"
|
|
+OPENSSL_LIB="/usr/lib"
|
|
+while [ $# -ne 0 ]; do
|
|
+ param=`expr "opt$1" : 'opt[^=]*=\(.*\)'`
|
|
+
|
|
+ case "x$1" in
|
|
+ x--disable-openssl)
|
|
+ openssl_disable="1";
|
|
+ shift;;
|
|
+ x--openssl-include=*)
|
|
+ OPENSSL_INC="$param";
|
|
+ shift;;
|
|
+ x--openssl-lib=*)
|
|
+ OPENSSL_LIB="$param";
|
|
+ shift;;
|
|
+ x--help)
|
|
+ usage
|
|
+ exit 0
|
|
+ shift;;
|
|
+ esac
|
|
+done
|
|
+##
|
|
+
|
|
+## OpenSSL: autocheck or disable
|
|
+if [ ${openssl_disable} = 1 ]; then
|
|
+ echo "OpenSSL: no, using built-in SHA1 implementation"
|
|
else
|
|
- echo "OpenSSL: no, using built-in SHA1 implementation"
|
|
+ openssl_test
|
|
fi
|
|
-rm -f testconf.c testconf
|
|
+##
|
|
|
|
-# Generate config.jam
|
|
+## Generate config.jam
|
|
rm -f config.jam
|
|
cat << EOF > config.jam
|
|
+CC = $CC ;
|
|
+CCFLAGS = $CFLAGS ;
|
|
DEFINES = $DEFINES ;
|
|
+LINK = $CC ;
|
|
LINKLIBS = $LINKLIBS ;
|
|
EOF
|
|
+##
|
|
|
|
echo
|
|
echo "To build Transmission, run 'jam'."
|
|
--- ../../Transmission/Jamrules Tue Oct 18 18:50:07 2005
|
|
+++ Jamrules Wed Oct 19 16:22:09 2005
|
|
@@ -12,7 +12,6 @@
|
|
DEFINES += VERSION_MAJOR=$(VERSION_MAJOR)
|
|
VERSION_MINOR=$(VERSION_MINOR)
|
|
VERSION_STRING=\\\"$(VERSION_STRING)\\\" ;
|
|
-CCFLAGS = -g -Wall -W ;
|
|
OPTIM = -O3 ;
|
|
RM = rm -Rf ;
|
|
|