/[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 191 by matthewc, Tue Sep 24 07:58:34 2002 UTC revision 692 by stargo, Fri May 7 04:56:09 2004 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    withsound='yes'
20    
21  for arg in $*; do  for arg in $*; do
22  optarg=`echo $arg | sed 's/[-a-z]*=//'`      optarg=`echo $arg | sed 's/[-a-z]*=//'`
23  case $arg in  case $arg in
24    --prefix=*)    --prefix=*)
25      echo "prefix      = $optarg" >>Makeconf      echo "prefix      = $optarg" >>Makeconf
# Line 31  case $arg in Line 36  case $arg in
36    --sharedir=*)    --sharedir=*)
37      echo "datadir     = $optarg" >>Makeconf      echo "datadir     = $optarg" >>Makeconf
38      ;;      ;;
39      --with-x*)
40        extraxdir=$optarg
41        ;;
42    --with-openssl*)    --with-openssl*)
43        extrassldir=$optarg
44      ;;      ;;
45    --without-openssl*)    --without-openssl*)
46        withoutopenssl=yes
47        ;;
48      --with-egd-socket=*)
49        extraegdpath=$optarg
50        ;;
51      --with-libvncserver)
52        withvncserver=yes
53        ;;
54      --with-libvncserver-config=*)
55        vncserverconfig=$optarg
56      ;;      ;;
57    --with-debug)    --with-debug)
58      cflags="$cflags -g -DWITH_DEBUG"      cflags="$cflags -g -DWITH_DEBUG"
# Line 41  case $arg in Line 60  case $arg in
60    --with-debug-kbd)    --with-debug-kbd)
61      cflags="$cflags -g -DWITH_DEBUG_KBD"      cflags="$cflags -g -DWITH_DEBUG_KBD"
62      ;;      ;;
63      --with-debug-rdp5)
64        cflags="$cflags -g -DWITH_DEBUG_RDP5"
65        ;;
66      --with-debug-clipboard)
67        cflags="$cflags -g -DWITH_DEBUG_CLIPBOARD"
68        ;;
69    --without-debug*)    --without-debug*)
70      ;;      ;;
71      --with-ipv6)
72        cflags="$cflags -DIPv6"
73        ;;
74      --without-sound*)
75        withsound=no
76        ;;
77      --with-sound)
78        withsound=yes
79        ;;
80      --with-sound=oss)
81        withsound=$optarg
82        ;;
83      --with-sound=sun)
84        withsound=$optarg
85        ;;
86    *)    *)
     echo "rdesktop build configuration script"  
     echo  
