/[rdesktop]/sourceforge.net/trunk/rdesktop/configure
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/configure

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 187 by matthewc, Tue Sep 24 05:14:14 2002 UTC revision 298 by matthewc, Thu Jan 30 10:57:38 2003 UTC
# Line 2  Line 2 
2  #  #
3  # rdesktop: A Remote Desktop Protocol client  # rdesktop: A Remote Desktop Protocol client
4  # configure script  # configure script
5  # Copyright (C) Matthew Chapman 1999-2001  # Copyright (C) Matthew Chapman 1999-2002
6  #  #
7    
8  echo "# Generated by $0 $*" >Makeconf  echo "rdesktop build configuration script"
9    echo
   
 # Choose gcc if available  
   
 if `which gcc >/dev/null`; then  
     echo "CC          = gcc" >>Makeconf  
 fi  
   
   
 # Find X installation  
   
 xdirs="/usr/X11 /usr/X11R6 /usr/openwin /usr /usr/local/X11 /usr/local/X11R6 /usr/local"  
   
 for dir in $xdirs; do  
     if [ -f $dir/include/X11/Xlib.h ]; then  
         xdir=$dir  
         break  
     fi  
 done  
   
 if [ -z $xdir ]; then  
     echo "ERROR: could not find X installation"  
     echo "(searched for include/X11/Xlib.h in $xdirs)"  
     exit 1  
 fi  
   
 echo "X11DIR      = $xdir" >> Makeconf  
   
10    
11  # Add platform-specific options  echo "# Generated by $0 $*" >Makeconf
   
 case `uname -s` in  
   SunOS)  
     echo "LDFLAGS    += -R$(X11DIR)/lib -lsocket -lnsl" >>Makeconf  
     ;;  
 esac  
12    
13    
14  # Process command line options  # Process command line options
15    
16    cflags='-DKEYMAP_PATH=\"$(KEYMAP_PATH)\"'
17    ldflags=''
18    rpath=
19    
20  for arg in $*; do  for arg in $*; do
21  optarg=`echo $arg | sed 's/[-a-z]*=//'`      optarg=`echo $arg | sed 's/[-a-z]*=//'`
22  case $arg in  case $arg in
23    --prefix=*)    --prefix=*)
24      echo "prefix      = $optarg" >>Makeconf      echo "prefix      = $optarg" >>Makeconf
# Line 64  case $arg in Line 35  case $arg in
35    --sharedir=*)    --sharedir=*)
36      echo "datadir     = $optarg" >>Makeconf      echo "datadir     = $optarg" >>Makeconf
37      ;;      ;;
38      --with-x*)
39        extraxdir=$optarg
40        ;;
41    --with-openssl*)    --with-openssl*)
42      echo "CFLAGS     += -DWITH_OPENSSL" >>Makeconf      extrassldir=$optarg
     echo "LDFLAGS    += -lcrypto" >>Makeconf  
     echo "CRYPTOBJ    =" >>Makeconf  
43      ;;      ;;
44    --without-openssl*)    --without-openssl*)
45        withoutopenssl=yes
46        ;;
47      --with-egd-socket=*)
48        extraegdpath=$optarg
49      ;;      ;;
50    --with-debug)    --with-debug)
51      echo "CFLAGS     += -g -DWITH_DEBUG" >>Makeconf      cflags="$cflags -g -DWITH_DEBUG"
52      ;;      ;;
53    --with-debug-kbd)    --with-debug-kbd)
54      echo "CFLAGS     += -g -DWITH_DEBUG_KBD" >>Makeconf      cflags="$cflags -g -DWITH_DEBUG_KBD"
55      ;;      ;;
56    --without-debug*)    --without-debug*)
57      ;;      ;;
58    *)    *)
     echo "rdesktop build configuration script"  
     echo  
