rdesktop/configure

104 lines
2.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
# 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
# Add platform-specific options
case `uname -s` in
SunOS)
echo "LDFLAGS += -R$(X11DIR)/lib -lsocket -lnsl" >>Makeconf
;;
esac
# Process command line options
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*)
echo "CFLAGS += -DWITH_OPENSSL" >>Makeconf
echo "LDFLAGS += -lcrypto" >>Makeconf
echo "CRYPTOBJ =" >>Makeconf
;;
--without-openssl*)
;;
--with-debug)
echo "CFLAGS += -g -DWITH_DEBUG" >>Makeconf
;;
--with-debug-kbd)
echo "CFLAGS += -g -DWITH_DEBUG_KBD" >>Makeconf
;;
--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-openssl use system OpenSSL libraries for crypto"
echo " --with-debug enable protocol debugging output"
echo " --with-debug-kbd enable debugging of keyboard handling"
echo
rm -f Makeconf
exit 1
;;
esac
done
echo "configure complete - now run make"