rdesktop/configure

150 lines
3.4 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# rdesktop: A Remote Desktop Protocol client
# configure script
# Copyright (C) Matthew Chapman 1999-2001
#
echo "# Generated by $0 $*" >Makeconf
# Process command line options
cflags=
ldflags=
for arg in $*; do
optarg=`echo $arg | sed 's/[-a-z]*=//'`
case $arg in
--prefix=*)
echo "prefix = $optarg" >>Makeconf
;;
--exec-prefix=*)
echo "exec_prefix = $optarg" >>Makeconf
;;
--bindir=*)
echo "bindir = $optarg" >>Makeconf
;;
--mandir=*)
echo "mandir = $optarg" >>Makeconf
;;
--sharedir=*)
echo "datadir = $optarg" >>Makeconf
;;
--with-openssl*)
;;
--without-openssl*)
;;
--with-debug)
cflags="$cflags -g -DWITH_DEBUG"
;;
--with-debug-kbd)
cflags="$cflags -g -DWITH_DEBUG_KBD"
;;
--without-debug*)
;;
*)
echo "rdesktop build configuration script"
echo
echo "Target directories:"
echo " --prefix=PREFIX location for architecture-independent files"
echo " --exec-prefix=EPREFIX location for architecture-dependent files"
echo " --bindir=BINDIR location for program binaries [EPREFIX/bin]"
echo " --mandir=MANDIR location for man pages [PREFIX/man]"
echo " --sharedir=SHAREDIR location for architecture-independent shared files [PREFIX/share/rdesktop]"
echo
echo "Build configuration:"
echo " --with-debug enable protocol debugging output"
echo " --with-debug-kbd enable debugging of keyboard handling"
echo
rm -f Makeconf
exit 1
;;
esac
done
# Platform-specific options
need_runpath=no
case `uname -s` in
SunOS)
ldflags="$ldflags -lsocket -lnsl"
need_runpath=yes
;;
esac
# Find X installation
xdirs="/usr/X11R6 /usr/X11 /usr/openwin /usr /usr/local/X11R6 /usr/local/X11 /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 Window System headers"
echo "(searched for include/X11/Xlib.h in $xdirs)"
# additional helpful information for Linux users
if [ -f /etc/redhat_release ]; then
echo You probably need to install the XFree86-devel package
elif [ -f /etc/debian_version ]; then
echo You probably need to install the xlibs-dev package
fi
exit 1
fi
if [ $xdir != "/usr" ]; then
cflags="$cflags -I$xdir/include"
ldflags="$ldflags -L$xdir/lib"
if [ $need_runpath = "yes" ]; then
ldflags="$ldflags -R$xdir/lib"
fi
fi
ldflags="$ldflags -lX11"
# Find OpenSSL installation if available
ssldirs="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
for dir in $ssldirs; do
if [ -f $dir/include/openssl/rc4.h ]; then
ssldir=$dir
break
fi
done
if [ -z "$ssldir" ]; then
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
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
cflags="$cflags -DWITH_OPENSSL"
ldflags="$ldflags -lcrypto"
fi
echo "CFLAGS += $cflags" >>Makeconf
echo "LDFLAGS += $ldflags" >>Makeconf
echo "configure complete - now run make"