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

Legend:
Removed from v.189  
changed lines
  Added in v.341

  ViewVC Help
Powered by ViewVC 1.1.26