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

Legend:
Removed from v.156  
changed lines
  Added in v.258

  ViewVC Help
Powered by ViewVC 1.1.26