59      echo "Target directories:"      echo "Target directories:"
60      echo " --prefix=PREFIX        location for architecture-independent files"      echo " --prefix=PREFIX         location for architecture-independent files"
61      echo " --exec-prefix=EPREFIX  location for architecture-dependent files"      echo " --exec-prefix=EPREFIX   location for architecture-dependent files"
62      echo " --bindir=BINDIR        location for program binaries [EPREFIX/bin]"      echo " --bindir=BINDIR         location for program binaries [EPREFIX/bin]"
63      echo " --mandir=MANDIR        location for man pages [PREFIX/man]"      echo " --mandir=MANDIR         location for man pages [PREFIX/man]"
64      echo " --sharedir=SHAREDIR    location for architecture-independent shared files [PREFIX/share/rdesktop]"      echo " --sharedir=SHAREDIR     location for architecture-independent shared files [PREFIX/share/rdesktop]"
65      echo      echo
66      echo "Build configuration:"      echo "Build configuration:"
67      echo " --with-openssl         use system OpenSSL libraries for crypto"      echo " --with-x=DIR            look for X Window System at DIR/include, DIR/lib"
68      echo " --with-debug           enable protocol debugging output"      echo " --with-openssl=DIR      look for OpenSSL at DIR/include, DIR/lib"
69      echo " --with-debug-kbd       enable debugging of keyboard handling"      echo " --without-openssl       use in-tree crypto, even if OpenSSL is available"
70        echo " --with-egd-socket=PATH  look for Entropy Gathering Daemon socket at PATH"
71        echo " --with-debug            enable protocol debugging output"
72        echo " --with-debug-kbd        enable debugging of keyboard handling"
73      echo      echo
74      rm -f Makeconf      rm -f Makeconf
75      exit 1      exit 1
# Line 100  case $arg in Line 77  case $arg in
77  esac  esac
78  done  done
79    
80    
81    # Find compiler
82    
83    compilers="$CC gcc cc"
84    
85    for compiler in $compilers; do
86        if [ -x "`which $compiler`" ]; then
87            cc=$compiler
88            break
89        fi
90    done
91    
92    if [ -z "$cc" ]; then
93        echo "ERROR: could not find a C compiler (tried: $compilers)"
94        echo "You probably want to install gcc"
95        exit 1
96    fi
97    
98    echo "CC          = $cc" >>Makeconf
99    
100    if $cc -v 2>&1 |grep '^gcc' >/dev/null; then
101        cflags="$cflags -Wall -O2"
102    else
103        cflags="$cflags -O"
104    fi
105    
106    
107    # Find X installation
108    
109    xdirs="$extraxdir /usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local"
110    
111    for dir in $xdirs; do
112        if [ -f $dir/include/X11/Xlib.h ]; then
113            xdir=$dir
114            break
115        fi
116    done
117    
118    if [ -z "$xdir" ]; then
119        echo "ERROR: could not find X Window System headers"
120        echo "(searched for include/X11/Xlib.h in: $xdirs)"
121    
122        # additional helpful information for Linux users
123        if [ -f /etc/redhat_release ]; then
124          echo You probably need to install the XFree86-devel package
125        elif [ -f /etc/debian_version ]; then
126          echo You probably need to install the xlibs-dev package
127        fi
128        exit 1
129    fi
130    
131    echo "X Window System:"
132    echo "  includes  $xdir/include"
133    echo "  libraries $xdir/lib"
134    echo
135    
136    if [ $xdir != "/usr" ]; then
137        cflags="$cflags -I$xdir/include"
138        ldflags="$ldflags -L$xdir/lib"
139        rpath="$rpath:$xdir/lib"
140    fi
141    
142    ldflags="$ldflags -lX11"
143    
144    
145    if [ -z "$withoutopenssl" ]; then
146        # Find OpenSSL installation if available
147        ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
148        
149        for dir in $ssldirs; do
150            if [ -f $dir/include/openssl/rc4.h ]; then
151                ssldir=$dir
152                break
153            fi
154        done
155        
156        if [ -z "$ssldir" ]; then
157            echo "WARNING: could not find OpenSSL headers"
158            echo "(searched for include/openssl/rc4.h in: $ssldirs)"
159            echo "Using in-tree crypto; installing OpenSSL is recommended."
160            echo
161        else
162            echo "OpenSSL:"
163            echo "  includes  $ssldir/include"
164            echo "  libraries $ssldir/lib"
165            echo
166        
167            echo "CRYPTOBJ    =" >>Makeconf
168        
169            if [ $ssldir != "/usr" ]; then
170                cflags="$cflags -I$ssldir/include"
171                ldflags="$ldflags -L$ssldir/lib"
172                rpath="$rpath:$ssldir/lib"
173            fi
174        
175            cflags="$cflags -DWITH_OPENSSL"
176            ldflags="$ldflags -lcrypto"
177        fi
178    fi
179        
180    
181    # Find EGD socket if we don't have /dev/urandom or /dev/random
182    
183    if [ ! -c /dev/random -a ! -c /dev/urandom ]; then
184        egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy"
185    
186        for path in $egdpaths; do
187            # -e isn't portable, so we use -r
188            if [ -r $path ]; then
189                egdpath=$path
190                break
191            fi
192        done
193    
194        if [ -z "$egdpath" ]; then
195            echo "WARNING: could not find /dev/urandom, /dev/random or Entropy Gathering Daemon (EGD) socket"
196            echo "(searched: $egdpaths)"
197            echo "Session keys may be less secure; installing a system randomness source is recommended."
198            echo
199        else
200            echo "Entropy Gathering Daemon (EGD):"
201            echo "  socket    $egdpath"
202            echo
203            cflags="$cflags -DEGD_SOCKET=\\\"$egdpath\\\""
204        fi
205    fi
206    
207    
208    # Platform-specific options
209    
210    # strip leading colon from rpath
211    rpath=`echo $rpath |sed 's/^://'`
212    
213    case `uname -s` in
214      SunOS)
215        ldflags="$ldflags -lsocket -lnsl -R$rpath"
216        ;;
217      OSF1)
218        ldflags="$ldflags -Wl,-rpath,$rpath"
219        ;;
220    esac
221    
222    
223    echo "CFLAGS      = $cflags" >>Makeconf
224    echo "LDFLAGS     = $ldflags" >>Makeconf
225    
226  echo "configure complete - now run make"  echo "configure complete - now run make"
227    

Legend:
Removed from v.187  
changed lines
  Added in v.298

  ViewVC Help
Powered by ViewVC 1.1.26