87      echo "Target directories:"      echo "Target directories:"
88      echo " --prefix=PREFIX        location for architecture-independent files"      echo " --prefix=PREFIX         location for architecture-independent files"
89      echo " --exec-prefix=EPREFIX  location for architecture-dependent files"      echo " --exec-prefix=EPREFIX   location for architecture-dependent files"
90      echo " --bindir=BINDIR        location for program binaries [EPREFIX/bin]"      echo " --bindir=BINDIR         location for program binaries [EPREFIX/bin]"
91      echo " --mandir=MANDIR        location for man pages [PREFIX/man]"      echo " --mandir=MANDIR         location for man pages [PREFIX/man]"
92      echo " --sharedir=SHAREDIR    location for architecture-independent shared files [PREFIX/share/rdesktop]"      echo " --sharedir=SHAREDIR     location for architecture-independent shared files [PREFIX/share/rdesktop]"
93      echo      echo
94      echo "Build configuration:"      echo "Build configuration:"
95      echo " --with-debug           enable protocol debugging output"      echo " --with-x=DIR            look for X Window System at DIR/include, DIR/lib"
96      echo " --with-debug-kbd       enable debugging of keyboard handling"      echo " --with-openssl=DIR      look for OpenSSL at DIR/include, DIR/lib"
97        #echo " --without-openssl       use in-tree crypto, even if OpenSSL is available"
98        echo " --with-egd-socket=PATH  look for Entropy Gathering Daemon socket at PATH"
99        echo " --with-libvncserver     make rdp2vnc"
100        echo " --with-libvncserver-config=CMD"
101        echo "                         use CMD as libvncserver-config"
102        echo " --with-debug            enable protocol debugging output"
103        echo " --with-debug-kbd        enable debugging of keyboard handling"
104        echo " --with-debug-rdp5       enable debugging of RDP5 code"
105        echo " --with-debug-clipboard  enable debugging of clipboard code"
106        echo " --with-ipv6             enable support for IPv6"
107        echo " --without-sound         disable support for sound redirection"
108        echo " --with-sound=ARG        only detect sound-support for \"oss\" or \"sun\" (and BSD)"
109      echo      echo
110      rm -f Makeconf      rm -f Makeconf
111      exit 1      exit 1
# Line 64  esac Line 114  esac
114  done  done
115    
116    
117  # Platform-specific options  # Find compiler
118    
119  need_runpath=no  compilers="$CC gcc cc"
120    
121  case `uname -s` in  for compiler in $compilers; do
122    SunOS)      if [ -x "`which $compiler`" ]; then
123      ldflags="$ldflags -lsocket -lnsl"          cc=$compiler
124      need_runpath=yes          break
125      ;;      fi
126  esac  done
127    
128    if [ -z "$cc" ]; then
129        echo "ERROR: could not find a C compiler (tried: $compilers)"
130        echo "You probably want to install gcc"
131        exit 1
132    fi
133    
134    echo "CC          = $cc" >>Makeconf
135    
136    if $cc -v 2>&1 |grep '^gcc' >/dev/null; then
137        cflags="$cflags -Wall -O2"
138    else
139        cflags="$cflags -O"
140    fi
141    
142    
143    # Find install program
144    
145    if [ -z "$INSTALL" ]; then
146        # Want BSD install
147        if [ -x /usr/ucb/installbsd ]; then
148            INSTALL=/usr/ucb/installbsd
149        elif [ -x /usr/ucb/install ]; then
150            INSTALL=/usr/ucb/install
151        else
152            INSTALL=install
153        fi
154    fi
155    
156    echo "INSTALL     = $INSTALL" >>Makeconf
157    
158    
159  # Find X installation  # Find X installation
160    
161  xdirs="/usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local"  xdirs="$extraxdir /usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /usr/local"
162    
163  for dir in $xdirs; do  for dir in $xdirs; do
164      if [ -f $dir/include/X11/Xlib.h ]; then      if [ -f $dir/include/X11/Xlib.h ]; then
# Line 89  done Line 169  done
169    
170  if [ -z "$xdir" ]; then  if [ -z "$xdir" ]; then
171      echo "ERROR: could not find X Window System headers"      echo "ERROR: could not find X Window System headers"
172      echo "(searched for include/X11/Xlib.h in $xdirs)"      echo "(searched for include/X11/Xlib.h in: $xdirs)"
173    
174      # additional helpful information for Linux users      # additional helpful information for Linux users
175      if [ -f /etc/redhat_release ]; then      if [ -f /etc/redhat-release ]; then
176        echo You probably need to install the XFree86-devel package        echo You probably need to install the XFree86-devel package
177      elif [ -f /etc/debian_version ]; then      elif [ -f /etc/debian_version ]; then
178        echo You probably need to install the xlibs-dev package        echo You probably need to install the xlibs-dev package
# Line 100  if [ -z "$xdir" ]; then Line 180  if [ -z "$xdir" ]; then
180      exit 1      exit 1
181  fi  fi
182    
183    echo "X Window System:"
184    echo "  includes  $xdir/include"
185    echo "  libraries $xdir/lib"
186    echo
187    
188  if [ $xdir != "/usr" ]; then  if [ $xdir != "/usr" ]; then
189      cflags="$cflags -I$xdir/include"      cflags="$cflags -I$xdir/include"
190      ldflags="$ldflags -L$xdir/lib"      ldflags="$ldflags -L$xdir/lib"
191      if [ $need_runpath = "yes" ]; then      rpath="$rpath:$xdir/lib"
192          ldflags="$ldflags -R$xdir/lib"  fi
193    
194    ldflags="$ldflags"
195    targets="$targets rdesktop"
196    
197    #withoutopenssl not currently supported
198    #if [ -z "$withoutopenssl" ]; then
199        # Find OpenSSL installation if available
200        ssldirs="$extrassldir /usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
201        
202        for dir in $ssldirs; do
203            if [ -f $dir/include/openssl/rc4.h ]; then
204                ssldir=$dir
205                break
206            fi
207        done
208        
209        if [ -z "$ssldir" ]; then
210            echo "ERROR: could not find OpenSSL headers"
211            echo "(searched for include/openssl/rc4.h in: $ssldirs)"
212            # additional helpful information for Linux users
213            if [ -f /etc/redhat-release ]; then
214                echo You probably need to install the openssl-devel package
215            elif [ -f /etc/debian_version ]; then
216                echo You probably need to install the libssl-dev package
217            fi
218            exit 1
219        else
220            echo "OpenSSL:"
221            echo "  includes  $ssldir/include"
222            echo "  libraries $ssldir/lib"
223            echo
224        
225            echo "CRYPTOBJ    =" >>Makeconf
226        
227            if [ $ssldir != "/usr" ]; then
228                cflags="$cflags -I$ssldir/include"
229                ldflags="$ldflags -L$ssldir/lib"
230                rpath="$rpath:$ssldir/lib"
231            fi
232        
233            cflags="$cflags -DWITH_OPENSSL"
234            ldflags="$ldflags -lcrypto"
235        fi
236    #fi
237        
238    if [ ! -z "$withvncserver" ]; then
239        if [ -z "$vncserverconfig" ]; then
240            vncserverconfig=libvncserver-config
241      fi      fi
242    
243        echo "VNCINC=`$vncserverconfig --cflags`" >> Makeconf
244        echo "LDVNC=`$vncserverconfig --libs`" >> Makeconf
245        echo "CCLD=`$vncserverconfig --link`" >> Makeconf
246        echo >> Makeconf
247        targets="$targets rdp2vnc"
248    
249        echo "Found libvncserver: Building rdp2vnc"
250  fi  fi
251    
 ldflags="$ldflags -lX11"  
