source: trunk/configure.make @ 134

Last change on this file since 134 was 134, checked in by titer, 16 years ago

Started to switch to a Makefile-based build system (still very incomplete,
so the Jamfile are still there).
Set a few svn:ignore properties.

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#! /bin/sh
2
3#
4# Default settings
5#
6SYSTEM=
7BEOS_NETSERVER=no
8MATH=no
9PTHREAD=no
10OPENSSL=
11CC="${CC-cc}"
12CFLAGS="${CFLAGS}"
13LDFLAGS="${LDFLAGS}"
14
15
16#
17# Functions
18#
19usage()
20{
21  cat << EOF
22
23Options:
24  --disable-openssl      Disable OpenSSL, use built-in SHA1 implementation
25
26Some influential environment variables:
27  CC          C compiler command
28  CFLAGS      C compiler flags
29  LDFLAGS     linker flags
30
31EOF
32}
33
34openssl_test()
35{
36  cat > testconf.c << EOF
37  #include <stdio.h>
38  #include <openssl/sha.h>
39  int main()
40  {
41      SHA1( 0, 0, 0 );
42  }
43EOF
44  if $CC $CFLAGS $LDFLAGS -o testconf testconf.c -lcrypto > /dev/null 2>&1
45  then
46    echo "yes"
47    OPENSSL=yes
48  else
49    echo "missing, using built-in SHA1 implementation"
50    OPENSSL=no
51  fi
52  rm -f testconf.c testconf
53}
54
55
56#
57# Parse options
58#
59while [ $# -ne 0 ]; do
60  param=`expr "opt$1" : 'opt[^=]*=\(.*\)'`
61
62  case "x$1" in
63    x--disable-openssl)
64      OPENSSL=no
65      ;;
66    x--help)
67      usage
68      exit 0
69      ;;
70  esac
71  shift
72done
73
74#
75# System-specific flags
76#
77SYSTEM=`uname -s`
78case $SYSTEM in
79  BeOS)
80    RELEASE=`uname -r`
81    case $RELEASE in
82      6.0*|5.0.4) # Zeta or R5 / BONE beta 7
83        ;;
84      5.0*)       # R5 / net_server
85        BEOS_NETSERVER=yes
86        ;;
87      *)
88        echo "Unsupported BeOS version"
89        exit 1 
90        ;;
91    esac
92    ;;
93
94  Darwin)
95    # Make sure the Universal SDK is installed
96    if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk ]; then
97      cat << EOF
98You need to install the Universal SDK in order to build Transmission:
99  Get your Xcode CD or package
100  Restart the install
101  When it gets to "Installation Type", select "Customize"
102  Select "Mac OS X 10.4 (Universal) SDL" under "Cross Development"
103  Finish the install.
104EOF
105      exit 1
106    fi
107    PTHREAD=yes
108    ;;
109
110  FreeBSD|NetBSD|OpenBSD|Linux)
111    MATH=yes
112    PTHREAD=yes
113    ;;
114
115  *)
116    echo "Unsupported operating system"
117    exit 1 ;;
118esac
119echo "System:  $SYSTEM"
120
121#
122# OpenSSL settings
123#
124echo -n "OpenSSL: "
125if [ "$OPENSSL" = no ]; then
126  echo "disabled, using built-in SHA1 implementation"
127else
128  openssl_test
129fi 
130
131#
132# Generate Makefile.config
133#
134rm -f Makefile.config
135cat > Makefile.config << EOF
136SYSTEM         = $SYSTEM
137BEOS_NETSERVER = $BEOS_NETSERVER
138MATH           = $MATH
139PTHREAD        = $PTHREAD
140OPENSSL        = $OPENSSL
141CC             = $CC
142CFLAGS         = $CFLAGS
143LDFLAGS        = $LDFLAGS
144EOF
145
146echo
147echo "To build Transmission, run 'make'."
Note: See TracBrowser for help on using the repository browser.