252    
253    # Find EGD socket if we don't have /dev/urandom or /dev/random
254    
255  # Find OpenSSL installation if available  if [ ! -c /dev/random -a ! -c /dev/urandom ]; then
256        egdpaths="$extraegdpath /var/run/egd-pool /dev/egd-pool /etc/egd-pool /etc/entropy"
257    
258  ssldirs="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"      for path in $egdpaths; do
259            # -e isn't portable, so we use -r
260            if [ -r $path ]; then
261                egdpath=$path
262                break
263            fi
264        done
265    
266  for dir in $ssldirs; do      if [ -z "$egdpath" ]; then
267      if [ -f $dir/include/openssl/rc4.h ]; then          echo "WARNING: could not find /dev/urandom, /dev/random or Entropy Gathering Daemon (EGD) socket"
268          ssldir=$dir          echo "(searched: $egdpaths)"
269          break          echo "Session keys may be less secure; installing a system randomness source is recommended."
270            echo
271        else
272            echo "Entropy Gathering Daemon (EGD):"
273            echo "  socket    $egdpath"
274            echo
275            cflags="$cflags -DEGD_SOCKET=\\\"$egdpath\\\""
276      fi      fi
277  done  fi
278    
279  if [ -z "$ssldir" ]; then  # Check for OSS sound support
280      echo "WARNING: could not find OpenSSL headers"  
281      echo "(searched for include/openssl/rc4.h in $ssldirs)"  if [ -f /usr/include/sys/soundcard.h -a \( "$withsound" = "yes" -o "$withsound" = "oss" \) ]; then
282      echo "Using in-tree crypto; installing OpenSSL is recommended."      echo Sound support enabled: Open Sound System
283        echo
284        echo "SOUNDOBJ    = rdpsnd.o rdpsnd_oss.o" >>Makeconf
285        cflags="$cflags -DWITH_RDPSND"
286    elif [ -f /usr/include/sys/audioio.h -a \( "$withsound" = "yes" -o "$withsound" = "sun" \) ]; then
287        echo Sound support enabled: Sun/BSD
288      echo      echo
289        echo "SOUNDOBJ    = rdpsnd.o rdpsnd_sun.o" >>Makeconf
290        cflags="$cflags -DWITH_RDPSND"
291  else  else
292      echo "CRYPTOBJ    =" >>Makeconf      echo "WARNING: sound support disabled (no /usr/include/sys/soundcard.h or /usr/include/sys/audioio.h)"
293        echo "Currently supported systems are Open Sound System (oss) and Sun/BSD (sun)"
294        echo
295    fi
296    
     if [ $ssldir != "/usr" ]; then  
         cflags="$cflags -I$ssldir/include"  
         ldflags="$ldflags -L$ssldir/lib"  
         if [ $need_runpath = "yes" ]; then  
             ldflags="$ldflags -R$ssldir/lib"  
         fi  
     fi  
297    
298      cflags="$cflags -DWITH_OPENSSL"  # Platform-specific options
299      ldflags="$ldflags -lcrypto"  
300    #Endianess
301    cat >conftest.$$.c << EOF
302    #include <stdlib.h>
303    #include <signal.h>
304    
305    int main(int argc, char **argv)
306    {
307            int test = 1;
308    
309            return(*(unsigned char*) (&test));
310    }
311    EOF
312    $cc -o conftest.$$ conftest.$$.c
313    ./conftest.$$
314    if [ "$?" = "0" ]; then
315            echo "Architecture is big-endian"
316            echo
317            cflags="$cflags -DB_ENDIAN"
318    else
319            echo "Architecture is little-endian"
320            echo
321            cflags="$cflags -DL_ENDIAN"
322    fi
323    rm conftest.$$ conftest.$$.c
324    
325    #Alignment
326    cat >conftest.$$.c << EOF
327    #include <stdlib.h>
328    #include <signal.h>
329    int main(int argc, char **argv)
330    {
331            unsigned char test[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 };
332            signal(SIGBUS, exit);
333            signal(SIGABRT, exit);
334            signal(SIGSEGV, exit);
335            if (*((unsigned int *)(test + 1)) != 0x55443322 && *((unsigned int *)(test + 1)) != 0x22334455) {
336                    return 1;
337            }
338            return 0;
339    }
340    EOF
341    $cc -o conftest.$$ conftest.$$.c
342    need_alignment=yes
343    ./conftest.$$ && need_alignment=no
344    if [ "$need_alignment" = "yes" ]; then
345            echo "Architecture needs alignment"
346            echo
347            cflags="$cflags -DNEED_ALIGN"
348  fi  fi
349    rm conftest.$$ conftest.$$.c
350    
351    # strip leading colon from rpath
352    rpath=`echo $rpath |sed 's/^://'`
353    
354    case `uname -s` in
355      SunOS)
356        ldflags="$ldflags -lsocket -lnsl -R$rpath"
357        ;;
358      OSF1)
359        ldflags="$ldflags -Wl,-rpath,$rpath"
360        ;;
361      HP-UX)
362        cflags="$cflags -D_XOPEN_SOURCE_EXTENDED"
363        ;;
364    esac
365    
366  echo "CFLAGS     += $cflags" >>Makeconf  
367  echo "LDFLAGS    += $ldflags" >>Makeconf  echo "CFLAGS      = $cflags" >>Makeconf
368    echo "LDFLAGS     = $ldflags" >>Makeconf
369    echo "TARGETS     = $targets" >>Makeconf
370    
371  echo "configure complete - now run make"  echo "configure complete - now run make"
372    

Legend:
Removed from v.191  
changed lines
  Added in v.692

  ViewVC Help
Powered by ViewVC 1.1.26